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

[832 byte] By [rflaira] at [2007-10-3 3:21:31]
# 1
the structure again...:main_node....node_a........node_a_1........node_a_2........node_a_3
rflaira at 2007-7-14 21:13:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
If node_a_2 is not in the first node_a, the node list won't contain the node_a_2 either.
dvohra09a at 2007-7-14 21:13:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...