xml parsing escape characters

Kent Johnson kent3737 at yahoo.com
Thu Jan 20 09:01:01 EST 2005


Luis P. Mendes wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> this is the xml document:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <string xmlns="http://www......"><DataSet>
> ~   <Order>
> ~     <Customer>439</Customer>
>     (... others ...)
> ~   </Order>
> </DataSet></string>

This is an XML document containing a single tag, <string>, whose content is text containing 
entity-escaped XML.

This is *not* an XML document containing tags <DataSet>, <Order>, <Customer>, etc.

All the behaviour you are seeing is a consequence of this. You need to unescape the contents of the 
<string> tag to be able to treat it as structured XML.

Kent



More information about the Python-list mailing list