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?
Ok, this is, what I need
root.selectNodes("//*[not(*)]")
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With