[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Passing through character entities intact

Subject: Passing through character entities intact
From: "McCollum , Angus" <AMcCollum@xxxxxxxx>
Date: Wed, 10 Oct 2001 15:59:46 -0400
angus mccollum
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 &mdash; 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 &mdash; 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 &mdash; to &amp;. 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.