]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
doc: Fix "Prev" link, take 2.
authorNathan Bossart <nathan@postgresql.org>
Thu, 18 Jun 2026 14:31:27 +0000 (09:31 -0500)
committerNathan Bossart <nathan@postgresql.org>
Thu, 18 Jun 2026 14:31:27 +0000 (09:31 -0500)
Commit 6678b58d78 fixed a wrong "Prev" link by changing the link
generation code to use [position()=last()] instead of [last()] in
the predicate on the union of reverse axes.  Unfortunately, that
caused documentation builds to take much longer.  To fix, combine
the "preceding" and "ancestor" steps into one "preceding" step and
one "ancestor" step, and revert the predicate back to [last()].
The smaller union evades the libxml2 bug while avoiding the build
time regression.

Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Tested-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/1132496.1781718007%40sss.pgh.pa.us
Backpatch-through: 14

doc/src/sgml/stylesheet-speedup-xhtml.xsl

index a3b3692ba03c8d29717886e0126f31f7be78f292..0e8e97c7e5c7daae8058ba6672e746c2438d5456 100644 (file)
   </xsl:if>
 
   <xsl:variable name="prev"
-    select="(preceding::book[1]
-             |preceding::preface[1]
-             |preceding::chapter[1]
-             |preceding::appendix[1]
-             |preceding::part[1]
-             |preceding::reference[1]
-             |preceding::refentry[1]
-             |preceding::colophon[1]
-             |preceding::article[1]
-             |preceding::topic[1]
-             |preceding::bibliography[parent::article or parent::book or parent::part][1]
-             |preceding::glossary[parent::article or parent::book or parent::part][1]
-             |preceding::index[$generate.index != 0]
-                               [parent::article or parent::book or parent::part][1]
-             |preceding::setindex[$generate.index != 0][1]
-             |ancestor::set
-             |ancestor::book[1]
-             |ancestor::preface[1]
-             |ancestor::chapter[1]
-             |ancestor::appendix[1]
-             |ancestor::part[1]
-             |ancestor::reference[1]
-             |ancestor::article[1]
-             |ancestor::topic[1]
-             |preceding::sect1[1]
-             |ancestor::sect1[1])[position()=last()]"/>
+    select="(preceding::*[self::book
+                          or self::preface
+                          or self::chapter
+                          or self::appendix
+                          or self::part
+                          or self::reference
+                          or self::refentry
+                          or self::colophon
+                          or self::article
+                          or self::topic
+                          or self::sect1
+                          or self::bibliography[parent::article or parent::book or parent::part]
+                          or self ::glossary[parent::article or parent::book or parent::part]
+                          or self::index[$generate.index != 0]
+                                        [parent::article or parent::book or parent::part]
+                          or self::setindex[$generate.index != 0]][1]
+             |ancestor::*[self::set
+                          or self::book
+                          or self::preface
+                          or self::chapter
+                          or self::appendix
+                          or self::part
+                          or self::reference
+                          or self::article
+                          or self::topic
+                          or self::sect1][1])[last()]"/>
 
   <xsl:variable name="next"
     select="(following::book[1]