newb: lxml objectify
- From: "johnny" <rampeters@xxxxxxxxx>
- Date: 30 Mar 2007 13:36:30 -0700
<Library>
<DVD id="1">
<title>Breakfast at Tiffany's</title>
<format>Movie</format>
<genre>Classic</genre>
</DVD>
<DVD id="2">
<title>Borat</title>
<format>Movie</format>
<genre>Comedy</genre>
</DVD>
</Library>
How do you represent DVD id=1 and it's elements, and DVD id=2 and it's
elements as child of root "Library"?
Like this:?
from lxml import etree
from lxml import objectify
root = objectify.Element("Library")
child[1] = objectify.Element("DVD", id="1")
root.new_child = child[1]
Thank you
.
- Prev by Date: Re: Object Oriented Database with interface for Pyhton
- Next by Date: Re: Tkinter menu question--how to pass arguments
- Previous by thread: Tkinter menu question--how to pass arguments
- Next by thread: Re: [Pythonmac-SIG] MacPython wiki "moved" to Python wiki - now it's your turn...
- Index(es):
Relevant Pages
|