Multiple Loop XML

One Star

Multiple Loop XML

Hi,
I have a problem when executing the ?tfileoutputmsxml?.
I am trying to fix elements on the xml tree, after the loop element. But when I come back on the xml tree (tfileoutputmsxml) elements have changed place.
When I execute the result is not the one expected. Is there a solution to have this output?
Expected OUTPUT:
<rootTag>
<transaction id="1300400000011">
<retailTransaction>
<lineItem article="1">
<retail discount="20.00"/>
</lineItem>
<lineItem article="2">
<retail discount="30.00"/>
</lineItem>
<lineItem paiement="34224.0"/>
<lineItem paiement="34225.0"/>
<afterLoop1></afterLoop1>
<afterLoop2></afterLoop2>
</retailTransaction>
Regards
Yoann
</transaction>
<transaction id="1300400000012">
<retailTransaction>
<lineItem article="3">
<retail discount="50.00"/>
<retail discount="10.00"/>
</lineItem>
<lineItem paiement="34226.0"/>
<lineItem paiement="34227.0"/>
<lineItem paiement="34228.0"/>
<afterLoop1></afterLoop1>
<afterLoop2></afterLoop2>
</retailTransaction>
</transaction>
</rootTag>
One Star

Re: Multiple Loop XML

Hi Yoann
There can be only one loop element in xml component. But you can set group element.
I guess you didn't set the component correctly.
Regards,
Pedro
One Star

Re: Multiple Loop XML

Hi pedro,
In the tFileOutputMSXML, it's possible to configure multiple loop element.
The problem is i don't have what i want in output...
Regards,
Yoann
One Star

Re: Multiple Loop XML

Hi Yoann
Sorry... I regards tAdvancedOutputXML as tFileOutputMSXML...
Regards,
Pedro
One Star

Re: Multiple Loop XML

Yes the main problem is not multiple loop, but i cannot put my element AfterLoop1 and AfterLoop2 where i want. They always appear in the begining of the loop instead of the end..
If anyone got a solution...
Regards,
Yoann
One Star

Re: Multiple Loop XML

The only way I've found to reposition them is by editing the jobname.item file and moving them in that. Not elegant but gets you there
One Star

Re: Multiple Loop XML

Hi janhess
I have this part of code in my jobname.item :
<node componentName="tFileOutputMSXML" componentVersion="0.102" offsetLabelX="0" offsetLabelY="0" posX="736" posY="448">
<elementParameter field="TEXT" name="UNIQUE_NAME" value="tFileOutputMSXML_1"/>
<elementParameter field="FILE" name="FILENAME" value=""C:/Talend/test/outXML.xml""/>
<elementParameter field="TABLE" name="ROOT">
<elementValue elementRef="PATH" value="/rootTag"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
</elementParameter>
<elementParameter field="TABLE" name="GROUP">
<elementValue elementRef="PATH" value="/rootTag/transaction"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="id"/>
<elementValue elementRef="COLUMN" value="output1Smiley SurprisedrderId"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="3"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="paiement"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="10"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop1"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop2"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="id"/>
<elementValue elementRef="COLUMN" value="output3Smiley SurprisedrderId"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="3"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="article"/>
<elementValue elementRef="COLUMN" value="output3:entryNumber"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="6"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="paiement"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="10"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/aftetLoop1"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop2"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="id"/>
<elementValue elementRef="COLUMN" value="output2Smiley SurprisedrderId"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="3"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="article"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="6"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem/retail"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="discount"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="8"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop1"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop2"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
</elementParameter>
<elementParameter field="TABLE" name="LOOP">
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="article"/>
<elementValue elementRef="COLUMN" value="output1:entryNumber"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="6"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem/retail"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="discount"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="8"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem/retail"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="discount"/>
<elementValue elementRef="COLUMN" value="output3:amount"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="8"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="paiement"/>
<elementValue elementRef="COLUMN" value="output2:id"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="10"/>
</elementParameter>
<elementParameter field="EXTERNAL" name="MAP" value=""/>
<elementParameter field="CHECK" name="CREATE" value="true"/>
<elementParameter field="CHECK" name="CREATE_EMPTY_ELEMENT" value="false"/>
<elementParameter field="CHECK" name="ADVANCED_SEPARATOR" value="false"/>
<elementParameter field="TEXT" name="THOUSANDS_SEPARATOR" value="",""/>
<elementParameter field="TEXT" name="DECIMAL_SEPARATOR" value="".""/>
<elementParameter field="ENCODING_TYPE" name="ENCODING" value=""UTF-8""/>
<elementParameter field="TECHNICAL" name="ENCODING:ENCODING_TYPE" value="UTF-8"/>
<elementParameter field="CHECK" name="DELETE_EMPTYFILE" value="false"/>
<elementParameter field="TEXT" name="LABEL" value="outputMS_XML"/>
<elementParameter field="TEXT" name="CONNECTION_FORMAT" value="row"/>
<elementParameter field="CHECK" name="INFORMATION" value="false"/>
<elementParameter field="MEMO" name="COMMENT" value=""/>
<elementParameter field="CHECK" name="VALIDATION_RULES" value="false"/>
<metadata connector="FLOW" label="output1" name="tFileOutputMSXML_1">
<column comment="" key="false" length="0" name="orderId" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_BigDecimal"/>
<column comment="" key="false" length="0" name="entryNumber" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_BigDecimal"/>
</metadata>
</node>
What do i have to change to make AfterLoop1 and Afterloop1 appear in <RetailTransaction> and after <LineItem>
Regards
Yozol
One Star

