Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

bal75
2008-08-05 10:56:29

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...

cmora
2008-08-04 07:44:12

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!

bal75
2008-08-03 13:58:14

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).

robvonk
2008-08-01 21:52:47

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.

bal75
2008-08-01 17:51:02

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>

Board footer

Powered by FluxBB