Java xpath, select deepest children
I am new to Java and XPath syntax. I have a complex XML document. I need to select all nodes that have no children (I really need their values).
<root>
<a>
<b>text1</b>
<c>text2</c>
</a>
<d>
<e>
<f>text3</f>
</e>
</d>
<f>text4</f>
</root>
I want to get a list "text1","text2","text3","text4"
here. Could you please help me with the xpath expression? Thank.
+3
source to share