]> granicus.if.org Git - docbook-dsssl/commitdiff
Corrected XPath expression used for locating first legalnotice
authorMichael Smith <xmldoc@users.sourceforge.net>
Tue, 22 Aug 2006 12:51:28 +0000 (12:51 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Tue, 22 Aug 2006 12:51:28 +0000 (12:51 +0000)
instance in a document. Closes request #1476450. Thanks to Sam
Steingold.

xsl/html/chunk-common.xsl

index 4a5152b8db271b605299c0268c967ec88bd7d8b6..31c2acdfb28546b7e3673950d030d73bef64b030 100644 (file)
 </xsl:template>
 
 <!-- ==================================================================== -->
-<!-- * The following does tail-recursion through a space-separated -->
-<!-- * list of link types specified in $html.head.legalnotice.link.types, -->
+
+<!-- * The following template assumes that the first legalnotice -->
+<!-- * instance found in a document applies to the contents of the -->
+<!-- * entire document. It generates an HTML link in each chunk, back -->
+<!-- * to the file containing the contents of the first legalnotice. -->
+<!-- * -->
+<!-- * Actually, it may generate multiple link instances in each chunk, -->
+<!-- * because it walks through the space-separated list of link -->
+<!-- * types specified in the $html.head.legalnotice.link.types param, -->
 <!-- * popping off link types and generating links for them until it -->
 <!-- * depletes the list. -->
   
   <!-- * value of the href attribute on the link -->
   <xsl:param name="id">
     <xsl:call-template name="object.id">
-      <xsl:with-param name="object" select="//legalnotice[1]"/>
+      <xsl:with-param name="object" select="(//legalnotice)[1]"/>
     </xsl:call-template>
   </xsl:param>
   <xsl:param name="linktype">
       <xsl:attribute name="href">
         <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
       </xsl:attribute>
+      <xsl:variable name="contents">
+        <xsl:apply-templates select="(//legalnotice)[1]" mode="object.title.markup.textonly"/>
+      </xsl:variable>
       <xsl:attribute name="title">
-        <xsl:apply-templates select="//legalnotice[1]"
-                             mode="object.title.markup.textonly"/>
+        <xsl:value-of select="normalize-space($contents)"/>
       </xsl:attribute>
     </link>
     <xsl:call-template name="make.legalnotice.head.links">