Closed tomschr closed 6 years ago
In file suse2013/fo/block.xsl there is this template:
suse2013/fo/block.xsl
<xsl:template match="processing-instruction('pdfpagebreak')"> <xsl:param name="arguments" select="."/> <xsl:param name="selected-stylesheets"> <xsl:choose> <xsl:when test="contains($arguments, 'style="')"> <xsl:value-of select="normalize-space(substring-before(substring-after($arguments, 'style="'), '"'))"/> </xsl:when> <xsl:otherwise>any</xsl:otherwise> </xsl:choose> </xsl:param> <xsl:param name="selected-formatter"> <xsl:choose> <xsl:when test="contains($arguments, 'formatter="')"> <xsl:value-of select="normalize-space(substring-before(substring-after($arguments, 'formatter="'), '"'))"/> </xsl:when> <xsl:otherwise>any</xsl:otherwise> </xsl:choose> </xsl:param> <!-- ... --> </xsl:template>
The tests and anything in xsl:value-of is not really needed as there is a simpler and more standardized method.
xsl:value-of
Use the pi-attribute template from the upstream stylesheets, file common/pi.xsl. For example, if your processing instruction looks like this:
pi-attribute
common/pi.xsl
<?pdfpagebreak style="bla" formatter="fop"?>
you can get the value inside the pseudo-attribute style like this:
style
<xsl:template match="processing-instruction('pdfpagebreak')"> <xsl:variable name="pi-style"> <xsl:call-template name="pi-attribute"> <xsl:with-param name="pis" select="."/> <xsl:with-param name="attribute">style</xsl:with-param> </xsl:call-template> </xsl:variable> <xsl:variable name="pi-formatter"> <xsl:call-template name="pi-attribute"> <xsl:with-param name="pis" select="."/> <xsl:with-param name="attribute">formatter</xsl:with-param> </xsl:call-template> </xsl:variable> <!-- Process the variables as needed --> </xsl:template>
Problem Description
In file
suse2013/fo/block.xsl
there is this template:The tests and anything in
xsl:value-of
is not really needed as there is a simpler and more standardized method.Expected Behaviour
Use the
pi-attribute
template from the upstream stylesheets, filecommon/pi.xsl
. For example, if your processing instruction looks like this:you can get the value inside the pseudo-attribute
style
like this: