XPath support?

KJ

Usenet Archive
Joined
Feb 23, 2000
Messages
2,175
Reaction score
0
I'm looking for a XML parser that produces an object with full XPath support. What I've been using up to now, xml.etree.ElementTree, fails to support Xpath predicates, as in "spam[@eggs='3']/ham".

What I'm trying to do is to read-in a large XML string, and parse it into an object from which I can extract nodes matching selectors that include such predicates.

Any suggestions would be greatly appreciated.

TIA!

kynn
 

Diez B. Roggisch

Usenet Archive
Joined
Jul 27, 2003
Messages
4,325
Reaction score
0
kj said:
I'm looking for a XML parser that produces an object with full XPath support. What I've been using up to now, xml.etree.ElementTree, fails to support Xpath predicates, as in "spam[@eggs='3']/ham".

What I'm trying to do is to read-in a large XML string, and parse it into an object from which I can extract nodes matching selectors that include such predicates.

Any suggestions would be greatly appreciated.

Try lxml. It's element-tree compatible, and supports xpath.

Diez
 

Kev Dwyer

Usenet Archive
Joined
Aug 16, 2009
Messages
46
Reaction score
0
I'm looking for a XML parser that produces an object with full XPath support. What I've been using up to now, xml.etree.ElementTree, fails to support Xpath predicates, as in "spam[@eggs='3']/ham".

What I'm trying to do is to read-in a large XML string, and parse it into an object from which I can extract nodes matching selectors that include such predicates.

Any suggestions would be greatly appreciated.

TIA!

kynn

Have you tried lxml (http://codespeak.net/lxml/)?

Kev
 

KJ

Usenet Archive
Joined
Feb 23, 2000
Messages
2,175
Reaction score
0
In said:
I'm looking for a XML parser that produces an object with full XPath support. What I've been using up to now, xml.etree.ElementTree, fails to support Xpath predicates, as in "spam[@eggs='3']/ham".

What I'm trying to do is to read-in a large XML string, and parse it into an object from which I can extract nodes matching selectors that include such predicates.

Any suggestions would be greatly appreciated.

TIA!

kynn

Have you tried lxml (http://codespeak.net/lxml/)?

Thanks! (To Diez too!)

kynn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,050
Messages
3,104,249
Members
248,133
Latest member
DujonT

Latest Threads

Top