473,573 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xml.etree Syntax of path?

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/elementtr...e-objects.html
--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
Jun 27 '08 #1
2 1872
Thomas Guettler wrote:
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
Jun 27 '08 #2
Stefan Behnel schrieb:
Thomas Guettler wrote:
>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

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1456
by: Daniel Nogradi | last post by:
The etree.Element (or ElementTree.Element) supports a number of list-like methods: append, insert, remove. Any special reason why it doesn't support pop and extend (and maybe count)?
1
6367
by: =?iso-8859-1?q?KLEIN_St=E9phane?= | last post by:
Hi, I'm on Ubuntu 8.04.1 I've installed lxml with easy_install lxml command. Now, when I load etree I've this error : $ python Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
0
1933
by: =?iso-8859-1?q?KLEIN_St=E9phane?= | last post by:
Le Mon, 25 Aug 2008 13:50:50 +0000, KLEIN Stéphane a écrit : I've this bug only with lxml2, lxml 1.3.3 work very well. Regards, Stephane
1
5765
by: xkenneth | last post by:
All, Can I execute XPath queries on ElementTree objects ignoring the namespace? IE './node' instead of './{http://namespace.com}node'. Is there any support for XPath and Minidom? Regards, Ken
0
7987
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8179
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5262
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3702
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2167
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1269
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1000
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.