XPath support?

K

kj

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
 
D

Diez B. Roggisch

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
 
K

Kev Dwyer

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
 
K

kj

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top