XML : Selecting different types of nodes or NULL values with XPATH

Providing we have the following xml structure:

  <root>     <nodeA>       <nodeB>Some text</nodeB>     </nodeA>     <nodeA>Some text</nodeA>     <nodeA>       <nodeB>Some other text</nodeB>     </nodeA>     ...  </root>    

Is there a way to select "nodeB" nodes or NULL value instead for each nodeA, so for the example above it returns:

  nodeB  NULL  nodeB    

The order of elements is important.

Thank you!

No comments:

Post a Comment