It's all about the answers!

Ask a question

[PUB] How to dynamically pass multiple xml file input for URI for Report Generation

Chandan M B (1133265) | asked Jul 13 '21, 7:54 a.m.

Hello All,

I have stored multiple path to xml response files in the machine. I will add it to an array.
I need to iterate the array and pass it each xml path to URI dynamically to print the contents. Could you please help ?


Accepted answer

permanent link
Subramanya Prasad Pilar (4.6k14) | answered Jul 13 '21, 2:17 p.m.
edited Jul 13 '21, 2:19 p.m.

Use a template variable (_count) with default value = 0. After adding the xml file paths to the array, you can iterate over that array using an Iteration element in the template.
For the "Do while condition" (property) of Iteration element, you can set _count1 < _xmlArray.length.

Inside the array element, you can use a Data Source Configuration element by setting its URI to _xmlArray[_count1]. You should increment _count (_count = _count*1 + 1) within the Iteration element.

Chandan M B selected this answer as the correct answer

Your answer

Register or to post your answer.