Python: Ignore xmlns in elementtree.ElementTree

phuctd

New Member
Is there a way to ignore the XML namespace in tage names in \[code\]elementtree.ElementTree\[/code\]?I try to print all \[code\]technicalContact\[/code\] tags:\[code\]for item in root.getiterator(tag='{http://www.example.com}technicalContact'): print item.tag, item.text\[/code\]And I get something like:\[code\]{http://www.example.com}technicalContact [email protected]\[/code\]But what I really want is:\[code\]technicalContact [email protected]\[/code\]Is there a way to display only the suffix (sans xmlns), or better - iterate over the elements without explicitly stating xmlns?
 
Back
Top