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

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

[resolved] XML output with dynamic schema

Hi guys, first post here.
I've been using TOS for a few days and I'm facing a problem that I can't solve. I've looked in the forums with no success.
For instance, imagine I have a csv like this (first column is a Property Name and second columns is Property Value):
weight; 100
height; 2
eyes; blue
hair; black
I need to generate an XML file like this:
<root>
<weight>100</weight>
<height>2</height>
<eyes>blue</eyes>
<hair>black</hair>
</root>
Basically I have to generate an xml and its schema depends on the data.
Has anyone succeeded in doing this? I couldn't do it with the Xml components and I don't know how to do it with the tJava component.
I don't mind having to develop a custom component but it would be nice to use one of the available components.
Thanks,
Tiago
Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
It is impossible to define a element name base on the input data, in Talend, a XML tree is defined at the design time, not the run time. It is easy to generate the XML if you consider the following XML tree:
<root>
<info>
<property_name>weight</property_name>
<property_value>100</property_value>
</info>
<info>
<property_name>height</property_name>
<property_value>2</property_value>
</info>
...
</root>
Shong

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi
It is impossible to define a element name base on the input data, in Talend, a XML tree is defined at the design time, not the run time. It is easy to generate the XML if you consider the following XML tree:
<root>
<info>
<property_name>weight</property_name>
<property_value>100</property_value>
</info>
<info>
<property_name>height</property_name>
<property_value>2</property_value>
</info>
...
</root>
Shong
Anonymous
Not applicable
Author

Thanks for your help, Shong.