]> granicus.if.org Git - docbook-dsssl/commitdiff
Added fixes to avoid duplicate ids when generate.id.attributes = 1.
authorMauritz Jeanson <mj@johanneberg.com>
Tue, 10 Jul 2007 20:41:35 +0000 (20:41 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Tue, 10 Jul 2007 20:41:35 +0000 (20:41 +0000)
This (hopefully) closes bug #1671052.

xsl/html/component.xsl
xsl/html/division.xsl
xsl/html/sections.xsl
xsl/html/titlepage.xsl

index dc6e8038f1bdd3c60203d52117d13e08d9f78d6b..ed2edac7ac574fc3305735f411c0ef5b2754acbb 100644 (file)
 
   <xsl:element name="h{$level+1}">
     <xsl:attribute name="class">title</xsl:attribute>
-    <xsl:call-template name="anchor">
-      <xsl:with-param name="node" select="$node"/>
-      <xsl:with-param name="conditional" select="0"/>
-    </xsl:call-template>
-    <xsl:apply-templates select="$node" mode="object.title.markup">
+    <xsl:if test="$generate.id.attributes = 0">
+      <xsl:call-template name="anchor">
+       <xsl:with-param name="node" select="$node"/>
+       <xsl:with-param name="conditional" select="0"/>
+      </xsl:call-template>
+    </xsl:if>
+      <xsl:apply-templates select="$node" mode="object.title.markup">
       <xsl:with-param name="allow-anchors" select="1"/>
     </xsl:apply-templates>
   </xsl:element>
   </div>
 </xsl:template>
 
-<xsl:template match="article/title" mode="titlepage.mode" priority="2">
+<xsl:template match="article/title|article/articleinfo/title" mode="titlepage.mode" priority="2">
   <xsl:call-template name="component.title">
     <xsl:with-param name="node" select="ancestor::article[1]"/>
   </xsl:call-template>
index 67369bcd346b727bb5291c9c1bf97c584d913b7f..d7b42ddb36ebe77a9f97868cec724d806a81b9a3 100644 (file)
 
   <h1>
     <xsl:attribute name="class">title</xsl:attribute>
-    <xsl:call-template name="anchor">
-      <xsl:with-param name="node" select="$node"/>
-      <xsl:with-param name="conditional" select="0"/>
-    </xsl:call-template>
-    <xsl:apply-templates select="$node" mode="object.title.markup">
+    <xsl:if test="$generate.id.attributes = 0">
+      <xsl:call-template name="anchor">
+       <xsl:with-param name="node" select="$node"/>
+       <xsl:with-param name="conditional" select="0"/>
+      </xsl:call-template>
+    </xsl:if>
+      <xsl:apply-templates select="$node" mode="object.title.markup">
       <xsl:with-param name="allow-anchors" select="1"/>
     </xsl:apply-templates>
   </h1>
index a2fa6cff026b6c3840b18565f30ec2cb11c3ae0b..b85e4627e88b555f2230cee89a825d020baed5b7 100644 (file)
         <xsl:attribute name="style">clear: both</xsl:attribute>
       </xsl:if>
     </xsl:if>
-    <xsl:if test="$allow-anchors != 0">
+    <xsl:if test="$allow-anchors != 0 and $generate.id.attributes = 0">
       <xsl:call-template name="anchor">
         <xsl:with-param name="node" select="$section"/>
         <xsl:with-param name="conditional" select="0"/>
       </xsl:call-template>
     </xsl:if>
+    <xsl:if test="$generate.id.attributes != 0 and not(local-name(.) = 'appendix')">
+      <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
+    </xsl:if>
     <xsl:copy-of select="$title"/>
   </xsl:element>
 </xsl:template>
index cc54b756f57428fc442e7afca592ba8cd5adc5d7..da9361fc966f245c06c4ab88772d32ab4061000c 100644 (file)
 
   <h1>
     <xsl:apply-templates select="." mode="class.attribute"/>
-    <a name="{$id}"/>
+    <xsl:if test="$generate.id.attributes = 0">
+      <a name="{$id}"/>
+    </xsl:if>
     <xsl:choose>
       <xsl:when test="$show.revisionflag != 0 and @revisionflag">
        <span class="{@revisionflag}">