[Lxml-checkins] r43346 - lxml/trunk/doc
scoder at codespeak.net
scoder at codespeak.net
Mon May 14 10:33:57 CEST 2007
Author: scoder
Date: Mon May 14 10:33:57 2007
New Revision: 43346
Modified:
lxml/trunk/doc/extensions.txt
Log:
fix after XPath eexception change
Modified: lxml/trunk/doc/extensions.txt
==============================================================================
--- lxml/trunk/doc/extensions.txt (original)
+++ lxml/trunk/doc/extensions.txt Mon May 14 10:33:57 2007
@@ -128,8 +128,9 @@
>>> print xslt(doc)
Ola Haegar
-It is also possible to register namespaces with a single evaluator. While the
-following example involves no functions, the idea should still be clear::
+It is also possible to register namespaces with a single evaluator after its
+creation. While the following example involves no functions, the idea should
+still be clear::
>>> f = StringIO('<a xmlns="http://mydomain.org/myfunctions" />')
>>> ns_doc = etree.parse(f)
@@ -138,7 +139,8 @@
[]
This returns nothing, as we did not ask for the right namespace. When we
-register the namespace with the evaluator, we can access it via a prefix::
+register the namespace with the evaluator, however, we can access it via a
+prefix::
>>> e.registerNamespace('foo', 'http://mydomain.org/myfunctions')
>>> e.evaluate('/foo:a')[0].tag
@@ -151,7 +153,7 @@
>>> e2.evaluate('/foo:a')
Traceback (most recent call last):
...
- XPathSyntaxError: error in xpath expression
+ XPathEvalError: Undefined namespace prefix
Evaluator-local extensions
More information about the lxml-checkins
mailing list