Ari Davidow wrote:
> We've been embedding stuff as <CDATA> expecting that
> it would be passed through whatever transforms (I believe JSP, in our
> case) untouched. But, apparently that isn't the case. CDATA is parsed at
> least with regards to line endings and extra spaces by our parser, or
> at least, by the version of our parser that is running under Solaris. Is
> that supposed to happen?
All that a CDATA section does is preserve your markup-meaningful special
characters as plain text, rather than treating them as markup. All
whitespace handling is per usual.
> Is there some alternative way to encode text
> (the equivalent of the HTML <PRE> that says, "leave this alone, don't
> parse it"?
If what you're after is BOTH the "literalizing" of special characters
AND the preservation of whitespace, then you need BOTH to use a CDATA
section AND to specify xml:space=preserve on the enclosing element. (The
latter preserves the entire element's content; there's no way to protect
just a portion of it.)
John E. Simpson | "When I was a little kid we had a sand
http://www.flixml.org | box. It was a quicksand box. I was an
XML Q&A: www.xml.com | only child... eventually." (Steven Wright)