Changeset d5fda0b


Ignore:
Timestamp:
01/17/2024 01:41:09 PM (5 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
12.1, 12.1-rc1, multilib, trunk, xry111/arm64, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.1, xry111/mips64el, xry111/update-glibc
Children:
91f4b2d
Parents:
8ba840f
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/xhtml/lfs-index.xsl

    r8ba840f rd5fda0b  
    2323  <xsl:template match="index" mode="recursive-chunk-filename">
    2424    <xsl:text>longindex.html</xsl:text>
     25  </xsl:template>
     26
     27  <!-- The original template in {docbook-xsl}/xhtml/autoidx.xsl has
     28  a bug that generates a <div> with a wrong xmlns:xlink attribute,
     29  so copy it here (and simplify it a lot)-->
     30  <xsl:template name="generate-basic-index">
     31    <xsl:param name="scope" select="NOTANODE"/>
     32
     33    <xsl:variable name="terms" select="//indexterm
     34      [count(.|key('letter',
     35                   translate(substring(&primary;, 1, 1),
     36                             &lowercase;,
     37                             &uppercase;
     38                            )
     39                  ) [&scope;][1]) = 1]"/>
     40    <div class="index">
     41      <xsl:apply-templates select="$terms" mode="index-div-basic">
     42        <xsl:with-param name="position" select="position()"/>
     43        <xsl:with-param name="scope" select="$scope"/>
     44        <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
     45      </xsl:apply-templates>
     46    </div>
    2547  </xsl:template>
    2648
Note: See TracChangeset for help on using the changeset viewer.