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: 
rid_rj
Contributor III
Contributor III

Generate a XML file with Two Loop element and Group Element

Hi,

I have a problem with xml file, i can't put two loops elements with group element.

Have you any idea how do this ?

My output file will be like this :

<?xml version="1.0" encoding="UTF-8"?>

<VendorFeed>

 <MiraklVendors>

  <MiraklVendor>

   <MiraklShopId >1</MiraklShopId>

   <DeliveryModes >

    <DeliveryMode>

     <Code>MP_LIVAHY</Code>

     <Libelle>EDR</Libelle>

<DeliveryMode>

<DeliveryMode>

     <Code>MP_LIVEXP</Code>

     <Libelle>BZE</Libelle>

<DeliveryMode> 

   </DeliveryModes>

   <RelayParcelMerchants>

     <RelayParcelMerchant>

     <Name>RELAIS_COLIS</Name>

     <Key>RC1234</Key>

     </RelayParcelMerchant>

<RelayParcelMerchant>

     <Name>RELAIS_COLIS</Name>

     <Key>RC56787</Key>

     </RelayParcelMerchant>  

    </RelayParcelMerchant>

   </RelayParcelMerchants>

  </MiraklVendor>

<MiraklVendor>

   <MiraklShopId >2</MiraklShopId>

   <DeliveryModes >

    <DeliveryMode>

     <Code>MP_LIVSTD</Code>

     <Libelle>ARE</Libelle>

<DeliveryMode>

<DeliveryMode>

     <Code >MP_LIVEXP</Code>

     <Libelle >BZE</Libelle>

<DeliveryMode> 

   </DeliveryModes>

   <RelayParcelMerchants>

     <RelayParcelMerchant>

     <Name>RELAIS_COLIS</Name>

     <Key>RC1234</Key>

     </RelayParcelMerchant>

<RelayParcelMerchant>

     <Name>RELAIS_COLIS</Name>

     <Key>RC56787</Key>

     </RelayParcelMerchant>  

    </RelayParcelMerchant>

   </RelayParcelMerchants>

  </MiraklVendor>

 </MiraklVendors>

</VendorFeed>

1 Reply
David_Beaty
Specialist
Specialist

Hi,

 

You can’t really create an XML with two loops. The only way I’ve been able to do similar is to construct the main XML with a single loop. Where the second loop is going to go, put a value you can easily replace, say @LOOP@. Then construct the second loop, replace the XML defn at the start of this, then, using tReplace to put the second loop into the main XML.

 

Messy, but it works.

 

Thanks

 

David.