Skip to content Skip to sidebar Skip to footer

Parsing Xml With Elementtree's Iter() Isn't Finding My Tags When I Pass A Specific Argument

Trying to return attribute & values from a tag. Following the ElementTree documentation to word for word is producing nothing. No errors, it just runs and doesn't print anythin

Solution 1:

Your first XML has a default namespace of x-schema:..\schema_ej.xml.

Try changing your iter() to this instead:

root.iter(r'{x-schema:..\schema_ej.xml}trs')

See here for more info on namespaces in ElementTree.

See here for more info on XML namespaces in general.

Post a Comment for "Parsing Xml With Elementtree's Iter() Isn't Finding My Tags When I Pass A Specific Argument"