aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Labastie <pierre.labastie@neuf.fr>2024-01-18 13:07:22 +0100
committerPierre Labastie <pierre.labastie@neuf.fr>2024-01-18 13:11:58 +0100
commitd6cbb12c4c152479a8861e1251dcd7ea10eff81d (patch)
tree8ac989f02b12000d238da9273da8f1de1d70d987
parent0cbc2c0a0432637a25595d8740a0b5881baab7de (diff)
stylesheets: rm code for xlink:href attr in xref elemts
We don't use it and it uses &#40; for opening parenthesis. I am not sure whether this has some reason or not, but we want to get reed of &#xx; chars in our change to utf-8, so easier to remove than to find out why...
-rw-r--r--stylesheets/lfs-xsl/pdf/lfs-xref.xsl22
-rw-r--r--stylesheets/lfs-xsl/xhtml/lfs-xref.xsl21
2 files changed, 10 insertions, 33 deletions
diff --git a/stylesheets/lfs-xsl/pdf/lfs-xref.xsl b/stylesheets/lfs-xsl/pdf/lfs-xref.xsl
index d14e49b22..ddfe4408b 100644
--- a/stylesheets/lfs-xsl/pdf/lfs-xref.xsl
+++ b/stylesheets/lfs-xsl/pdf/lfs-xref.xsl
@@ -1,9 +1,7 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
- exclude-result-prefixes="xlink"
version="1.0">
@@ -16,23 +14,13 @@
this file in lfs-pdf.xsl -->
<!-- xref:
- Added role variable and use it when calling mode xref-to.-->
+ Added role variable and use it when calling mode xref-to.
+ Also remove code for xlink:href attribute in xref elements,
+ since we don't use it.-->
<!-- The original template is in {docbook-xsl}/fo/xref.xsl -->
<xsl:template match="xref" name="xref">
- <xsl:param name="xhref" select="@xlink:href"/>
- <!-- is the @xlink:href a local idref link? -->
- <xsl:param name="xlink.idref">
- <xsl:if test="starts-with($xhref,'#')
- and (not(contains($xhref,'('))
- or starts-with($xhref, '#xpointer(id('))">
- <xsl:call-template name="xpointer.idref">
- <xsl:with-param name="xpointer" select="$xhref"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:param>
- <xsl:param name="xlink.targets" select="key('id',$xlink.idref)"/>
<xsl:param name="linkend.targets" select="key('id',@linkend)"/>
- <xsl:param name="target" select="($xlink.targets | $linkend.targets)[1]"/>
+ <xsl:param name="target" select="$linkend.targets[1]"/>
<xsl:param name="refelem" select="local-name($target)"/>
<!-- Added role variable -->
<xsl:variable name="role" select="@role"/>
@@ -89,7 +77,7 @@
<xsl:otherwise>
<xsl:message>
<xsl:text>ERROR: xref linking to </xsl:text>
- <xsl:value-of select="@linkend|@xlink:href"/>
+ <xsl:value-of select="@linkend"/>
<xsl:text> has no generated link text.</xsl:text>
</xsl:message>
<xsl:text>???</xsl:text>
diff --git a/stylesheets/lfs-xsl/xhtml/lfs-xref.xsl b/stylesheets/lfs-xsl/xhtml/lfs-xref.xsl
index 23ad79f8b..705793605 100644
--- a/stylesheets/lfs-xsl/xhtml/lfs-xref.xsl
+++ b/stylesheets/lfs-xsl/xhtml/lfs-xref.xsl
@@ -1,9 +1,7 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/1999/xhtml"
- exclude-result-prefixes="xlink"
version="1.0">
<!-- This stylesheet fixes English punctuation in xref links
@@ -15,22 +13,13 @@
this file in lfs-chunked2.xsl -->
<!-- xref:
- Added role variable and use it when calling mode xref-to.-->
+ Added role variable and use it when calling mode xref-to.
+ Also remove code for xlink:href attributes in xref elements
+ since we don't use it.-->
<!-- The original template is in {docbook-xsl}/xhtml/xref.xsl -->
<xsl:template match="xref" name="xref">
- <xsl:param name="xhref" select="@xlink:href"/>
- <!-- is the @xlink:href a local idref link? -->
- <xsl:param name="xlink.idref">
- <xsl:if test="starts-with($xhref,'#') and (not(contains($xhref,'('))
- or starts-with($xhref, '#xpointer(id('))">
- <xsl:call-template name="xpointer.idref">
- <xsl:with-param name="xpointer" select="$xhref"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:param>
- <xsl:param name="xlink.targets" select="key('id',$xlink.idref)"/>
<xsl:param name="linkend.targets" select="key('id',@linkend)"/>
- <xsl:param name="target" select="($xlink.targets | $linkend.targets)[1]"/>
+ <xsl:param name="target" select="$linkend.targets[1]"/>
<!-- Added role variable -->
<xsl:variable name="role" select="@role"/>
<xsl:variable name="xrefstyle">
@@ -85,7 +74,7 @@
<xsl:otherwise>
<xsl:message>
<xsl:text>ERROR: xref linking to </xsl:text>
- <xsl:value-of select="@linkend|@xlink:href"/>
+ <xsl:value-of select="@linkend"/>
<xsl:text> has no generated link text.</xsl:text>
</xsl:message>
<xsl:text>???</xsl:text>