[Lxml-checkins] r44660 - lxml/trunk/doc
scoder at codespeak.net
scoder at codespeak.net
Mon Jul 2 10:53:42 CEST 2007
Author: scoder
Date: Mon Jul 2 10:53:42 2007
New Revision: 44660
Modified:
lxml/trunk/doc/objectify.txt
Log:
doc: writing objectify tag languages with E-factory
Modified: lxml/trunk/doc/objectify.txt
==============================================================================
--- lxml/trunk/doc/objectify.txt (original)
+++ lxml/trunk/doc/objectify.txt Mon Jul 2 10:53:42 2007
@@ -287,7 +287,24 @@
<c>true</c>
<d tell="me">how</d>
</root>
-
+
+This allows you to write up a specific language in tags::
+
+ >>> ROOT = objectify.E.root
+ >>> TITLE = objectify.E.title
+ >>> TYPE = objectify.E.type
+
+ >>> root = ROOT(
+ ... TITLE("The title"),
+ ... TYPE(5)
+ ... )
+
+ >>> print etree.tostring(root, pretty_print=True)
+ <root>
+ <title>The title</title>
+ <type>5</type>
+ </root>
+
Namespace handling
------------------
More information about the lxml-checkins
mailing list