Or generate an element() scheme XPointer instead: element(/1/1/2)

Nikhil Dinesh <[EMAIL PROTECTED]> wrote on 03/30/2006 10:36:14 AM:

> Well, if JXPath gives you an XPointer from an XPath, why not just 
generate
> an XPath for a node? It will obviously not be the most readable XPath, 
or
> the most efficient (doing that is impossible). For example if you
> have:
> 
> <foo>
>  <bar1>
>    <bar2/>
>    <bar3/>
>  </bar1>
> </foo>
> 
> and you want an XPath for bar3, it could simply be:
> 
> child::*[position()=1]/child::*[position()=1]/child::*[position()=2]
> 
> run against the Document node.
> 
> You should be able to accomplish this with about 10 lines of code.
> 
> hth,
> -Nikhil

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to