[yelp-xsl] dita2html: First pass at xref/href, and fix id attributes
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl] dita2html: First pass at xref/href, and fix id attributes
- Date: Mon, 8 Oct 2012 02:12:28 +0000 (UTC)
commit 68d8199bcdde395656c7f8b53c9e606e7a2aed2f
Author: Shaun McCance <shaunm gnome org>
Date: Sun Oct 7 22:11:47 2012 -0400
dita2html: First pass at xref/href, and fix id attributes
xslt/dita/common/dita-ref.xsl | 93 +++++++++++++++++++++++++++++++++--
xslt/dita/common/dita-selectors.mod | 6 ++
xslt/dita/html/dita2html-block.xsl | 20 +++++---
xslt/dita/html/dita2html-inline.xsl | 71 ++++++++++++++++++++++++++-
xslt/dita/html/dita2html-list.xsl | 36 +++++++-------
xslt/dita/html/dita2html-table.xsl | 10 ++--
xslt/dita/html/dita2html-topic.xsl | 12 ++--
7 files changed, 207 insertions(+), 41 deletions(-)
---
diff --git a/xslt/dita/common/dita-ref.xsl b/xslt/dita/common/dita-ref.xsl
index 4df1dfc..e054446 100644
--- a/xslt/dita/common/dita-ref.xsl
+++ b/xslt/dita/common/dita-ref.xsl
@@ -22,8 +22,10 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:func="http://exslt.org/functions"
+ xmlns:yelp="http://projects.gnome.org/yelp/"
xmlns="http://www.w3.org/1999/xhtml"
extension-element-prefixes="func"
+ exclude-result-prefixes="yelp"
version="1.0">
<!--!!==========================================================================
@@ -36,6 +38,20 @@ REMARK: Describe this module
<xsl:key name="dita.id.key" match="*[ id][not(self::&topic_topic_all;)]"
use="concat(ancestor-or-self::&topic_topic_all;[1]/@id, '/', @id)"/>
+<xsl:template name="dita.id">
+ <xsl:param name="node" select="."/>
+ <xsl:choose>
+ <xsl:when test="$node/self::&topic_topic;">
+ <xsl:copy-of select="$node/@id"/>
+ </xsl:when>
+ <xsl:when test="$node/@id">
+ <xsl:attribute name="id">
+ <xsl:value-of select="concat($node/ancestor::&topic_topic;[ id][1]/@id, '::', $node/@id)"/>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
<xsl:template name="dita.ref.conref.attr">
<xsl:param name="attr"/>
<xsl:param name="node"/>
@@ -51,7 +67,7 @@ REMARK: Describe this module
</xsl:choose>
</xsl:template>
-<func:function xmlns:yelp="http://projects.gnome.org/yelp/" name="yelp:dita.ref.conref">
+<func:function name="yelp:dita.ref.conref">
<xsl:param name="node" select="."/>
<xsl:choose>
<xsl:when test="not($node/@conref)">
@@ -85,16 +101,83 @@ REMARK: Describe this module
</xsl:choose>
</func:function>
-<!--
-<xsl:template name="dita.conref.node">
+<xsl:template name="dita.ref.href.target">
<xsl:param name="node" select="."/>
+ <xsl:param name="href" select="$node/@href"/>
+ <xsl:variable name="conref" select="yelp:dita.ref.conref($node)"/>
+ <xsl:variable name="format">
+ <xsl:call-template name="dita.ref.conref.attr">
+ <xsl:with-param name="attr" select="'format'"/>
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="conref" select="$conref"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="scope">
+ <xsl:call-template name="dita.ref.conref.attr">
+ <xsl:with-param name="attr" select="'scope'"/>
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="conref" select="$conref"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="type">
+ <xsl:call-template name="dita.ref.conref.attr">
+ <xsl:with-param name="attr" select="'type'"/>
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="conref" select="$conref"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="custom">
+ <xsl:call-template name="dita.ref.href.target.custom">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="href" select="$href"/>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:choose>
- <xsl:when test="$node/@conref">
+ <xsl:when test="$custom != ''">
+ <xsl:value-of select="$custom"/>
+ </xsl:when>
+ <xsl:when test="$scope = 'external' or ($format != '' and $format != 'dita')">
+ <xsl:value-of select="$href"/>
</xsl:when>
<xsl:otherwise>
+ <xsl:variable name="uri">
+ <xsl:choose>
+ <xsl:when test="contains($href, '#')">
+ <xsl:value-of select="substring-before($href, '#')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$href"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="frag">
+ <xsl:if test="contains($href, '#')">
+ <xsl:value-of select="substring-after($href, '#')"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if test="$uri != ''">
+ <xsl:text>FIXME</xsl:text>
+ </xsl:if>
+ <xsl:if test="$frag != ''">
+ <xsl:text>#</xsl:text>
+ <xsl:choose>
+ <xsl:when test="contains($frag, '/')">
+ <xsl:value-of select="substring-before($frag, '/')"/>
+ <xsl:text>::</xsl:text>
+ <xsl:value-of select="substring-after($frag, '/')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$frag"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
--->
+
+<xsl:template name="dita.ref.href.target.custom">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="href" select="$node/@href"/>
+</xsl:template>
</xsl:stylesheet>
diff --git a/xslt/dita/common/dita-selectors.mod b/xslt/dita/common/dita-selectors.mod
index 3c724d0..a7fac17 100644
--- a/xslt/dita/common/dita-selectors.mod
+++ b/xslt/dita/common/dita-selectors.mod
@@ -360,3 +360,9 @@ topic/ul
name(.) = 'ul' or name(.) = 'choices' or
starts-with(@class, '- topic/ul ')
]">
+
+<!-- ===========================================================================
+topic/xref
+-->
+<!ENTITY topic_xref "*[name(.) = 'xref' or starts-with(@class, '- topic/xref ')]">
+
diff --git a/xslt/dita/html/dita2html-block.xsl b/xslt/dita/html/dita2html-block.xsl
index 54ddc06..cb911d4 100644
--- a/xslt/dita/html/dita2html-block.xsl
+++ b/xslt/dita/html/dita2html-block.xsl
@@ -47,7 +47,9 @@ FIXME
<xsl:param name="class" select="''"/>
<xsl:variable name="conref" select="yelp:dita.ref.conref($node)"/>
<div>
- <xsl:copy-of select="$node/@id"/>
+ <xsl:call-template name="dita.id">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
<xsl:call-template name="html.lang.attrs">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
@@ -75,7 +77,9 @@ FIXME
<xsl:param name="class" select="''"/>
<xsl:variable name="conref" select="yelp:dita.ref.conref($node)"/>
<p>
- <xsl:copy-of select="$node/@id"/>
+ <xsl:call-template name="dita.id">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
<xsl:call-template name="html.lang.attrs">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
@@ -102,7 +106,9 @@ FIXME
<xsl:param name="class" select="''"/>
<xsl:variable name="conref" select="yelp:dita.ref.conref($node)"/>
<div class="code">
- <xsl:copy-of select="$node/@id"/>
+ <xsl:call-template name="dita.id">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
<xsl:call-template name="html.lang.attrs">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
@@ -157,7 +163,7 @@ FIXME
</xsl:choose>
</xsl:variable>
<div class="{$style}">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/&topic_title;"/>
@@ -208,7 +214,7 @@ FIXME
</xsl:choose>
</xsl:variable>
<div>
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:attribute name="class">
<xsl:text>note</xsl:text>
@@ -262,7 +268,7 @@ FIXME
<xsl:template mode="dita2html.topic.mode" match="&topic_section;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<div class="section">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<!-- A DITA section may have an optional title. But it can be anywhere
in the child node list. And there could be more than one, but all
@@ -316,7 +322,7 @@ FIXME
</xsl:choose>
</xsl:variable>
<div class="title">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:element name="{concat('h', $depth_)}" namespace="{$html.namespace}">
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
diff --git a/xslt/dita/html/dita2html-inline.xsl b/xslt/dita/html/dita2html-inline.xsl
index f019cd0..15f5273 100644
--- a/xslt/dita/html/dita2html-inline.xsl
+++ b/xslt/dita/html/dita2html-inline.xsl
@@ -45,7 +45,9 @@ FIXME
<xsl:param name="node" select="."/>
<xsl:param name="class" select="local-name($node)"/>
<span class="{$class}">
- <xsl:copy-of select="$node/@id"/>
+ <xsl:call-template name="dita.id">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
<xsl:call-template name="html.lang.attrs">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
@@ -177,4 +179,71 @@ FIXME
</xsl:call-template>
</xsl:template>
+<!-- = xref = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_xref;">
+ <xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
+ <xsl:variable name="format">
+ <xsl:call-template name="dita.ref.conref.attr">
+ <xsl:with-param name="attr" select="'format'"/>
+ <xsl:with-param name="node" select="."/>
+ <xsl:with-param name="conref" select="$conref"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="scope">
+ <xsl:call-template name="dita.ref.conref.attr">
+ <xsl:with-param name="attr" select="'scope'"/>
+ <xsl:with-param name="node" select="."/>
+ <xsl:with-param name="conref" select="$conref"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="type">
+ <xsl:call-template name="dita.ref.conref.attr">
+ <xsl:with-param name="attr" select="'type'"/>
+ <xsl:with-param name="node" select="."/>
+ <xsl:with-param name="conref" select="$conref"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:call-template name="dita.ref.href.target"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$conref/node()[not(self::&topic_desc;)]">
+ <xsl:apply-templates mode="dita2html.topic.mode"
+ select="$conref/node()[not(self::&topic_desc;)]"/>
+ </xsl:when>
+ <xsl:when test="$scope = 'external' or ($format != '' and $format != 'dita')">
+ <xsl:value-of select="@href"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="href" select="@href"/>
+ <xsl:variable name="uri">
+ <xsl:choose>
+ <xsl:when test="contains($href, '#')">
+ <xsl:value-of select="substring-before($href, '#')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$href"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:for-each name="target" select="document($uri, .)">
+ <xsl:variable name="frag">
+ <xsl:choose>
+ <xsl:when test="contains($href, '#')">
+ <xsl:value-of select="substring-after($href, '#')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="/*/@id"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="tnode" select="key('dita.id.key', $frag)"/>
+ <xsl:apply-templates mode="dita2html.topic.mode" select="$tnode/&topic_title;/node()"/>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </a>
+</xsl:template>
+
</xsl:stylesheet>
diff --git a/xslt/dita/html/dita2html-list.xsl b/xslt/dita/html/dita2html-list.xsl
index 8d9fe5f..1f0bd59 100644
--- a/xslt/dita/html/dita2html-list.xsl
+++ b/xslt/dita/html/dita2html-list.xsl
@@ -39,7 +39,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_choice;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<li class="list">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</li>
@@ -49,7 +49,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_choices;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<div class="list">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<ul class="list">
@@ -63,7 +63,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_dd;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<dd class="terms">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</dd>
@@ -73,7 +73,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_ddhd;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<dd class="terms ddhd">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</dd>
@@ -90,7 +90,7 @@ REMARK: Describe this module
</xsl:call-template>
</xsl:variable>
<div class="terms">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<dl>
<xsl:attribute name="class">
@@ -120,7 +120,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_dt;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<dt class="terms">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</dt>
@@ -130,7 +130,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_dthd;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<dt class="terms dthd">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</dt>
@@ -140,7 +140,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_li;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<li class="list">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</li>
@@ -157,7 +157,7 @@ REMARK: Describe this module
</xsl:call-template>
</xsl:variable>
<div class="list">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<ol>
@@ -184,7 +184,7 @@ REMARK: Describe this module
</xsl:call-template>
</xsl:variable>
<div class="list">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<ul>
@@ -210,7 +210,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_sli;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<li class="list">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</li>
@@ -221,7 +221,7 @@ REMARK: Describe this module
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<xsl:variable name="pre" select="preceding-sibling::&topic_step;"/>
<li class="steps" value="{count($pre) + 1}">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</li>
@@ -231,7 +231,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_steps;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<div class="steps">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<div class="region">
@@ -247,7 +247,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_steps-unordered;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<div class="steps">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<div class="region">
@@ -263,7 +263,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_stepsection;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<li class="stepsection">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</li>
@@ -273,7 +273,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_substep;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<li class="steps substeps">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
</li>
@@ -283,7 +283,7 @@ REMARK: Describe this module
<xsl:template mode="dita2html.topic.mode" match="&topic_substeps;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<div class="substeps">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<ol class="substeps">
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
@@ -302,7 +302,7 @@ REMARK: Describe this module
</xsl:call-template>
</xsl:variable>
<div class="list">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<ul>
diff --git a/xslt/dita/html/dita2html-table.xsl b/xslt/dita/html/dita2html-table.xsl
index ac08ca9..996a5fa 100644
--- a/xslt/dita/html/dita2html-table.xsl
+++ b/xslt/dita/html/dita2html-table.xsl
@@ -38,7 +38,7 @@ REMARK: Describe this module
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<xsl:variable name="keycol" select="@keycol"/>
<div class="table">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<table class="table">
<xsl:for-each select="$conref/&topic_sthead;[1]">
@@ -64,7 +64,9 @@ REMARK: Describe this module
<xsl:param name="keycol"/>
<xsl:variable name="conref" select="yelp:dita.ref.conref($node)"/>
<tr>
- <xsl:copy-of select="$node/@id"/>
+ <xsl:call-template name="dita.id">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
<xsl:call-template name="html.lang.attrs">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
@@ -72,7 +74,7 @@ REMARK: Describe this module
<xsl:choose>
<xsl:when test="position() = $keycol or $node[self::&topic_sthead;]">
<th>
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode"
select="yelp:dita.ref.conref(.)/node()"/>
@@ -80,7 +82,7 @@ REMARK: Describe this module
</xsl:when>
<xsl:otherwise>
<td>
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="dita2html.topic.mode"
select="yelp:dita.ref.conref(.)/node()"/>
diff --git a/xslt/dita/html/dita2html-topic.xsl b/xslt/dita/html/dita2html-topic.xsl
index 602b9d7..b16cb79 100644
--- a/xslt/dita/html/dita2html-topic.xsl
+++ b/xslt/dita/html/dita2html-topic.xsl
@@ -111,7 +111,7 @@ th { text-align: left; }
<xsl:choose>
<xsl:when test="parent::&topic_topic;">
<div class="sect">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<xsl:call-template name="_dita2html.topic.inner"/>
@@ -156,7 +156,7 @@ th { text-align: left; }
<xsl:template mode="dita2html.topic.mode" match="&topic_body;">
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/>
<div class="region">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="contents">
<xsl:apply-templates mode="dita2html.topic.mode" select="$conref/node()"/>
@@ -169,7 +169,7 @@ th { text-align: left; }
<div class="hgroup"/>
<div class="contents">
<div class="links">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<div class="region">
@@ -186,7 +186,7 @@ th { text-align: left; }
<xsl:template mode="dita2html.topic.mode" match="&topic_link;">
<!-- FIXME -->
<li class="links">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<a>
<xsl:attribute name="href">
@@ -222,7 +222,7 @@ th { text-align: left; }
<xsl:template mode="dita2html.topic.mode" match="&topic_linkinfo;">
<li class="links links-linkinfo">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates modes="dita2html.topic.mode"/>
</li>
@@ -233,7 +233,7 @@ th { text-align: left; }
<xsl:when test="&topic_title; or &topic_desc; or &topic_linkinfo;">
<li class="links">
<div class="links">
- <xsl:copy-of select="@id"/>
+ <xsl:call-template name="dita.id"/>
<xsl:call-template name="html.lang.attrs"/>
<div class="inner">
<xsl:apply-templates mode="dita2html.topic.mode" select="&topic_title;"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]