From d5fda0bce5cf42774c669dbefb71f84f8bc6e745 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Wed, 17 Jan 2024 14:41:09 +0100 Subject: [PATCH 1/5] 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. --- stylesheets/lfs-xsl/xhtml/lfs-index.xsl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 @@ longindex.html + + + + + +
+ + + + + +
+
+ + a bug (https://github.com/docbook/xslt10-stylesheets/issues/239) + that generates a
with a wrong xmlns:xlink attribute. So copy it + here where the bug does not occur, (and simplify it a lot).--> + From 3626aa30487772be32d2b6ca591137ce88e9d616 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 18 Jan 2024 14:57:54 +0800 Subject: [PATCH 4/5] Use UTF-8 characters instead of &#...; This is done via: find -name \*.xml -or -name \*.xsl | xargs python3 utf8ize.py with https://linuxfromscratch.org/~xry111/utf8ize.py. --- stylesheets/lfs-xsl/lfs-l10n.xml | 10 +++++----- stylesheets/lfs-xsl/pdf/lfs-index.xsl | 4 ++-- stylesheets/lfs-xsl/pdf/lfs-lists.xsl | 4 ++-- stylesheets/lfs-xsl/pdf/lfs-xref.xsl | 4 ++-- stylesheets/lfs-xsl/xhtml/lfs-index.xsl | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/stylesheets/lfs-xsl/lfs-l10n.xml b/stylesheets/lfs-xsl/lfs-l10n.xml index 582dae367..d06760244 100644 --- a/stylesheets/lfs-xsl/lfs-l10n.xml +++ b/stylesheets/lfs-xsl/lfs-l10n.xml @@ -1,4 +1,4 @@ - + @@ -71,11 +71,11 @@ - + - - - + + + diff --git a/stylesheets/lfs-xsl/pdf/lfs-index.xsl b/stylesheets/lfs-xsl/pdf/lfs-index.xsl index 866a70391..1fe86b186 100644 --- a/stylesheets/lfs-xsl/pdf/lfs-index.xsl +++ b/stylesheets/lfs-xsl/pdf/lfs-index.xsl @@ -1,7 +1,7 @@ - + + diff --git a/stylesheets/lfs-xsl/pdf/lfs-lists.xsl b/stylesheets/lfs-xsl/pdf/lfs-lists.xsl index 5055b8692..c3abb960e 100644 --- a/stylesheets/lfs-xsl/pdf/lfs-lists.xsl +++ b/stylesheets/lfs-xsl/pdf/lfs-lists.xsl @@ -1,4 +1,4 @@ - + - + + and (not(contains($xhref,'(')) + or starts-with($xhref, '#xpointer(id('))"> diff --git a/stylesheets/lfs-xsl/xhtml/lfs-index.xsl b/stylesheets/lfs-xsl/xhtml/lfs-index.xsl index 284a3a4bf..484dfc6b6 100644 --- a/stylesheets/lfs-xsl/xhtml/lfs-index.xsl +++ b/stylesheets/lfs-xsl/xhtml/lfs-index.xsl @@ -1,7 +1,7 @@ - + + From 9bbd87ae000d2f9e2c574e9ded8f30e24c95c649 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Thu, 18 Jan 2024 10:32:31 +0100 Subject: [PATCH 5/5] Add a doctype decl to lfs-l10n.xml, for validation This allows using xmllint --valid on it. --- stylesheets/lfs-xsl/lfs-l10n.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/stylesheets/lfs-xsl/lfs-l10n.xml b/stylesheets/lfs-xsl/lfs-l10n.xml index d06760244..783bb1118 100644 --- a/stylesheets/lfs-xsl/lfs-l10n.xml +++ b/stylesheets/lfs-xsl/lfs-l10n.xml @@ -1,4 +1,5 @@ +