[Lxml-checkins] r32093 - lxml/trunk/doc
scoder at codespeak.net
scoder at codespeak.net
Sat Sep 9 07:18:53 CEST 2006
Author: scoder
Date: Sat Sep 9 07:18:49 2006
New Revision: 32093
Modified:
lxml/trunk/doc/objectify.txt
Log:
doc update: show how to access children called 'text' etc. in objectify
Modified: lxml/trunk/doc/objectify.txt
==============================================================================
--- lxml/trunk/doc/objectify.txt (original)
+++ lxml/trunk/doc/objectify.txt Sat Sep 9 07:18:49 2006
@@ -301,6 +301,18 @@
>>> print root["tag-name"][1].child.tag
{ns}child
+or for names that have a special meaning in lxml.objectify::
+
+ >>> root = objectify.XML("<root><text>TEXT</text></root>")
+
+ >>> print root.text.text
+ Traceback (most recent call last):
+ ...
+ AttributeError: 'NoneType' object has no attribute 'text'
+
+ >>> print root["text"].text
+ TEXT
+
ObjectPath
----------
More information about the lxml-checkins
mailing list