Anonymous
Not applicable
2008-08-01
12:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to generate hierarchical xml file (with many loops) ?
I understand that it's not possible to generate an XML file with more than one loop.
so, what's the solution to generate a pretty simple XML file like this one ??? :
(reflecting a relationnal model : client --> command --> product --> item)
<clients>
<client>
<id>1</id>
<commands>
<command>
<date>31/07/2008<date>
<products>
<product>
<id>100</id>
<quantity>1</quantity>
<items>
<item>
<serialNumber>87964543213213</serialNumber>
</item>
</items>
<unitPrice>222.50</unitPrice>
<product>
<product>
<id>105</id>
<quantity>2</quantity>
<items>
<item>
<serialNumber>546546542154987</serialNumber>
</item>
<item>
<serialNumber>546546543137766</serialNumber>
</item>
</items>
<unitPrice>74.99</unitPrice>
<product>
</products>
</command>
<commands>
<command>
<date>28/07/2008<date>
<products>
<product>
<id>108</id>
<quantity>1</quantity>
<unitPrice>55.00</unitPrice>
<items>
<item>
<serialNumber>11145874587</serialNumber>
</item>
</items>
<product>
</products>
</command>
</commands>
<client>
<client>...
</client>
</client>
so, what's the solution to generate a pretty simple XML file like this one ??? :
(reflecting a relationnal model : client --> command --> product --> item)
<clients>
<client>
<id>1</id>
<commands>
<command>
<date>31/07/2008<date>
<products>
<product>
<id>100</id>
<quantity>1</quantity>
<items>
<item>
<serialNumber>87964543213213</serialNumber>
</item>
</items>
<unitPrice>222.50</unitPrice>
<product>
<product>
<id>105</id>
<quantity>2</quantity>
<items>
<item>
<serialNumber>546546542154987</serialNumber>
</item>
<item>
<serialNumber>546546543137766</serialNumber>
</item>
</items>
<unitPrice>74.99</unitPrice>
<product>
</products>
</command>
<commands>
<command>
<date>28/07/2008<date>
<products>
<product>
<id>108</id>
<quantity>1</quantity>
<unitPrice>55.00</unitPrice>
<items>
<item>
<serialNumber>11145874587</serialNumber>
</item>
</items>
<product>
</products>
</command>
</commands>
<client>
<client>...
</client>
</client>
407 Views
Anonymous
Not applicable
2008-08-01
04:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used the tAdvancesFileOutputXML and imported your XML (had to fix some errors in the XML first). Set the looping on item and grouping on command. Then i could easily map the data. See screenshot.
407 Views
Anonymous
Not applicable
2008-08-03
08:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok, thanks a lot for your answer !
i understand that, -generally speaking- i always have to put the "loop" status on the deepest repeatable element in my structure and then put the "group" status on all the others repeatable ones.
maybe one improvment of the XML Output file could be a component able to receive more than one input link, in order to keep the relationnal structure of the inputs (and to avoid the flatenning of the model).
i understand that, -generally speaking- i always have to put the "loop" status on the deepest repeatable element in my structure and then put the "group" status on all the others repeatable ones.
maybe one improvment of the XML Output file could be a component able to receive more than one input link, in order to keep the relationnal structure of the inputs (and to avoid the flatenning of the model).
407 Views
Anonymous
Not applicable
2008-08-04
02:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I've been trawling the forums trying to find a solution, but these topics all seem to cater for XML with only one Group and one repeating (looping) element.
Given that the tAdvancedXMLOutput does not have built-in support for more complex transformation, what is the reccomended solution for transforming a flat file to XML output such as:
<root>
<customer>
...
<items>
<item>1</item>
<item>2</item>
</items>
<otherthings>
<thing>1</thing>
<thing>2</thing>
</otherthings>
</customer>
<customer>
...
<items>
<item>3</item>
<item>4</item>
<item>5</item>
</items>
<otherthings>
<thing>3</thing>
<thing>4</thing>
</otherthings>
</customer>
</root>
Thanks for your help guys!
Given that the tAdvancedXMLOutput does not have built-in support for more complex transformation, what is the reccomended solution for transforming a flat file to XML output such as:
<root>
<customer>
...
<items>
<item>1</item>
<item>2</item>
</items>
<otherthings>
<thing>1</thing>
<thing>2</thing>
</otherthings>
</customer>
<customer>
...
<items>
<item>3</item>
<item>4</item>
<item>5</item>
</items>
<otherthings>
<thing>3</thing>
<thing>4</thing>
</otherthings>
</customer>
</root>
Thanks for your help guys!
407 Views
Anonymous
Not applicable
2008-08-05
05:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
as i undestand it's not possible to have many loops at the same level of the XML structure, like in your example.
It's -today- a strong limitation in talend to produce XML files...
as i undestand it's not possible to have many loops at the same level of the XML structure, like in your example.
It's -today- a strong limitation in talend to produce XML files...
407 Views