I have the following XML:
<oa:Parties>
<ow-o:SupplierParty>
<oa:PartyId>
<oa:Id>1</oa:Id>
</oa:PartyId>
</ow-o:SupplierParty>
<ow-o:CustomerParty>
<oa:PartyId>
<oa:Id>123-123</oa:Id> // I NEED THIS
</oa:PartyId>
<oa:Business>
<oa:Id>ShiptoID</oa:Id>
</oa:Business>
</ow-o:CustomerParty>
</oa:Parties>
How can I get the 123-123 value?
I tried this:
NodeList nodeList = document.getElementsByTagName("ow-o:CustomerParty");
Node parentNode = nodeList.item(0);
String ID = parentNode.getTextContent();
But it has both <oa:Id> elements.
Is there a way to find the value based on hierarchy ow-o:CustomerParty > oa:PartyId > oa:Id?