stylesheets: rm code for xlink:href attr in xref elemts

We don't use it and it uses ( 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...
This commit is contained in:
Pierre Labastie 2024-01-18 13:07:22 +01:00
parent 0cbc2c0a04
commit d6cbb12c4c
2 changed files with 10 additions and 33 deletions

View File

@ -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>

View File

@ -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>