Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Multiple Loop XML

Hi,
I have a problem when executing the ?tfileoutputmsxml?.
I am trying to fix elements on the xml tree, after the loop element. But when I come back on the xml tree (tfileoutputmsxml) elements have changed place.
When I execute the result is not the one expected. Is there a solution to have this output?
Expected OUTPUT:
<rootTag>
<transaction id="1300400000011">
<retailTransaction>
<lineItem article="1">
<retail discount="20.00"/>
</lineItem>
<lineItem article="2">
<retail discount="30.00"/>
</lineItem>
<lineItem paiement="34224.0"/>
<lineItem paiement="34225.0"/>
<afterLoop1></afterLoop1>
<afterLoop2></afterLoop2>
</retailTransaction>
Regards
Yoann
</transaction>
<transaction id="1300400000012">
<retailTransaction>
<lineItem article="3">
<retail discount="50.00"/>
<retail discount="10.00"/>
</lineItem>
<lineItem paiement="34226.0"/>
<lineItem paiement="34227.0"/>
<lineItem paiement="34228.0"/>
<afterLoop1></afterLoop1>
<afterLoop2></afterLoop2>
</retailTransaction>
</transaction>
</rootTag>
Labels (3)
16 Replies
Anonymous
Not applicable
Author

Hi Yoann
There can be only one loop element in xml component. But you can set group element.
I guess you didn't set the component correctly.
Regards,
Pedro
Anonymous
Not applicable
Author

Hi pedro,
In the tFileOutputMSXML, it's possible to configure multiple loop element.
The problem is i don't have what i want in output...
Regards,
Yoann
Anonymous
Not applicable
Author

Hi Yoann
Sorry... I regards tAdvancedOutputXML as tFileOutputMSXML...
Regards,
Pedro
Anonymous
Not applicable
Author

Yes the main problem is not multiple loop, but i cannot put my element AfterLoop1 and AfterLoop2 where i want. They always appear in the begining of the loop instead of the end..
If anyone got a solution...
Regards,
Yoann
janhess
Creator II
Creator II

The only way I've found to reposition them is by editing the jobname.item file and moving them in that. Not elegant but gets you there
Anonymous
Not applicable
Author

Hi janhess
I have this part of code in my jobname.item :
<node componentName="tFileOutputMSXML" componentVersion="0.102" offsetLabelX="0" offsetLabelY="0" posX="736" posY="448">
<elementParameter field="TEXT" name="UNIQUE_NAME" value="tFileOutputMSXML_1"/>
<elementParameter field="FILE" name="FILENAME" value=""C:/Talend/test/outXML.xml""/>
<elementParameter field="TABLE" name="ROOT">
<elementValue elementRef="PATH" value="/rootTag"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/> <elementValue elementRef="ATTRIBUTE"

To see the whole post, download it here
OriginalPost.pdf
janhess
Creator II
Creator II

Not quite sure where you want then. Can you give an xml example.
Anonymous
Not applicable
Author

That s what i want. The only problem is the position of AfterLoop1 and AfterLoop2
janhess
Creator II
Creator II

What are you actually getting?