I have the below XML. Here I want to get the previous sibling of node c which is b using java
<root>
<a>
<b>
<c>
<d>
</a>
</root>
Whenever I try to get the node using node.getPreviousSibling() method I get the node as #text but not the node b.
Any help on this is very much appreciated.
You need to do something like this:
(the #text that you get is the actual text in the node)