Matthias Müller wrote:
can someone explain why xsl:copy-of converts hex values to decimal?
e.g. the node:
<HexDecTest>
<Hex>Ⅰ</Hex>
<Dez>Ⅰ</Dez>
</HexDecTest>
is processed to:
<Result>
<Hex>Ⅰ</Hex>
<Dez>Ⅰ</Dez>
</Result>
using this template:
<xsl:template match="HexDecTest">
<xsl:element name="Result">
<xsl:copy-of select="Hex"/>
<xsl:copy-of select="Dez"/>
</xsl:element>
</xsl:template>
i expected the hex value unchanged,
XSLT works on the XSLT/XPath data model, a tree model. In that model the
Hex and the Dez elements have a text node with character data of Unicode
characters as a child. The input tree is transformed to a result tree,
again with text nodes of Unicode characters.
That result tree can then be serialized and only then you might get
characters escaped, for instance when you have specified an output
encoding in which the characters can not be directly represented. Your
serializer has choosen decimal numbers for escaping.
So the main point is that XSLT does not operate on the markup
representation of the input and xsl:copy-of certainly is not a way to
copy the markup in the input literally to the output. XSLT operates on a
tree often created by parsing an XML document and then creates a result
tree and optionally serializes that result tree, often as XML.
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--