ContributionsMost RecentMost LikesSolutionsRe: SOAPUI - Groovy : Get parent names / children names / nodes values from XML response Thanks a lot for your answer, that's exactly what I needed ! Re: SOAPUI - Groovy : Get parent names / children names / nodes values from XML response (sorry for my english, I'm studying it at school). To be more precise, if I have the following XML file : <Body> <parent_Node_A>value_A</parent_Node_A> <parent_Node_B> <children_Node_B1>value_B1</children_Node_B1> <children_Node_B2>value_B2</children_Node_B2> </parent_Node_B> <parent_Node_C>value_C</parent_Node_C> <parent_Node_D> <children_Node_D>value_D</children_Node_D> </parent_Node_D> <parent_Node_E>value_E</parent_Node_E> </Body> The goal is to capture all parent nodes to each value returned by the groovy script. For the "value_B1", I have to capture its parent nodes and concatenate them : "Body/parent_Node_B/children_NodeB1=value_B1" Second example, for the "value_D" : "Body/parent_Node_D/children_Node_D=value_D" Third example, for the "value_E" : "Body/parent_Node_E=value_E" I hope I've been more explicit. Thanks. Re: SOAPUI - Groovy : Get parent names / children names / nodes values from XML responseHi, Thanks for your answer. For each index, I want the tag tree to each node, from the "Body" nodeSOAPUI - Groovy : Get parent names / children names / nodes values from XML response Hi, I am parsing an xml response with SOAPUI and using a Groovy script like this. The goal of this script is to get children nodes names and values in xml response. def parsing = """ <Body> <parent_Node_A>value_A</parent_Node_A> <parent_Node_B> <children_Node_B1>value_B1</children_Node_B1> <children_Node_B2>value_B2</children_Node_B2> </parent_Node_B> <parent_Node_C>value_C</parent_Node_C> <parent_Node_D> <children_Node_D>value_D</children_Node_D> </parent_Node_D> <parent_Node_E>value_E</parent_Node_E> </Body> """ def parsingResult = new XmlSlurper().parseText(parsing) def ArrayList_parsing = [] def resultsParsing resultsParsing = {output,node -> node.children().each{resultsParsing(ArrayList_parsing,it) } if (node.children().size()==0) output << node.name()+'='+node.text() } parsingResult.'**'.findAll { it.name() == 'Body' }.each { resultsParsing(ArrayList_parsing,it) } for (int i=0;i<ArrayList_parsing.size();i++) { log.info ArrayList_parsing[i] } This is almost what I want ! The output of the code above is : parent_Node_A=value_A children_Node_B1=value_B1 children_Node_B2=value_B2 parent_Node_C=value_C children_Node_D=value_D parent_Node_E=value_E I have now to modify my code to have the parent name of each children but I don't get it :( Body/parent_Node_A=value_A Body/parent_Node_B/children_Node_B1=value_B1 Body/parent_Node_B/children_Node_B2=value_B2 Body/parent_Node_C=value_C Body/parent_Node_D/children_Node_D=value_D Body/parent_Node_E=value_E If anyone of you could help me ? Many thanks in advance. BR, Anthony. SolvedRe: GroovyScript: Parse SOAP Response and get node names and node values rupert_anderson It is. I put this link on the other related topic :) you could close it. BR, Anthony Re: GroovyScript: Getting node name, sub node names and its values in array from XML Hi, Please find the solution on this topic : https://community.smartbear.com/t5/SoapUI-Open-Source/GroovyScript-Parse-SOAP-Response-and-get-node-names-and-node/m-p/143557#M24313 BR, Anthony. Re: GroovyScript: Parse SOAP Response and get node names and node values rupert_anderson, THIS IS EXACTLY WHAT I NEEDED !! Many thanks ... I can now close this topic, I think it will be helpfull for other people. Anthony. Re: GroovyScript: Parse SOAP Response and get node names and node values Hi nmrao, Thanks for your answer, It's almost that !! The problem is that I should not mention the " it.name()=='Info' ". I'll have other WebServices Response to parse, and node names will change, I can't adapt script on each response. But many thanks for your answer, I'll try to get a result by using your code ! Re: GroovyScript: Parse SOAP Response and get node names and node values rupert_anderson that's right, I should not mention any node name in script. I know that I have to use de .children() method but I don't know exactly how to use it ... Re: GroovyScript: Parse SOAP Response and get node names and node values You're right, but if I have another parsing response, node names will change. So, I am not able to know node names. I have to provide a code which is parsing node names and values associated without know them.