Re: Multiple Loop XML

Not quite sure where you want then. Can you give an xml example.
One Star

Re: Multiple Loop XML

That s what i want. The only problem is the position of AfterLoop1 and AfterLoop2
One Star

Re: Multiple Loop XML

What are you actually getting?
One Star

Re: Multiple Loop XML

I think the problem may be round the tag lineItem which has different attributes for the 2 loops. I suspect when it is doing the matching to set up the loops, it matches on tag not tag and attribute.
You may need to raise a bug.
One Star

Re: Multiple Loop XML

With this :
<node componentName="tFileOutputMSXML" componentVersion="0.102" offsetLabelX="0" offsetLabelY="0" posX="736" posY="448">
<elementParameter field="TEXT" name="UNIQUE_NAME" value="tFileOutputMSXML_1"/>
<elementParameter field="FILE" name="FILENAME" value=""C:/Talend/test/outXML.xml""/>
<elementParameter field="TABLE" name="ROOT">
<elementValue elementRef="PATH" value="/rootTag"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
</elementParameter>
<elementParameter field="TABLE" name="GROUP">
<elementValue elementRef="PATH" value="/rootTag/transaction"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="id"/>
<elementValue elementRef="COLUMN" value="output1Smiley SurprisedrderId"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="3"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="paiement"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="10"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop1"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop2"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="id"/>
<elementValue elementRef="COLUMN" value="output3Smiley SurprisedrderId"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="3"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="article"/>
<elementValue elementRef="COLUMN" value="output3:entryNumber"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="6"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="paiement"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="10"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/aftetLoop1"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop2"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="id"/>
<elementValue elementRef="COLUMN" value="output2Smiley SurprisedrderId"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="3"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="article"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="6"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem/retail"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="discount"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="8"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop1"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop2"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value="test"/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
</elementParameter>
<elementParameter field="TABLE" name="LOOP">
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="article"/>
<elementValue elementRef="COLUMN" value="output1:entryNumber"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="6"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem/retail"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="discount"/>
<elementValue elementRef="COLUMN" value="output1"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="8"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem/retail"/>
<elementValue elementRef="COLUMN" value="output3"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="discount"/>
<elementValue elementRef="COLUMN" value="output3:amount"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="8"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value="output2"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value=""/>
<elementValue elementRef="PATH" value="paiement"/>
<elementValue elementRef="COLUMN" value="output2:id"/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="10"/>
</elementParameter>
<elementParameter field="EXTERNAL" name="MAP" value=""/>
<elementParameter field="CHECK" name="CREATE" value="true"/>
<elementParameter field="CHECK" name="CREATE_EMPTY_ELEMENT" value="false"/>
<elementParameter field="CHECK" name="ADVANCED_SEPARATOR" value="false"/>
<elementParameter field="TEXT" name="THOUSANDS_SEPARATOR" value="",""/>
<elementParameter field="TEXT" name="DECIMAL_SEPARATOR" value="".""/>
<elementParameter field="ENCODING_TYPE" name="ENCODING" value=""UTF-8""/>
<elementParameter field="TECHNICAL" name="ENCODING:ENCODING_TYPE" value="UTF-8"/>
<elementParameter field="CHECK" name="DELETE_EMPTYFILE" value="false"/>
<elementParameter field="TEXT" name="LABEL" value="outputMS_XML"/>
<elementParameter field="TEXT" name="CONNECTION_FORMAT" value="row"/>
<elementParameter field="CHECK" name="INFORMATION" value="false"/>
<elementParameter field="MEMO" name="COMMENT" value=""/>
<elementParameter field="CHECK" name="VALIDATION_RULES" value="false"/>
<metadata connector="FLOW" label="output1" name="tFileOutputMSXML_1">
<column comment="" key="false" length="0" name="orderId" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_BigDecimal"/>
<column comment="" key="false" length="0" name="entryNumber" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_BigDecimal"/>
</metadata>
</node>
<node componentName="tFileInputDelimited" componentVersion="0.102" offsetLabelX="14" offsetLabelY="10" posX="128" posY="448">
<elementParameter field="TEXT" name="UNIQUE_NAME" value="tFileInputDelimited_1"/>
<elementParameter field="LABEL" name="FILENAMETEXT" value=""When the input source is a stream or a zip file,footer and random shouldn't be bigger than 0.""/>
<elementParameter field="FILE" name="FILENAME" value=""D:/talend/test/xRetailOrders_31122011-201103.csv""/>
<elementParameter field="TEXT" name="ROWSEPARATOR" value=""\n""/>
<elementParameter field="OPENED_LIST" name="CSVROWSEPARATOR" value=""\n""/>
<elementParameter field="TEXT" name="FIELDSEPARATOR" value="";""/>
<elementParameter field="CHECK" name="CSV_OPTION" value="true"/>
<elementParameter field="TEXT" name="ESCAPE_CHAR" value=""\"""/>
<elementParameter field="TEXT" name="TEXT_ENCLOSURE" value=""\"""/>
<elementParameter field="TEXT" name="HEADER" value="context.HEADER"/>
<elementParameter field="TEXT" name="FOOTER" value="0"/>
<elementParameter field="TEXT" name="LIMIT" value="10"/>
<elementParameter field="CHECK" name="REMOVE_EMPTY_ROW" value="true"/>
<elementParameter field="CHECK" name="UNCOMPRESS" value="false"/>
<elementParameter field="CHECK" name="DIE_ON_ERROR" value="false"/>
<elementParameter field="TECHNICAL" name="SCHEMA_REJECTSmiley FrustratedCHEMA_TYPE" value="REPOSITORY"/>
<elementParameter field="TECHNICAL" name="SCHEMA_REJECT:REPOSITORY_SCHEMA_TYPE" value="_9iET4Ey1EeGlidcLP4eq4A - xRetailOrders"/>
<elementParameter field="DIRECTORY" name="TEMP_DIR" value=""C:/Talend/TOS_DI-Win32-r74687-V5.0.1/workspace""/>
<elementParameter field="CHECK" name="ADVANCED_SEPARATOR" value="false"/>
<elementParameter field="TEXT" name="THOUSANDS_SEPARATOR" value="",""/>
<elementParameter field="TEXT" name="DECIMAL_SEPARATOR" value="".""/>
<elementParameter field="CHECK" name="RANDOM" value="false"/>
<elementParameter field="TEXT" name="NB_RANDOM" value="10"/>
<elementParameter field="CHECK" name="TRIMALL" value="true"/>
<elementParameter field="TABLE" name="TRIMSELECT">
<elementValue elementRef="SCHEMA_COLUMN" value="orderId"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="orderType"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="storeId"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="paymentCost"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="deliveryCost"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="totalPrice"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="customerNumber"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="postalCode"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="loyalityCardType"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="loyalityCardNumber"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="orderCreationDate"/>
<elementValue elementRef="TRIM" value="false"/>
<elementValue elementRef="SCHEMA_COLUMN" value="returnRequestDate"/>
<elementValue elementRef="TRIM" value="false"/>
</elementParameter>
<elementParameter field="CHECK" name="CHECK_FIELDS_NUM" value="true"/>
<elementParameter field="CHECK" name="CHECK_DATE" value="false"/>
<elementParameter field="ENCODING_TYPE" name="ENCODING" value=""ISO-8859-15""/>
<elementParameter field="TECHNICAL" name="ENCODING:ENCODING_TYPE" value="ISO-8859-15"/>
<elementParameter field="CHECK" name="SPLITRECORD" value="false"/>
<elementParameter field="TEXT" name="DESTINATION" value=""/>
<elementParameter field="TEXT" name="LABEL" value="xRetailOrders"/>
<elementParameter field="TEXT" name="CONNECTION_FORMAT" value="row"/>
<elementParameter field="CHECK" name="INFORMATION" value="false"/>
<elementParameter field="MEMO" name="COMMENT" value=""/>
<elementParameter field="CHECK" name="VALIDATION_RULES" value="false"/>
<metadata connector="FLOW" label="xRetailOrders" name="tFileInputDelimited_1">
<column comment="" key="false" length="0" name="orderId" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_BigDecimal"/>
<column comment="" key="false" length="0" name="orderType" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" key="false" length="0" name="storeId" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_Double"/>
<column comment="" key="false" length="0" name="paymentCost" nullable="false" pattern=""dd-MM-yyyy"" precision="2" type="id_BigDecimal"/>
<column comment="" key="false" length="0" name="deliveryCost" nullable="false" pattern=""dd-MM-yyyy"" precision="2" type="id_BigDecimal"/>
<column comment="" key="false" length="0" name="totalPrice" nullable="false" pattern=""dd-MM-yyyy"" precision="2" type="id_BigDecimal"/>
<column comment="" key="false" length="0" name="customerNumber" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" key="false" length="0" name="postalCode" nullable="true" pattern=""dd-MM-yyyy"" precision="0" type="id_BigDecimal"/>
<column comment="" key="false" length="0" name="loyalityCardType" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" key="false" length="0" name="loyalityCardNumber" nullable="true" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" key="false" length="0" name="orderCreationDate" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" key="false" length="0" name="returnRequestDate" nullable="true" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
</metadata>
<metadata connector="REJECT" label="xRetailOrders" name="REJECT">
<column comment="" key="false" length="0" name="orderId" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_Double"/>
<column comment="" key="false" length="0" name="orderType" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" key="false" length="0" name="storeId" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_Double"/>
<column comment="" key="false" length="0" name="paymentCost" nullable="false" pattern=""dd-MM-yyyy"" precision="2" type="id_Double"/>
<column comment="" key="false" length="0" name="deliveryCost" nullable="false" pattern=""dd-MM-yyyy"" precision="2" type="id_Double"/>
<column comment="" key="false" length="0" name="totalPrice" nullable="false" pattern=""dd-MM-yyyy"" precision="2" type="id_Double"/>
<column comment="" key="false" length="0" name="customerNumber" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" key="false" length="0" name="postalCode" nullable="true" pattern=""dd-MM-yyyy"" precision="0" type="id_Double"/>
<column comment="" key="false" length="0" name="loyalityCardType" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" key="false" length="0" name="loyalityCardNumber" nullable="true" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" key="false" length="0" name="orderCreationDate" nullable="false" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column comment="" defaultValue="" key="false" length="0" name="returnRequestDate" nullable="true" pattern=""dd-MM-yyyy"" precision="0" type="id_String"/>
<column defaultValue="" key="false" length="255" name="errorCode" nullable="true" precision="0" sourceType="" type="id_String"/>
<column defaultValue="" key="false" length="255" name="errorMessage" nullable="true" precision="0" sourceType="" type="id_String"/>
</metadata>
</node>
I got this XML :
<?xml version="1.0" encoding="UTF-8"?>
<rootTag>
<transaction id="1300400000011">
<retailTransaction>
<afterLoop1>test</afterLoop1>
<afterLoop2>test</afterLoop2>
<lineItem article="1"/>
<lineItem article="2"/>
<lineItem paiement="34224.0"/>
<lineItem paiement="34225.0"/>
</retailTransaction>
<retailTransaction>
<aftetLoop1>test</aftetLoop1>
<afterLoop2>test</afterLoop2>
<lineItem article="1">
<retail discount="20.00"/>
</lineItem>
<lineItem article="2">
<retail discount="30.00"/>
</lineItem>
</retailTransaction>
</transaction>
<transaction id="1300400000012">
<retailTransaction>
<afterLoop1>test</afterLoop1>
<afterLoop2>test</afterLoop2>
<lineItem article="3"/>
<lineItem paiement="34226.0"/>
<lineItem paiement="34227.0"/>
<lineItem paiement="34228.0"/>
</retailTransaction>
<retailTransaction>
<aftetLoop1>test</aftetLoop1>
<afterLoop2>test</afterLoop2>
<lineItem article="3">
<retail discount="50.00"/>
<retail discount="10.00"/>
</lineItem>
</retailTransaction>
</transaction>
</rootTag>
One Star

Re: Multiple Loop XML

I tried setting up your first loop which gave the following in the .item file for vn 4.0.2
<node componentName="tAdvancedFileOutputXML" componentVersion="0.102" offsetLabelX="0" offsetLabelY="0" posX="1024" posY="352">
<elementParameter field="TEXT" name="UNIQUE_NAME" value="tAdvancedFileOutputXML_1"/>
<elementParameter field="CHECK" name="USESTREAM" value="false"/>
<elementParameter field="TEXT" name="STREAMNAME" value="outputStream"/>
<elementParameter field="FILE" name="FILENAME" value=""C:/TIS_PE_RTX-All-r43696-V4.0.2/workspace/out.xml""/>
<elementParameter field="TABLE" name="ROOT">
<elementValue elementRef="PATH" value="/rootTag"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value="1"/>
</elementParameter>
<elementParameter field="TABLE" name="GROUP">
<elementValue elementRef="PATH" value="/rootTag/transaction"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value="2"/>
<elementValue elementRef="PATH" value="id"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="3"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value="4"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop1"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value="10"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/afterLoop2"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value="11"/>
</elementParameter>
<elementParameter field="TABLE" name="LOOP">
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="main"/>
<elementValue elementRef="ORDER" value="5"/>
<elementValue elementRef="PATH" value="article"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="6"/>
<elementValue elementRef="PATH" value="paiement"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="7"/>
<elementValue elementRef="PATH" value="/rootTag/transaction/retailTransaction/lineItem/retail"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="branch"/>
<elementValue elementRef="ORDER" value="8"/>
<elementValue elementRef="PATH" value="discount"/>
<elementValue elementRef="COLUMN" value=""/>
<elementValue elementRef="VALUE" value=""/>
<elementValue elementRef="ATTRIBUTE" value="attri"/>
<elementValue elementRef="ORDER" value="9"/>
</elementParameter>

This has all the correct values in the elementRef="ORDER" so Afterloop1 & 2 have higher values than itemLine.
You could try setting the order values in your .item and see if it then produces the correct results.
One Star

Re: Multiple Loop XML

No it doesn't change anything ... Smiley Sad
One Star

Re: Multiple Loop XML

Which version are you using?
One Star

Re: Multiple Loop XML

5.0.1
But i did something to correct this stuff, a little code using JDOM to change position of XML node. Not really clean but it works Smiley Happy
Thanks
One Star

Re: Multiple Loop XML

I have the same problem and have raised it with support. It seems sometimes the element order is lost on tOutputMSXML. I'm fixing mine with an XSLT transformation.