Ask a Question

Generate Request XML with input from excel using Groovy


Generate Request XML with input from excel using Groovy


I am trying to generate Request XML using excel sheet. Can someone please look into this and help me out.

I am trying to write groovy script to pick nodes(customer_info, un:id, un:org et.c) from excel.I've attached a sample XML, which is my expected output from the groovy script.

(I can use Datasource later to test this with different values. But the first step is to generate the XML)


Also, note that the sample XML i shared has some child nodes (lp:time)that need not be present everytime, but I should be able to add it in request xml, if the excel sheet has that flag set as yes.


Note: I don't have any excel sheet prepared that serves as input here. 


Thanks in advance !

Community Hero



> [...] the first step is to generate the XML


Does this help?


  /Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.

Thanks for replying. But the following is my expected output.

Also, please note I am trying to pick the nodes from excel input.Any inputs in that direction will be of great help for me to explore further.


<?xml version="1.0" encoding="UTF-8"?>
<program xmlns:xsi="" xmlns:lp="">
<un:temperature units="celsius">37</un:temperature>
<lp:count size="3">
<lp:round round_id="1">
<lp:volume units="mL">170</lp:volume>
<lp:round round_id="2">
<lp:volume units="mL">100</lp:volume>
<lp:time units="s">1500</lp:time>
<lp:round round_id="3">
<lp:volume units="mL">10</lp:volume>

Showing results for 
Search instead for 
Did you mean: