You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Paul Brickell <Pa...@Virginmobile.com> on 2002/06/21 13:41:37 UTC

JXpath for DOM returning DOM objects?

Is it possible to use this API to access DOM objects (Node, Attr, Element etc)?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JXpath for DOM returning DOM objects?

Posted by Dmitri Plotnikov <dm...@apache.org>.
Yes, it is, but you will have to use an internal API.

First, acquire a pointer:

    Pointer pointer = context.getPointer(xpath);
or
    Iterator iter = context.iteratePointers(xpath);

Then cast (each) pointer to NodePointer.

Finally, call "getNodeValue()" on the pointer.

The rationale for this method not being on the public interface is to hide
differences between DOM, JDOM and other XML parse trees.

I hope this helps.

- Dmitri


----- Original Message -----
From: "Paul Brickell" <Pa...@Virginmobile.com>
To: <co...@jakarta.apache.org>
Sent: Friday, June 21, 2002 7:41 AM
Subject: JXpath for DOM returning DOM objects?


> Is it possible to use this API to access DOM objects (Node, Attr, Element
etc)?
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>