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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

export to xml with multiple loops

I am trying to extract data from database to a xml file. There are multiple loops inside xml document. it is like below. I created a metadata based on the output xml file format. I am thinking I could use tAdvancedFileOutputXML. But I don't know how to map the data from database to the xml loops. Shall I split each loop to a small part, then map it from db to xml first? Then add all these small part together to a big file?
I appreciate if anybody could give me any idea on this. Thanks.

<root>
<Header>
<MessageId></MessageId>
</Header>
<contactinfo>
<contactHeader>
<contactId></contactId>
</contactHeader>
<contactAddress>
<name></name>
<phone></phone>
</contactAddress>

<contactAddress>
<name></name>
<phone></phone>
</contactAddress>

</contactinfo>
<contactinfo>
<contactHeader>
<contactId></contactId>
</contactHeader>
<contactAddress>
<name></name>
<phone></phone>
</contactAddress>

<contactAddress>
<name></name>
<phone></phone>
</contactAddress>

</contactinfo>
</root>
Labels (3)
3 Replies
Anonymous
Not applicable
Author

Hi,
I think the component tXMLMap can meet your needs(multiple loops), please review the component reference and related scenarios at first, and then feel free post your issue on forum.
Best regards
Sabrina
Anonymous
Not applicable
Author

Thanks for the document.
I looked through it. The examples are all input file is the xml file. My case is the output file is XML file.
When I use tXmlmap, my input is database, out put is tAdvancedFileOutputXML. I couldn't see the tree in tXmlMap.
Do you have any example for tXmlMap with output is xml file?
Thanks.
Anonymous
Not applicable
Author

Hi,
I think you should be familiar with the component tXMLMap firstly , there is the article about tXMLMap operation with three chapters Using the document type to create the XML tree, Defining the output mode and Editing the XML tree schema.
In addition, tAdvancedFileOutputXML only support one loop element in it and cannot be used together with tXMLMap.
Best regards
Sabrina