This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author karlcow
Recipients Antoine2008, eli.bendersky, flox, karlcow
Date 2013-03-07.03:53:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362628421.21.0.723176834481.issue17138@psf.upfronthosting.co.za>
In-reply-to
Content
http://docs.python.org/3/library/xml.etree.elementtree.html#supported-xpath-syntax

20.5.2. XPath support

This module provides limited support for XPath expressions for locating elements in a tree. The goal is to support a small subset of the abbreviated syntax; a full XPath engine is outside the scope of the module.

What you could do is testing the values with text once you have matched all elements of your choice.

>>> import xml.etree.ElementTree as ET
>>> xml = ET.fromstring("<root><h1>1</h1><p><h1>2</h1></p></root>")
>>> result = xml.findall(".//h1")
>>> for i in result:
...     print(i.text)
... 
1
2

Could you close the issue?
History
Date User Action Args
2013-03-07 03:53:41karlcowsetrecipients: + karlcow, eli.bendersky, flox, Antoine2008
2013-03-07 03:53:41karlcowsetmessageid: <1362628421.21.0.723176834481.issue17138@psf.upfronthosting.co.za>
2013-03-07 03:53:41karlcowlinkissue17138 messages
2013-03-07 03:53:40karlcowcreate