]> granicus.if.org Git - docbook-dsssl/commitdiff
Checkpointing further ulink changes. All visible links are now
authorMichael Smith <xmldoc@users.sourceforge.net>
Sat, 9 Jul 2005 10:07:58 +0000 (10:07 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Sat, 9 Jul 2005 10:07:58 +0000 (10:07 +0000)
displayed in the link list, and numbered. But it performance
leaves something to be desired. And not working properly for case
where document contains multiple Refentry.

xsl/manpages/inline.xsl

index 6a9c80ff39b21056194beddaabf65b8e873d7aca..195d154e894c39c6fa0336cfc10c75c89bc54ba7 100644 (file)
   <!-- * if link is non-empty AND user wants links numbered, output -->
   <!-- * a number for it -->
   <xsl:if test="node() and $man.links.are.numbered != 0">
+    <xsl:variable name="preceding.numbered.links"
+                  select="preceding::ulink[node()
+                          and not(ancestor::refentryinfo)
+                          and not(ancestor::info)
+                          and not(ancestor::docinfo)
+                          and not(ancestor::refmeta)
+                          and not(ancestor::refnamediv)
+                          and not(ancestor::indexterm)
+                          and not(@url = preceding::ulink)]"/>
     <xsl:choose>
-      <xsl:when test="$url = preceding::ulink[node()
-                     and not(ancestor::refentryinfo)
-                     and not(ancestor::info)
-                     and not(ancestor::docinfo)
-                     and not(ancestor::refmeta)
-                     and not(ancestor::refnamediv)
-                     and not(ancestor::indexterm)
-                     and not(@url = preceding::ulink/@url)]/@url">
+      <xsl:when test="$url = $preceding.numbered.links/@url">
         <xsl:apply-templates
-            select="preceding::ulink[node()
-                    and not(ancestor::refentryinfo)
-                    and not(ancestor::info)
-                    and not(ancestor::docinfo)
-                    and not(ancestor::refmeta)
-                    and not(ancestor::refnamediv)
-                    and not(ancestor::indexterm)
-                    and not(@url = preceding::ulink/@url)][@url = $url]"
+            select="$preceding.numbered.links[@url = $url][1]"
             mode="link.number"/>
       </xsl:when>
       <xsl:otherwise>
                      and not(ancestor::refmeta)
                      and not(ancestor::refnamediv)
                      and not(ancestor::indexterm)
-                     and not(@url = preceding::ulink/@url)]"
+                     and not(@url = preceding::ulink[node()
+                          and not(ancestor::refentryinfo)
+                          and not(ancestor::info)
+                          and not(ancestor::docinfo)
+                          and not(ancestor::refmeta)
+                          and not(ancestor::refnamediv)
+                          and not(ancestor::indexterm)
+                          and not(@url = preceding::ulink)]/@url)]"
               from="refentry"
               format="{$format}"/>
   <!-- * Note that we don't do anything for Ulinks in *info sections -->
                      and not(ancestor::refmeta)
                      and not(ancestor::refnamediv)
                      and not(ancestor::indexterm)
-                     and not(@url = preceding::ulink/@url)]"/>
+                     and not(@url = preceding::ulink[node()
+                          and not(ancestor::refentryinfo)
+                          and not(ancestor::info)
+                          and not(ancestor::docinfo)
+                          and not(ancestor::refmeta)
+                          and not(ancestor::refnamediv)
+                          and not(ancestor::indexterm)
+                          and not(@url = preceding::ulink)]/@url)]"/>
   <xsl:if test="$links/node()">
     <xsl:call-template name="format.links.list">
       <xsl:with-param name="links" select="$links"/>
                      and not(ancestor::refmeta)
                      and not(ancestor::refnamediv)
                      and not(ancestor::indexterm)
-                     and not(@url = preceding::ulink/@url)]"
+                     and not(@url = preceding::ulink[node()
+                          and not(ancestor::refentryinfo)
+                          and not(ancestor::info)
+                          and not(ancestor::docinfo)
+                          and not(ancestor::refmeta)
+                          and not(ancestor::refnamediv)
+                          and not(ancestor::indexterm)
+                          and not(@url = preceding::ulink)]/@url)]"
               mode="links.list">
   <xsl:param name="padding.length"/>
   <xsl:variable name="link.number">