You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Inns, Jeff" <ji...@extol.com> on 2002/09/19 00:38:03 UTC
CDATA missing carriage return
I've searched the archives for the question I'm going to pose, but have
not been able to find a specific reference to it.
I have a CDATA section inside of an Element that goes like this:
<SchemaReference><![CDATA[ <<snip>> <<snip>> ]]></SchemaReference>
The content of the <<snip>>ped section contains line feed characters and
carriage return characters in addition to text. When the CDATA section
is parsed, the carriage returns are lost.
As another test I ran the sample class (DocumentTracer) that comes with
Xerces 2_1_0. This is what it output when it got to the startCDATA()
method:
<<snip>>
characters(text="\n\t\t\t\t\t<xs:restriction base =
\"xs:NMTOKEN\">")
characters(text="\n\t\t\t\t\t\t<xs:enumeration value = \"UNSM\"/>")
<<snip>>
I was expecting the output to include a "\r" after "\n".
Any ideas?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: CDATA missing carriage return
Posted by Joseph Kesselman <ke...@us.ibm.com>.
Note that CDATA does _not_ prevent standard XML line-break normalization.
CRLF, CR, and LF all show up after parsing as an XML "newline" (a single
LF character). When you write the data back out, the serializer converts
this newline to one of those three options -- usually, but not
necessarily, whichever one your environment and your selected encoding
consider their "native" line break.
______________________________________
Joe Kesselman / IBM Research
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org