[Lxml-checkins] r43509 - lxml/trunk/doc
scoder at codespeak.net
scoder at codespeak.net
Sun May 20 10:18:14 CEST 2007
Author: scoder
Date: Sun May 20 10:18:13 2007
New Revision: 43509
Modified:
lxml/trunk/doc/tutorial.txt
Log:
tutorial: XPath as function
Modified: lxml/trunk/doc/tutorial.txt
==============================================================================
--- lxml/trunk/doc/tutorial.txt (original)
+++ lxml/trunk/doc/tutorial.txt Sun May 20 10:18:13 2007
@@ -278,6 +278,12 @@
>>> print html.xpath("//text()") # lxml.etree only!
['TEXT', 'TAIL']
+If you want to use this more often, you can wrap it in a function::
+
+ >>> buildTextList = etree.XPath("//text()") # lxml.etree only!
+ >>> print buildTextList(html)
+ ['TEXT', 'TAIL']
+
.. _XPath: xpathxslt.html#xpath
More information about the lxml-checkins
mailing list