I have next xml:
<Content>
<article title="I Compute, Therefore I am" id="a1">
<authors>
<author>Philbert von Cookie</author>
<author>Alice Brockman</author>
<author>Pedro Smith</author>
</authors>
<journal>
<name>Journal of Computational Metaphysics</name>
<volume>3</volume>
<issue>7</issue>
<published>04/11/2006</published>
<pages start="42" end="49"/>
</journal>
</article>
...
</Content>
There are a lot of similar article nodes inside the root element -> content
i have parsed my xml into python code and want to get maximum date value. Here is my python code:
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
tree = ET.ElementTree(file='data.xml')
root = tree.getroot()
root.tag, root.attrib
I am trying to get it using iterfind(), but this not works so far.
for elem in tree.iterfind('(/*/*/journal/published/value[not(text() < preceding-sibling::value/text()) and not(text() < following-sibling::value/text())])[1]'):
print (elem.text)
Can you please help me with answer how do i set my XPATH for iterfind() or may be there are any other ways to do that? Thank You.