Re: [xml] python xpath
- From: Stefan Seefeld <seefeld sympatico ca>
- To: xml gnome org
- Subject: Re: [xml] python xpath
- Date: Tue, 13 Jul 2004 17:45:37 -0400
Jason Jesso wrote:
I'm really new to python and especially libxml2.
The node's 'content' (python) attribute will contain the actual text (if it
is a text node).
Could you tell me how to do that?
...
results = ctxt.xpathEval("/your/xpath/*")
for r in results:
    print r.content
Some other attributes you may be interested in are 'type', 'name', etc.
To find out what attributes a node supports, use 'dir(node)'
Regards,
                Stefan
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]