Following groovy script is not working as expected.
def xml="<Collection><CustomerQuote><ID>99988877766</ID><TypeCode>2059</TypeCode><ApprovalStatusCode>4</ApprovalStatusCode></CustomerQuote><CustomerQuote><ID>99988877755</ID><TypeCode>2059</TypeCode><ApprovalStatusCode>4</ApprovalStatusCode></CustomerQuote></Collection>"
def completeXml= new XmlSlurper().parseText(xml);
def IDs = completeXml.Collection.CustomerQuote.findAll{node-> node.name() == 'ID' }*.text();
I am trying to copy all the ID value in xml in the IDs
Output
IDs[]
Expected Output
IDs[99988877766,99988877755]
I am not sure what i am doing wrong here.
Can anyone guide.
Thank you Regards Prat