XML and namespaces

Alan Kennedy alanmk at hotmail.com
Mon Dec 12 07:02:52 EST 2005


[Paul Boddie]
> It's
> interesting that minidom plus PrettyPrint seems to generate the xmlns
> attributes in the serialisation, though; should that be reported as a
> bug?

I believe that it is a bug.

[Paul Boddie]
> Well, with the automagic, all DOM users get the once in a lifetime
> chance to exchange those lead boots for concrete ones. I'm sure there
> are all sorts of interesting reasons for assigning namespaces to nodes,
> serialising the document, and then not getting all the document
> information back when parsing it, but I'd rather be spared all the
> "amusement" behind all those reasons and just have life made easier for
> just about everyone concerned. 

Well, if you have a fair amount of spare time and really want to improve 
things, I recommend that you consider implementing the DOM L3 namespace 
normalisation algorithm.

http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algorithms.html

That way, everyone can have namespace well-formed documents by simply 
calling a single method, and not a line of automagic in sight: just 
standards-compliant XML processing.

> Anyway, thank you for your helpful commentary on this matter!

And thanks to you for actually informing yourself on the issue, and for 
taking the time to research and understand it. I wish that your 
refreshing attitude was more widespread!

now-i-really-must-get-back-to-work-ly'yrs,

-- 
alan kennedy
------------------------------------------------------
email alan:              http://xhaus.com/contact/alan



More information about the Python-list mailing list