Re: ElementTree Namespace Prefixes

2005-06-18 Thread uche . ogbuji
Chris Spencer: Fredrik Lundh wrote: Chris Spencer wrote: If an XML parser reads in and then writes out a document without having altered it, then the new document should be the same as the original. says who? Good question. There is no One True Answer even within the XML standards. It

Re: ElementTree Namespace Prefixes

2005-06-17 Thread Martijn Faassen
Jarek Zgoda wrote: [snip] It's a shame the default ns behavior in Elementtree is in such a poort staten. I'm surprised no one's forked Elementtree solely to fix this issue. There is at least one ElementTree API implementation that retains prefixes, lxml.ETree. Go google for it. Just to

Re: ElementTree Namespace Prefixes

2005-06-14 Thread Oren Tirosh
you forgot http://effbot.org/zone/element-infoset.htm which describes the 3-node XML infoset subset used by ElementTree. No, I did not forget your infoset subset. I was comparing it with other infoset subsets described in various XML specifications. I agree 100% that prefixes were not

Re: ElementTree Namespace Prefixes

2005-06-13 Thread Fredrik Lundh
Chris Spencer wrote: If an XML parser reads in and then writes out a document without having altered it, then the new document should be the same as the original. says who? With Elementtree this isn't so. Lundh apparently believes he knows better than you and I on how our namespaces should

Re: ElementTree Namespace Prefixes

2005-06-13 Thread Oren Tirosh
Fredrik Lundh wrote: Chris Spencer wrote: If an XML parser reads in and then writes out a document without having altered it, then the new document should be the same as the original. says who? Good question. There is no One True Answer even within the XML standards. It all boils down to

Re: ElementTree Namespace Prefixes

2005-06-13 Thread Fredrik Lundh
Oren Tirosh wrote: It all boils down to how you define the same. Which parts of the XML document are meaningful content that needs to be preserved and which ones are mere encoding variations that may be omitted from the internal representation? Some relevant references which may be used as

ElementTree Namespace Prefixes

2005-06-12 Thread Chris Spencer
Does anyone know how to make ElementTree preserve namespace prefixes in parsed xml files? The default behavior is to strip a document of all prefixes and then replace them autogenerated prefixes like ns0, ns1, etc. The correct behavior should be to write the file in the form that it was read,

Re: ElementTree Namespace Prefixes

2005-06-12 Thread Andrew Dalke
On Sun, 12 Jun 2005 15:06:18 +, Chris Spencer wrote: Does anyone know how to make ElementTree preserve namespace prefixes in parsed xml files? See the recent c.l.python thread titled ElemenTree and namespaces and started May 16 2:03pm. One archive is at

Re: ElementTree Namespace Prefixes

2005-06-12 Thread Chris Spencer
Andrew Dalke wrote: On Sun, 12 Jun 2005 15:06:18 +, Chris Spencer wrote: Does anyone know how to make ElementTree preserve namespace prefixes in parsed xml files? See the recent c.l.python thread titled ElemenTree and namespaces and started May 16 2:03pm. One archive is at

Re: ElementTree Namespace Prefixes

2005-06-12 Thread Jarek Zgoda
Chris Spencer napisa(a): Given xml with no namespaces, Elementtree works perfectly. However, if you give the root tag an xmlns attribute, Elementtree relabels all child nodes with it's own prefix, completely defeating the purpose of the default namespace. In my opinion, this is