Issue
I'm new to Java and XPath syntax. I have complex xml document. What I need is to select all the nodes, that don't have children (I need their values actually).
<root>
<a>
<b>text1</b>
<c>text2</c>
</a>
<d>
<e>
<f>text3</f>
</e>
</d>
<f>text4</f>
</root>
I want to get list "text1","text2","text3","text4" here. Could you help me with XPath expression?
Solution
Ok, this is, what I need
root.selectNodes("//*[not(*)]")
Answered By - Timofei Davydik
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.