Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Extra white space escaping to preserve the infoset

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Bradley S. Huffman" <hip AT csa.cs.okstate.edu>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Extra white space escaping to preserve the infoset
  • Date: Thu, 03 Jul 2003 10:41:20 -0500

Elliotte Rusty Harold writes:

> On a recent thread on xml-dev James Clark (who is always worth
> listening to) wrote:
>
> If your infoset contains a carriage return, you have to output
> it as a numeric character reference, otherwise line-end
> normalization will turn it into a line-feed. Similarly, if
> attribute values in the infoset contain line-feeds or tabs, they
> need to be output as numeric character references, otherwise
> attribute value normalization will turn them into spaces...When
> I'm creating XML, some parts of what I am creating may well have
> come from parsing an XML document. That means if there's any
> XML infoset that my program cannot serialize correctly, it's
> potentially a bug.
>
>
> I don't think the XOM serializer bothers to escape such carriage
> returns, line feeds, tabs and the like where Clark suggests it
> should. Should it? Or should this at least be an option in the
> Serializer? And if it is an option, should it be the default option?
> Thoughts?

I also saved his e-mail for further cogitation. I coming to the conclusion
that since having a cr, lt, tab, etc. in a attribute value is a
purposeful act, the sequence serialize -> unserialize should preserve
all characters. So I think XOM serializer (and JDOM's XMLOutputter) should
always escape.

Brad




Archive powered by MHonArc 2.6.24.

Top of Page