I'm using a groovy file where I used xmlParser to generate XML.Now, I want to get the tag values of the xml.
Here is my code
def rootnode = new XmlParser().parseText(responseXml);
Output
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:creditCard">
<SOAP-ENV:Body><ns1:creditCardResponse xmlns:ns1="urn:creditCard">
<return xsi:type="tns:RPResponse">
<Status xsi:type="xsd:int">0</Status>
</return>
</ns1:creditCardResponse>
</SOAP-ENV:Body>
I have tried like rootnode.Status[0].text()
However its not getting. How can I get "Status" value in it? Little confused.
Thanks,