471,330 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

Elementtree 1.3 and xpath

Hi I noticed that the xpath functionality of elementtree has been
upgraded in version 1.3. However I can't seem to get the [postion]
predicate to function. All the other new functionality seems to be

Maybe I'm getting the syntax wrong?:
>>xml = ET.XML("""<root><tag att="1">text</tag><tag
>>elem = xml.find("tag[@att]") #Works fine - returns first tag element
>>elem = xml.find("tag[@att]/..") #Works fine - returns entire doc
>>elem = xml.find("tag[1]") # FAILS - returns nothing. Should
return first tag element.
Any help appreciated!

Jan 10 '08 #1
0 942

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by dayzman | last post: by
9 posts views Thread by Chris Spencer | last post: by
1 post views Thread by Gerard Flanagan | last post: by
2 posts views Thread by marc.wyburn | last post: by
30 posts views Thread by Chas Emerick | last post: by
1 post views Thread by Mike Slinn | last post: by
4 posts views Thread by jaime.dyson | last post: by
1 post views Thread by xkenneth | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.