Closed thom-nic closed 11 years ago
I certainly didn't start the project with namespaces in mind, as you probably guessed from their complete absence in the examples and tests.
Your use case doesn't seem very complicated. I will have a look at it and see how much pyexpat
can help me in this direction. I would love to add this feature if it doesn't bloat xmltodict
for the simplest use cases.
Thanks for your input!
I figured as much, but thanks for considering it! Hopefully it will not be too complicated.
@tomstrummer
What's exactly the role of the namespaces
dict argument in your example? I see that it has entries for one='http://one.com'
and two='http://two.com'
, but three
is missing, but as far as I can see, one
, two
and three
are treated equally in your example's output.
What difference does it make for a namespace to be present or missing in namespaces
?
Hah oops that was just me messing up the example I made up. three
should
have been in the namespace map as well :)
On Aug 24, 2013 12:30 PM, "Martín Blech" notifications@github.com wrote:
@tomstrummer https://github.com/tomstrummer What's exactly the role of the namespaces dict argument in your example? I see that it has entries for one='http://one.com' and two='http://two.com ', but three is missing, but as far as I can see, one, two and three are treated equally in your example's output.
What difference does it make for a namespace to be present or missing in namespaces?
— Reply to this email directly or view it on GitHubhttps://github.com/martinblech/xmltodict/issues/32#issuecomment-23211791 .
@tomstrummer Ok, it should have been there. But what if it wasn't? What would be a reasonable default behavior for xmltodict
in case it bumps into a namespace that is not among the values of the namespaces
dict? Should it raise an exception?
I'm just trying to figure out what's the purpose of the namespaces
dict in your example.
Fixed with release 0.7.0
This project is great! Does it support namespaces? I don't see anything in the examples or tests.
Unfortunately I have to deal with both building and parsing a lot of web-servicey XML where you have a half dozen or more namespaces in a given document. LXML is the only Python framework I've found that sufficiently deals with this issue, by way of the
namespaces
parameter so you don't have to qualify each element with the full namespace URI.I'd like to request an additional optional parameter to
xmltodict.parse()
: