Looking for a java xpath parser

ketan (archive)

Usenet Archive
Joined
May 18, 2001
Messages
12
Reaction score
0
Hello,

I am looking for a java-based xpath parser, that will enable me parse a string containing an xpath expression into steps, predicates, conditions etc.

sample expressions: a/b/c, a/b[@name='123'][4]/c[@name='ddd'] etc.

I have looked at a couple and didn't really find what I wanted.. Some did not have methods to get the info I was looking for, one did not support the level of indexing I need...

Any pointers would be greatly appeciated..

Thanks in advance.

-K
 

Peter Votruba

Usenet Archive
Joined
Jul 9, 2003
Messages
2
Reaction score
0
Ketan said:
Hello,

I am looking for a java-based xpath parser, that will enable me parse a string containing an xpath expression into steps, predicates, conditions etc.

sample expressions: a/b/c, a/b[@name='123'][4]/c[@name='ddd'] etc.

I have looked at a couple and didn't really find what I wanted.. Some did not have methods to get the info I was looking for, one did not support the level of indexing I need...

Any pointers would be greatly appeciated..

Thanks in advance.

Have you tried SAXPath? http://saxpath.sourceforge.net/
Its now part of Jaxen: http://jaxen.org/

Peter
 

GIMME

Usenet Archive
Joined
Jun 3, 2003
Messages
107
Reaction score
0
JDOM works for me ....

Since that should have been what you looked at first or second - what is there not to like?




XPath xpath = XPath.newInstance("//input[@name='manager_login']"); List ManagerList = null; if ( null != xpath ) { ManagerList = xpath.selectNodes(new Document(myjdom)); }
 

Ketan Deshpande

Usenet Archive
Joined
Aug 27, 2004
Messages
2
Reaction score
0
Thanks for the pointer to JDOM. However, I don't want to actually address into an XML doc, I want to be able to parse the XPATH string and break it apart into it's individual parts and then I need to be able to accss those individual expresions, steps and predicates. A number of parsers to what you are illustrating; however, that's not my application.
 

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,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top