Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] What to escape when serializing XML

From: Frans Englich <frans.englich@-----.--->
To: xml-dev@-----.---.---
Date: 1/3/2007 10:17:00 AM
On Wednesday 03 January 2007 10:00, Henri Sivonen wrote:
> On Jan 2, 2007, at 17:11, Pete Cordell wrote:
> > In terms of end-of-line encoding, the approach seems to be to
> > output what is convenient (CR, LF, or CRLF) and have the receiving
> > application sort out the situation.

So let me summarize.

This needs to be escaped when serializing XML 1.0 content without taking into 
account XML 1.1 compatibility but with the purpose of being able to roundtrip 
the content being serialized:

* Required characters like '<' and '&', etc.
* Characters unable to be represented in the given encoding
* Whitespace except 0x20 in attributes since parsers do Attribute Value 
Normalization
* End of line characters since the parser normalizes those as well(2.11 
End-of-Line Handling)

Is that all?

XSLT 2.0 and XQuery 1.0 Serialization hints there is more. It says 
"Specifically, CR, NEL and LINE SE ...". Note the use of the word 
"specifically". And what is the reason to that it requires "#x7F through #x9F 
in text nodes and attribute nodes MUST be output as character references"?

It seems the XML 1.0 specification has the perspective of an XML consumer, not 
producer.


Cheers,

		Frans


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent