variable_1-input.xml
<?xml version="1.0"?>
<products>
<product
id="p1">
<name>Delta</name>
</product>
</products>
variable_1-stylesheet.xsl
<?xml version="1.0"?>
<xsl:stylesheet
version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
indent="yes"/>
<xsl:variable
name="x" select="products/product"/>
<xsl:template
match="/">
<Products>
<Product
id="{$x/@id}">
<Name>
<xsl:value-of
select="$x/name"/>
</Name>
</Product>
</Products>
</xsl:template>
</xsl:stylesheet>
variable_1-output.xml
<?xml version="1.0" encoding="UTF-8"?>
<Products>
<Product
id="p1">
<Name>Delta</Name>
</Product>
</Products>
The XSLT processor interprets "products" as an XPath expression, that is as the element "products". With an extra pair of apostrofes "'products'" become a string value, the word "products". Since an element name can not start with a digit, "27" is interpreted as the number "27".
Updated 2009-03-19