]> granicus.if.org Git - docbook-dsssl/commitdiff
Use named anchors for primary, secondary, and tertiary ids so
authorBob Stayton <bobs@sagehill.net>
Mon, 16 Mar 2009 02:49:10 +0000 (02:49 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 16 Mar 2009 02:49:10 +0000 (02:49 +0000)
duplicate entries with different ids can still have an id output.

xsl/html/autoidx.xsl

index ad9f817d633dcae4340e988d39d017792e9b7521..4a14c63ddec07944af7c0b16f193951c4a3f4f19 100644 (file)
   <xsl:variable name="key" select="&primary;"/>
   <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
   <dt>
-    <xsl:call-template name="anchor">
-      <xsl:with-param name="node" select="primary"/>
-    </xsl:call-template>
+    <xsl:for-each select="$refs/primary">
+      <xsl:if test="@id or @xml:id">
+        <a name="{(@id|@xml:id)[1]}"/>
+      </xsl:if>
+    </xsl:for-each>
     <xsl:value-of select="primary"/>
     <xsl:choose>
       <xsl:when test="$index.links.to.section = 1">
   <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
   <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
   <dt>
-    <xsl:call-template name="anchor">
-      <xsl:with-param name="node" select="secondary"/>
-    </xsl:call-template>
+    <xsl:for-each select="$refs/secondary">
+      <xsl:if test="@id or @xml:id">
+        <a name="{(@id|@xml:id)[1]}"/>
+      </xsl:if>
+    </xsl:for-each>
     <xsl:value-of select="secondary"/>
     <xsl:choose>
       <xsl:when test="$index.links.to.section = 1">
   <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
   <xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/>
   <dt>
-    <xsl:call-template name="anchor">
-      <xsl:with-param name="node" select="tertiary"/>
-    </xsl:call-template>
+    <xsl:for-each select="$refs/tertiary">
+      <xsl:if test="@id or @xml:id">
+        <a name="{(@id|@xml:id)[1]}"/>
+      </xsl:if>
+    </xsl:for-each>
     <xsl:value-of select="tertiary"/>
     <xsl:choose>
       <xsl:when test="$index.links.to.section = 1">