|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Passing through character entities intact
How do you take a character entity in an input document and pass it through
to the output document as an entity(i.e. without any change)?
What I am seeing is that the character entity gets substituted with the
character code for the entity instead of passing the entity through as a
character entity.
Example:
<mydocument>
<text>
Bought — Sold
</text>
</mydocument>
Style sheet:
<xsl:template match="mydocument">
<outputdocument>
<xsl:value-of select="text"/>
</outputdocument>
</xsl:template>
Output document: (\xxx are character codes of some sort)
<outputdocument>
Bought \342\200\223 Sold
</outputdocument>
Intended output:
<outputdocument>
Bought — Sold
</outputdocument>
We have tried several fixes with no success. Here they are in brief:
1. Include an xsl:output element with encoding set to UTF-8 and method set
to XML. This produced above results (minus indentation of output).
2. Include an xsl:output element with encoding set to ISO_8859-1. The mdash
appeared as '?' in the output.
3. Include DTD character entity definition in style sheet. No difference.
4. Include DTD character entity definition in output document. No
difference.
5. Use xsl:apply-templates instead of xsl:value-of. No difference.
6. Changed — to &. This worked in xsl:output method of "html".
7. Added attribute 'disableOutputEscaping="yes"' to xsl:value-of. Of course
this does not work.
We are using Xalan for the XSL processing.
Thank you in advance for any help you might have.
G. Angus McCollum
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








