XML and newlines

Paul Prescod paul at prescod.net
Sat Feb 16 13:06:07 EST 2002


Hans Nowak wrote:
> 
>...
> The multiline XML string is in roughly the same format as the
> raw XML the server returns. That is, it does contain newlines
> after 'one', 'two', and 'three' (assume these were in the
> original multiline string). As soon as the XML is parsed,
> these newlines disappear. Maybe this is normal and to be
> expected when using xml.dom.minidom.parseString; I don't know.

That's what the XML spec says to do with attribute values. 

http://www.w3.org/TR/REC-xml#AVNormalize

If you don't control the server then I think you're kind of out of luck!

 Paul Prescod




More information about the Python-list mailing list