xml.etree Syntax of path?

  • Thread starter Thomas Guettler
  • Start date
T

Thomas Guettler

Hi,

I think the documentation of xml.etree is missing something[1].

{{{
find(path)
Finds the first toplevel element with given tag. Same as getroot().find(path). path is the element to look for.
}}}

According to the source etree has limited support for xpath. I think it should be documented
what 'path' should look like to.


[1]
http://docs.python.org/lib/elementtree-elementtree-objects.html
 
S

Stefan Behnel

Thomas said:
I think the documentation of xml.etree is missing something[1].

{{{
find(path)
Finds the first toplevel element with given tag. Same as
getroot().find(path). path is the element to look for.
}}}

According to the source etree has limited support for xpath. I think it
should be documented what 'path' should look like to.

You mean like this?

http://effbot.org/zone/element-xpath.htm

Note that the method is called "find()", not "execute_xpath()" or something.
If you want full XPath support, lxml is your friend.

Stefan
 
T

Thomas Guettler

Stefan said:
Thomas said:
I think the documentation of xml.etree is missing something[1].

{{{
find(path)
Finds the first toplevel element with given tag. Same as
getroot().find(path). path is the element to look for.
}}}

According to the source etree has limited support for xpath. I think it
should be documented what 'path' should look like to.

You mean like this?

http://effbot.org/zone/element-xpath.htm

Yes, since etree is part of the standard library, the documentation
should be there, too. Or at least a link should be provided.

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top