Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Looking for a java xpath parser

Reply
Thread Tools

Looking for a java xpath parser

 
 
Ketan
Guest
Posts: n/a
 
      08-19-2004
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
 
Reply With Quote
 
 
 
 
Peter Votruba
Guest
Posts: n/a
 
      08-23-2004
Ketan wrote:
> 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



 
Reply With Quote
 
 
 
 
GIMME
Guest
Posts: n/a
 
      08-23-2004
JDOM works for me ....

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


<%@ page import="org.jdom.xpath.*"%>
<%@ page import="org.jdom.Element"%>

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


http://www.velocityreviews.com/forums/(E-Mail Removed) (Ketan) wrote in message news:<(E-Mail Removed). com>...
>
> 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...
>

 
Reply With Quote
 
Ketan Deshpande
Guest
Posts: n/a
 
      08-27-2004



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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Ketan Deshpande
Guest
Posts: n/a
 
      08-27-2004
Peter,

Thanks for the pointer. I am looking at using Jaxen.

-K

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
GIMME
Guest
Posts: n/a
 
      08-27-2004
Try Googling "Xpath Parser".

I came up with this ...

http://groups.google.com/groups?hl=e...%3D20%26sa%3DN

(http://www.acooke.org/jara/org-acooke/index.html looks like you have
to
ask via email for the source)


Ketan Deshpande <(E-Mail Removed)> wrote in message news:<412ec2d4$0$14503$(E-Mail Removed)> ...
> 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.
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Memory leak" in javax.xml.xpath.XPath Marvin_123456 Java 4 07-29-2005 03:49 PM
XPath: efficiency in xpath expressions Tjerk Wolterink XML 1 11-13-2004 06:03 PM
Are there any XPath parsers that generate XPath trees? goog XML 0 01-14-2004 01:47 PM
XPath that does not include other XPath Anna XML 0 07-31-2003 07:55 AM
Problem selecting a node with XPATH if attribute value contains backslashes - how to force XPATH string to be treated as literal? Alastair Cameron XML 1 07-08-2003 07:24 PM



Advertisments