Patil86
12 years agoOccasional Contributor
How to remove empty nodes
Hi
I am new to this soap UI and Groovy scripting , i have a situation where i have to check if any of the nodes in the soap request are empty and remove such nodes , i have to traverse the through all the nodes & child nodes to find and remove empty tags .
My request will look something like
<soapenv:Body>
<ns:asd>09123</ns:asd>
<ns:aer>this is one<ns:/aer>
<ns:ent>
<ns:ent1>444.15</ns:ent1>
<ns:entas>ds</ns:entas>
<ns:went>12312356</ns:went>
<ns:wen>201312</ns:wen>
</ns:ent>
<ns:try>
<ns:trya>
<ns:ttr/>
<ns:trr/>
</ns:trya>
<ns:tryb>
<ns:tyy>
<ns:tyyr/>
<ns:tyyt/>
</ns:tyy>
<ns:tryba>
<ns:trycd/>
<ns:tryce/>
</ns:tryba>
<ns:tryb>
</ns:try>
</soapenv:Body>
there can be many nested nodes which i have to remove . Can anyone plz help me through this ...
Regards
Patil
I am new to this soap UI and Groovy scripting , i have a situation where i have to check if any of the nodes in the soap request are empty and remove such nodes , i have to traverse the through all the nodes & child nodes to find and remove empty tags .
My request will look something like
<soapenv:Body>
<ns:asd>09123</ns:asd>
<ns:aer>this is one<ns:/aer>
<ns:ent>
<ns:ent1>444.15</ns:ent1>
<ns:entas>ds</ns:entas>
<ns:went>12312356</ns:went>
<ns:wen>201312</ns:wen>
</ns:ent>
<ns:try>
<ns:trya>
<ns:ttr/>
<ns:trr/>
</ns:trya>
<ns:tryb>
<ns:tyy>
<ns:tyyr/>
<ns:tyyt/>
</ns:tyy>
<ns:tryba>
<ns:trycd/>
<ns:tryce/>
</ns:tryba>
<ns:tryb>
</ns:try>
</soapenv:Body>
there can be many nested nodes which i have to remove . Can anyone plz help me through this ...
Regards
Patil