-1

We need to get the child nodes of an node in the xml for which we have the Pointer. Can anyone please help as how to get the Node object of the node to which the Pointer is pointing?

Any help is highly appreciated.

Saran
  • 213
  • 2
  • 5
  • 13

1 Answers1

0

Pointers are references to the xpath provided by the JXPathContext class in the apache commons library.

JXPathContext jxpCtxt = JXPathContext.newContext(object);
Iterator pointers = jxpCtxt.iteratePointers( xPath );

Pointers represent locations of objects and their properties in Java object graphs. JXPathContext has methods which, given an XPath, produce Pointers for the objects or properties described the the path. For example,
ctx.getPointer("foo/bar")
will produce a Pointer that can get and set the property "bar" of the object which is the value of the property "foo" of the root object.

http://commons.apache.org/jxpath/apidocs/org/apache/commons/jxpath/class-use/Pointer.html

Saran
  • 213
  • 2
  • 5
  • 13