a question about getpath()

I assumed from the documentation that tree.getpath(someElement) would produce the XPath for that element, as in the example tree = etree.ElementTree(c)
print(tree.getpath(d2))
But if I do something analogous, as in for w in tree.iter(tei + 'w'): counter += 1 if counter < 10: print(tree.getpath(w)) else: break I get this output: /*/*[2]/*[1]/*[1]/*[3]/*[1]/* /*/*[2]/*[1]/*[1]/*[3]/*[2]/*[1] /*/*[2]/*[1]/*[1]/*[3]/*[2]/*[2] /*/*[2]/*[1]/*[1]/*[3]/*[2]/*[3] /*/*[2]/*[1]/*[1]/*[3]/*[2]/*[4] /*/*[2]/*[1]/*[1]/*[3]/*[2]/*[6] /*/*[2]/*[1]/*[1]/*[3]/*[2]/*[7] /*/*[2]/*[1]/*[1]/*[3]/*[2]/*[8] /*/*[2]/*[1]/*[1]/*[3]/*[2]/*[9] This does look like a sequence of XPaths, but without the element names. What am I not doing right?
participants (1)
-
Martin Mueller