Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem converting XML with multiple loop

Hello,
I have problems with converting one XML to another with difference structure.
If you know LCI data format, im converting difference data format (from Ecospold to ILCD) which is the two of them using XML as data format.
here what is look like in simple way:
from this:
<processDataSet xmlns=" http://lca.jrc.it/ILCD/Process" xmlns:common=" http://lca.jrc.it/ILCD/Common" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" metaDataOnly="false" locations="../ILCDLocations.xml" version="1.1" xsi:schemaLocation=" http://lca.jrc.it/ILCD/Process ../../schemas/ILCD_ProcessDataSet.xsd">
<processInformation>
<dataSetInformation> <common:UUID>9ca9d601-15b7-45c3-84ad-e46f9a165809</common:UUID> <nam

To see the whole post, download it here
Labels (4)
14 Replies
Anonymous
Not applicable
Author

Hi,
Another approach is to use a set of tAdvancedFileOutputXML components in append mode. Take a look at the "Multiple Loops" section of this post.
You may also find it easier to integrate the source data into an RDBMS (including ones like MS Access) and write a denormalized query that will be the basis for your XML generation.
http://bekwam.blogspot.com/2011/09/xml-output-from-multiple-data-sources.html
Anonymous
Not applicable
Author

Hi,
Another approach is to use a set of tAdvancedFileOutputXML components in append mode. Take a look at the "Multiple Loops" section of this post.
You may also find it easier to integrate the source data into an RDBMS (including ones like MS Access) and write a denormalized query that will be the basis for your XML generation.
http://bekwam.blogspot.com/2011/09/xml-output-from-multiple-data-sources.html

hi, thanks for responding to my problem
i look at your blog and i dont quite understand how append mode works. is it we must put relationship between difference loop or we can simply add row with difference row after we finish previous subjob?
in my case i tried to loop the element that need loop one after another, and it didnt work
the error was like this:
org.dom4j.DocumentException: Error on line 3 of document file:///I:/SGU%20Material/Semester%208/Thesis/ETL%20Tool/LCI%20Data/appendxmltest.xml : The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "ecoSpold" is not bound. Nested exception: The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "ecoSpold" is not bound.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.io.SAXReader.read(SAXReader.java:264)
at lcidataconverterprototype.appendxml_0_1.AppendXML.tFileInputXML_2Process(AppendXML.java:2312)
at lcidataconverterprototype.appendxml_0_1.AppendXML.tFileInputXML_1Process(AppendXML.java:1797)
at lcidataconverterprototype.appendxml_0_1.AppendXML.runJobInTOS(AppendXML.java:3833)
at lcidataconverterprototype.appendxml_0_1.AppendXML.main(AppendXML.java:3701)
Nested exception:
org.xml.sax.SAXParseException: The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "ecoSpold" is not bound.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.dom4j.io.SAXReader.read(SAXReader.java:264)
at lcidataconverterprototype.appendxml_0_1.AppendXML.tFileInputXML_2Process(AppendXML.java:2312)
at lcidataconverterprototype.appendxml_0_1.AppendXML.tFileInputXML_1Process(AppendXML.java:1797)
at lcidataconverterprototype.appendxml_0_1.AppendXML.runJobInTOS(AppendXML.java:3833)
at lcidataconverterprototype.appendxml_0_1.AppendXML.main(AppendXML.java:3701)
Nested exception: org.xml.sax.SAXParseException: The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "ecoSpold" is not bound.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.dom4j.io.SAXReader.read(SAXReader.java:264)
at lcidataconverterprototype.appendxml_0_1.AppendXML.tFileInputXML_2Process(AppendXML.java:2312)
at lcidataconverterprototype.appendxml_0_1.AppendXML.tFileInputXML_1Process(AppendXML.java:1797)
at lcidataconverterprototype.appendxml_0_1.AppendXML.runJobInTOS(AppendXML.java:3833)
at lcidataconverterprototype.appendxml_0_1.AppendXML.main(AppendXML.java:3701)
Exception in component tAdvancedFileOutputXML_2
java.lang.Exception: can not find the file:I:/SGU Material/Semester 8/Thesis/ETL Tool/LCI Data/appendxmltest.xml
at lcidataconverterprototype.appendxml_0_1.AppendXML.tFileInputXML_2Process(AppendXML.java:2318)
at lcidataconverterprototype.appendxml_0_1.AppendXML.tFileInputXML_1Process(AppendXML.java:1797)
at lcidataconverterprototype.appendxml_0_1.AppendXML.runJobInTOS(AppendXML.java:3833)
at lcidataconverterprototype.appendxml_0_1.AppendXML.main(AppendXML.java:3701)
i dont quite understand because im new on talend 0683p000009MACn.png
Anonymous
Not applicable
Author

Hi Rocknrolla
I encounter an interesting thing that when I create this job by using tFileOutputMSXML, it works fine this time. The attributes with null values don't disappear this time.
Could you tell me the steps to reproduce this issue you mentioned at Comment #1?
Regards,
Pedro
Anonymous
Not applicable
Author

Hi Rocknrolla
I encounter an interesting thing that when I create this job by using tFileOutputMSXML, it works fine this time. The attributes with null values don't disappear this time.
Could you tell me the steps to reproduce this issue you mentioned at Comment #1?
Regards,
Pedro

Sure,
1. i divide the xml file by creating 4 different inputXML (in this step i convert AUSLCI_Elec_Beta0_9BCPowerQLD.XML to 9ca9d601-15b7-45c3-84ad-e46f9a165809_01.00.000.xml) each inputXML serve for 4 different element which are, processinformation, modelling and validation, administrativeinformation and exchange)
2. then, i assign each input XML into tMapComponent which i mapped every metadata to another (some with modification
3. last, i assign all of this into tFileOutputMSXML
4. in tFileOutputMSXML, i import XML tree from 9ca9d601-15b7-45c3-84ad-e46f9a165809_01.00.000.xml, all for four of them (tFileOutputMSXML ask for four XML tree). but, i only using the element that the XML assign for, means i assign the previous mapped input for exchange into imported XML tree with only exchange element and deleted the rest. i only keep several attribute outside that four elements
ps: in the advance setting i check the option for create directory if not exists, create empty element if needed, trim the whitespace charactes and escape test
Anonymous
Not applicable
Author

hello pedro,
have you found the problem yet?