tXMLMap multiple loops in TOS 5.1.1 don't work!

Hi ,
Here is my job that takes one XML file as the main input and one xml file as a lookup. The structure of the output xml file should be the same as the main input XML. I am only getting one field from the lookup xml.
The structure of the main XML input/output is in a way that needs 2 loops for each product. I installed the TOS 5.1.1 with this hope that I can resolve multiple loop elements but it seems that assigning the loop to multiple elements still don't work!! Or am I missing any point here?
Also, as you see in the tXMLFileOutputXML under Linker source there is no way to add linker from the MMN_Catalogue which is of type document to the link target.
The tag <UploadProductRequest> </UploadProductRequest> holds all the details of one parent product under which the tag <variantValueRow> </variantValueRow> holds the details of child products (different sizes/colours). So both tags needs to be set as loop elements.
So in summary, there are 2 issues:
1. tXMLMap of TOS 5.1.1 still doesn't allow multiple loop elements
2. The fields under MMN_Catalague document are not shown in the tAdvanceFileOutputXML so I can link them to the output structure.

Please advice.
Many thanks
Pouya
5 REPLIES
Community Manager

Re: tXMLMap multiple loops in TOS 5.1.1 don't work!

Hi
You are using tXMLMap, and tXMLMap supports multiple loop element, so you should define the XML tree on tXMLMap, not tAdvancedOutputXML, tAdvancedOutputXML don't support multiple loop elements. on tXMLMap, add a new column with Document type, and then define the xml tree. see pic1.
To generate the result as a XML file, link it to a tFileOutputXML and check the 'incoming record is a document' box.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

Re: tXMLMap multiple loops in TOS 5.1.1 don't work!

Hi
You are using tXMLMap, and tXMLMap supports multiple loop element, so you should define the XML tree on tXMLMap, not tAdvancedOutputXML, tAdvancedOutputXML don't support multiple loop elements. on tXMLMap, add a new column with Document type, and then define the xml tree. see pic1.
To generate the result as a XML file, link it to a tFileOutputXML and check the 'incoming record is a document' box.
Best regards
Shong

Thanks for your hints Josh. I was using the Document Type in the tXMlMap as it's shown in my third pic above. But as you suggested I have replaced the tAdvancedOutputXML with tFileoutputXML.
I can now assign multiple loops but it seems that not all elements in the tXMLMap can be assigned as a loop element.Is it the case?
I have specified in the below pic what elements need to be loop element.

Can I email you the job if you can kindly have a look at it?
Thanks
Pouya

Re: tXMLMap multiple loops in TOS 5.1.1 don't work!

The xml structure should be as below:
<mmn_pc_ext_type:UploadProductCatalogRequest> Root tag that includes 1 to many UploadProductRequest tag
<UploadProductRequest> need to be a loop element
<productIndexDetails>
<tapCode></tapCode>
<retailerCode></retailerCode>
<retailerProductCode></retailerProductCode>
</productIndexDetails>
<productActivationDetails>
<activeFlag>true</activeFlag>
<startDate>2012-07-04</startDate>
<endDate>2999-12-29</endDate>
</productActivationDetails>
<productPresentationDetails>
<name></name>
<mainImageUrl></mainImageUrl>
<goodsCategory></goodsCategory>
<priceLabel>from </priceLabel>
<longProductDescription>
<text></text>
</longProductDescription>
</productPresentationDetails>
<productPurchaseDetails>
<riskGrade></riskGrade>
</productPurchaseDetails>
<productVariantDetails>
<variantKey> need to be a loop element
<key>COLOUR</key>
<value>COLOUR</value>
</variantKey>
<variantValueRow> need to be a loop element - each variantValueRow tag is for one child product
<retailerSkuCode></retailerSkuCode>
<variantStockDetails>
<maxOrderQuantity></maxOrderQuantity>
</variantStockDetails>
<itemPrice></itemPrice>
<vat></vat>
<deliveryOption>
<deliveryPrice></deliveryPrice>
<totalPrice></totalPrice>
<description></description>
<deliveryVAT></deliveryVAT>
<key></key>
</deliveryOption>
<variantValueColumn> need to be a loop element
<key>COLOUR</key>
<value>Cream</value>
</variantValueColumn>
</variantValueRow>
<variantValueRow>
<retailerSkuCode>DIS582-1</retailerSkuCode>
<variantStockDetails>
<maxOrderQuantity>10</maxOrderQuantity>
</variantStockDetails>
<itemPrice>14.99</itemPrice>
<vat>2.50</vat>
<deliveryOption>
<deliveryPrice>0.00</deliveryPrice>
<totalPrice>14.99</totalPrice>
<description>1-5 Working Days</description>
<deliveryVAT>0.00</deliveryVAT>
<key>ANS</key>
</deliveryOption>
<variantValueColumn>
<key>COLOUR</key>
<value>Red</value>
</variantValueColumn>
</variantValueRow>
</productVariantDetails>
</UploadProductRequest>
</mmn_pc_ext_type:UploadProductCatalogRequest>
But the output only includes one child product (variantValuerow tag)!
Thanks
Pouya
Community Manager

Re: tXMLMap multiple loops in TOS 5.1.1 don't work!

Hi
The loop elements should in the same level, however, it is a inheritance relationship in your case, the variantValueColumn element should be defined as a loop element, variantValueRow and UploadProductRequest element as group element. The screenshot shows a simple XML tree structure contains group element.
----------------------------------------------------------
Talend | Data Agility for Modern Business

Re: tXMLMap multiple loops in TOS 5.1.1 don't work!

Thanks Shong. I set this post as resolved now.