Try using XMLBeans (http://xmlbeans.apache.org/).
shailesh.gokhale@gmail.com - 09 Dec 2005 06:51 GMT
Hi,
Thanks for the info. I am in a process of evaluating.
Will post when done.
Thanks
Shailesh
> Is there an api out there which can help me generate xpath for a node?
>
> I mean I am navigating an xml using sax. On satisfaction of a
> particular condition on a node I want to generate the xpath for that
> node.
If you're using SAX, then the parser hasn't kept enough information to
do any such thing. Have you kept the necessary information?

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
shailesh.gokhale@gmail.com - 09 Dec 2005 06:46 GMT
Ok so it is not possible with SAX ... any idea if it is possible with
DOM?
Hiran Chaudhuri - 10 Dec 2005 14:13 GMT
> Ok so it is not possible with SAX ... any idea if it is possible with
> DOM?
What kind of XPath do you want to generate? Why is that not possible with
SAX?
Hiran
shailesh.gokhale@gmail.com - 12 Dec 2005 05:59 GMT
What do you mean ' ... kind of xpath ' ? The xpath that we usually
use. Like - node/childNode2[0]/childchildNode - etc.
It is apparently not possible with sax because sax is only event based
parsing mechanism. It does not store info on the whole tree unless we
code to do so.
Therefore before coding such a thing I wanted to check if dom can give
me the xpath directly because it already has the tree information
stored.