]> granicus.if.org Git - docbook-dsssl/commitdiff
ulink handling now working as expected; but performance is poor
authorMichael Smith <xmldoc@users.sourceforge.net>
Sun, 10 Jul 2005 11:37:33 +0000 (11:37 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Sun, 10 Jul 2005 11:37:33 +0000 (11:37 +0000)
for docs that have a lot of ulinks; that needs to be fixed

xsl/manpages/inline.xsl

index 79bc5390ac0ed913608d227172e975e5dd9afbbe..62d1f8742ee276da2faa23df9f2c4f3ee2588c43 100644 (file)
   <!-- * number links in the Author content, it would "throw off" the -->
   <!-- * numbering at the beginning of the main text flow. -->
 
+  <!--      this is what sucks up the most time - for each ulink, this checks -->
+  <!--      every other ulink that has the same Refentry ancestor as itself; -->
+  <!--      so if you have 100 ulinks, this check will end up getting run a -->
+  <!--      total of 100 x 100 times = 10,000 times. It really only needs to -->
+  <!--      be run once for each refentry; this needs to be fixed. -->
   <xsl:variable name="unique.links"
-           select=".//ulink[node()
+           select="ancestor::refentry//ulink[node()
                   and not(ancestor::refentryinfo)
                   and not(ancestor::info)
                   and not(ancestor::docinfo)
                   and not(ancestor::indexterm)
                   and (generate-id(ancestor::refentry)
                   = generate-id(current()))]/@url)]"/>
-
   <xsl:variable name="url">
     <xsl:value-of select="@url"/>
   </xsl:variable>
     <xsl:choose>
       <xsl:when test="$url = $unique.links/@url">
         <xsl:apply-templates
-            select="$unique.links[@url = $url]"
+            select="$unique.links[@url = $url][1]"
             mode="link.number"/>
       </xsl:when>
       <xsl:otherwise>