[XML-SIG] CDATA sections still not handled

matt matt@virtualspectator.com
Tue, 16 Jan 2001 22:34:23 +1300


I was following the logic that ext.PrettyPrint can write to a stream, and that
it is useful to pick up a document that has escaped data(which may be xml
itself), add some nodes to it, and save it back to the stream expecting the
escaped sections to be still present as escaped sections.  So what I understand
now is that I should either use a serializer that keeps these, or write a DTD
and use that to write my xml back out to file in a more proper way.  Which I
guess is my next question, what is the cleanest method in PyXML for reading in
such a file with CDATA sections, and getting them back out when rewriting?

regards
Matt


On Tue, 16 Jan 2001, Norman Walsh wrote:
> <delurk><![CDATA[
> / matt <matt@virtualspectator.com> was heard to say:
> | Sorry, the result of the ext.PrettyPrint is :
> [...]
> | </one>
> | some test data
> | </item_20001204_035952>
> | 
> | the CDATA escaping has disappeared
> 
> IMHO, that's the behavior that you should expect. CDATA sections are
> an escaping mechanism, but a serializer is free to choose an alternate
> escaping mechanism if it chooses.
> 
> Note also that CDATA escaping and document encoding are related.  It's
> possible to construct documents (if you combine several input sources)
> that *cannot* preserve the CDATA escaping and the desired encoding.
> 
>                                         Be seeing you,
>                                           norm
> 
> -- 
> Norman Walsh <ndw@nwalsh.com> | Life is an irritation--Tucker Case
> http://nwalsh.com/            | (Christopher Moore)
> ]]></delurk>
> 
> _______________________________________________
> XML-SIG maillist  -  XML-SIG@python.org
> http://mail.python.org/mailman/listinfo/xml-sig
--