Re: [xml] Question about parent/child (python-libxml2)

On Mon, May 10, 2004 at 06:30:27PM +0200, I wrote:
(*) The following code works for me:

Sorry, there were two lines of cruft, now for real:

#!/usr/bin/env python
import libxml2
dom = libxml2.parseDoc('''<?xml version="1.0"?>
<para>Then, shalt thou count to
<emphasis>three</emphasis>, no more, no less.</para>''')
nodes = dom.xpathEval("//para")
for n in nodes:
    if n.children:
        c = n.children
        while c != None:
            print c.serialize()
            c =

W. Borgert <debacle debian org>,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]