My XML file is available here. Though I am able to get the root node and its child nodes from this file. But, I am not able to get the one that I need. I want to get the content of <ce:section-title>Methods</ce:section-title>
I have tried both xml and lxml package.
When I use the following,
tree = lxml.etree.parse(fname) #fname is xml filename
root= tree.getroot()
print(root[5].findall("ce:section-title",root.nsmap)
It just gives me null [] bracket. It gives the same null bracket when I use the following command:
for item in tree.iter('{http://www.elsevier.com/xml/ja/dtd}ce:section-title'):
print(item)
I did try to solve with the solution provided here, but I am getting the following error on this code:
ns = {"ce":"http://www.elsevier.com/xml/common/dtd"}
print(root.findall("ce:title", ns).text)
AttributeError: 'NoneType' object has no attribute 'text'
Any direction will be helpfull