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

RE: foreign characters in params passed to stylesheet

Subject: RE: foreign characters in params passed to stylesheet
From: "Evan Lenz" <evan@xxxxxxxxxxxx>
Date: Mon, 6 May 2002 14:48:02 -0700
xml foreign characters
> An XSLT processor is at liberty to use character references for any
> character in the output file, rather than using the native character.
> There's nothing in the spec that prevents this, and any XML
> parser (or HTML
> user agent) will treat the character reference and the native character
> identically.

There is one notable exception to this--whitespace character references
other than #x20 (space) in attribute values, namely #xD, #xA, and #x9.

"Note that if the unnormalized attribute value contains a character
reference to a white space character other than space (#x20), the normalized
value contains the referenced character itself (#xD, #xA or #x9). This
contrasts with the case where the unnormalized value contains a white space
character (not a reference), which is replaced with a space character (#x20)
in the normalized value..."[1]

For example, using a new XSLT 2.0 construct, we can see the difference in
behavior very clearly:

<xsl:value-of select="(1,2,3)" separator="

will output:

1 2 3

whereas this:

<xsl:value-of select="(1,2,3)" separator="&#xA;"/>

will output:


In the first case, the XML parser reads the attribute value as the space
character #x20 (according to attribute value normalization rules), and in
the second example the XML parser reads the attribute value as the line feed
character #xA. Note that serialization algorithms are also required to make
this distinction in order to correctly round-trip attribute values.


[1] http://www.w3.org/TR/REC-xml#AVNormalize

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.