Project

Profile

Help

Support #4496 ยป unexpectedVariableResults.xsl

Ken Holman, 2020-03-23 21:14

 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet
[
<!ENTITY builtinPhrases '
<phrases source="doctype">
<phrase>Hello world</phrase>
</phrases>'>
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xsd"
version="2.0">

<xsl:variable name="additionalPhrases" as="element(phrases)">
<phrases source="variable">
<phrase>Don't worry, be happy</phrase>
</phrases>
</xsl:variable>
<xsl:variable name="builtinPhrases" as="element(phrases)+">
<xsl:copy-of select="$additionalPhrases"/>
&builtinPhrases;
</xsl:variable>

<xsl:output method="text"/>

<xsl:template match="/">
<xsl:value-of select="system-property('xsl:product-name'),
system-property('xsl:product-version')"/>
<xsl:text>&#xa;</xsl:text>
<xsl:value-of select="$builtinPhrases/@source"/>
<xsl:text>&#xa;</xsl:text>
</xsl:template>

</xsl:stylesheet>
    (1-1/1)