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: John Cowan <jcowan AT reutershealth.com>
  • To: "Bradley S. Huffman" <hip AT cs.okstate.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Extra white space escaping to preserve the infoset
  • Date: Tue, 8 Jul 2003 16:26:00 -0400

Bradley S. Huffman scripsit:

> What about "\r\n" if the current line separator is "\r\n"?

Well, you have to ask how the \r\n got there. If it came in from
the document, then the document either contained &x#D;&#xA; or
it contained &x#D; followed by a line terminator. In either case,
you don't lose anything by outputting it as the latter.

People who synthesize XOM objects as opposed to building them
should only be inserting \n characters, because that's what XML
uses internally as the line-end. If you look at the contents of a
Text node representing the character content of

<foo>This is a record
all about grownups</foo>

it will always be "This is a record\n\tall about grownups", based on
the XML Recommendation, no matter what line terminator was used in
the document.

So in either case the presence of \r at the XOM level represents an
anomaly that should force the creation of an escape sequence.

--
"Well, I'm back." --Sam John Cowan <jcowan AT reutershealth.com>




Archive powered by MHonArc 2.6.24.

Top of Page