aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Labastie <pierre.labastie@neuf.fr>2024-01-17 14:41:09 +0100
committerPierre Labastie <pierre.labastie@neuf.fr>2024-01-17 14:41:09 +0100
commitd5fda0bce5cf42774c669dbefb71f84f8bc6e745 (patch)
treea85155e2222521f5ae6c7d39eeabb4a23b6b04a1
parent8ba840f34a1825277a81ae106e92242f211d90d0 (diff)
Style sheets: fix docbook-xsl bug in autoidx
The template named generate-basic-index in {docbook-xsl}/xhtml/autoidx.xsl has a bug that generates a div element with a wrong xmlns:xlink attribute. See https://github.com/docbook/xslt10-stylesheets/issues/239. Rather than fixing docbook-xsl, which would work only in LFS (but we want to be able to render on other distros), copy the faulty template to our customization files (lfs-index.xsl), so that this one is used. We can also simplify it a lot since we don't need all the cases covered in general docbook-xsl.
-rw-r--r--stylesheets/lfs-xsl/xhtml/lfs-index.xsl22
1 files changed, 22 insertions, 0 deletions
diff --git a/stylesheets/lfs-xsl/xhtml/lfs-index.xsl b/stylesheets/lfs-xsl/xhtml/lfs-index.xsl
index 806979c19..a7f627cf6 100644
--- a/stylesheets/lfs-xsl/xhtml/lfs-index.xsl
+++ b/stylesheets/lfs-xsl/xhtml/lfs-index.xsl
@@ -24,6 +24,28 @@
<xsl:text>longindex.html</xsl:text>
</xsl:template>
+ <!-- The original template in {docbook-xsl}/xhtml/autoidx.xsl has
+ a bug that generates a <div> with a wrong xmlns:xlink attribute,
+ so copy it here (and simplify it a lot)-->
+ <xsl:template name="generate-basic-index">
+ <xsl:param name="scope" select="NOTANODE"/>
+
+ <xsl:variable name="terms" select="//indexterm
+ [count(.|key('letter',
+ translate(substring(&primary;, 1, 1),
+ &lowercase;,
+ &uppercase;
+ )
+ ) [&scope;][1]) = 1]"/>
+ <div class="index">
+ <xsl:apply-templates select="$terms" mode="index-div-basic">
+ <xsl:with-param name="position" select="position()"/>
+ <xsl:with-param name="scope" select="$scope"/>
+ <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
+ </xsl:apply-templates>
+ </div>
+ </xsl:template>
+
<!-- Divisions:
Override the default division titles, translating them from the default
'A', 'B', etc. to 'Packages', 'Programs', etc.