XPath - how to get non exist nodes? please help!
Hi!
There is a so xml structure:
main_node
node_a
node_a_1
node_a_2
node_a_3
the 'node_a' node repeats 3times in the XML. The 'node_a_2' node is not in the first recurrence of 'node_a' node.
When I want to get the 'node_a_2' nodes by XPath, I get a List, which consists of 2 element.
But I want to get a so list, which consists of 3 elements, the first is null and the others are the elements of 'node_a_2' node!
This is the code:
List getElementByXPath(String Path) throws org.jaxen.JaxenException {
org.jaxen.XPath P = new org.jaxen.jdom.JDOMXPath("/"+Path.replace(".","/"));
List Back = P.selectNodes(ArrivedXML.getRootElement());
return Back;
}
Please help, how can i do it!
Thank You very much!
rflair

