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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Advanced XML output writing

Hello,
I have some problems to write data in an specific XML file format
I want to build a file from this row format
Column Type
channel_id (int)
program_id (int)
program (DomElement)

My output file should have this structure
<channels> (my root element)
<channel channel_id="1">
<program program_id="1">
<programdomcontent/>
</program>
<program program_id="2"/>
<programdomcontent/>
</program>
</channel>
<channel channel_id="2">
<program program_id="3"/>
<programdomcontent/>
</program>
<program program_id="4"/>
<programdomcontent/>
</program>
</channel>
</channels>


Currently I'm using a tJavaFlex with org.dom4j.Element to perform the xml build. I tried to use the tAdvancedFileOutputXML instead, with no success.
How can I transform my rows in the desired XML file format?
Can anyone help me or give me a lead ?

Best regards,
Max
Labels (4)
3 Replies
Anonymous
Not applicable
Author

Hi
You may use tAdvancedFileOutputXml to format xml file.
Best regards!
Pedro
Anonymous
Not applicable
Author

Hi Pedro,
Thanks for your answer !
I tried your solution and added a second loop on program. The XML Output structure is here.
Now I've problem with the DomElement. I want my program column to be the program XML element.
With the current solution, my program column content is added as text ("<" and ">" are encoded as "<" and ">") and can not be parsed properly...
Regards,
Max
Anonymous
Not applicable
Author

Building on Pedro's example...set "loop element" (right-click) on program and "group" (right-click) on channel.