I'm trying to parse a number of xml files that only sometimes have xmlns set. Is there any way to determine whether it's set w/o using the lxml library?
My main issue is when finding elements using find or findall, nothing is returned if the namespace is set since the tag doesn't match. But I can't hardcode the namespace in because sometimes there is no namespace set. I don't really know how to go about this.
Here's a sample of some of my code
tree = ET.parse(xml_file_path)
root = tree.getroot() #ONIXmessage
...
pids = product.findall("productidentifier")
...
So my main issue is with the findall() method
Thanks.