Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
NAdams1685481650
Contributor
Contributor

tXMLMAP from Positional File with Generic Schema

Hello,

I am trying to use Talend Open Studio For Data Integration v.8.0.1.20211109 to take a positional file and turn it into an XML file. The positional file has a very simple schema with a Field Code denoting the type of data that follows in the New Value column. I need to take all this data, group it by the account number, and build an XML file. My current job is very simple: tFileInputPositional -> tLogRow -> tXMLMap -> tFileOutputXML but I'm not getting my desired output.

Instead, I am getting an XML file containing a separate XML tree for each line in the positional file. One for Address Line 1, one for Address Line2, one for City, etc.

 

I set the All In One flag on the Target Schema in the tXMLMap before creating the XML tree. Now its set back to False and I'm not able to edit it

 

0695b00000htLAYAA2.png 

0695b00000htLAsAAM.png 

I'm using the tXMLMap as so to identify where the data stored in NewValue needs to go in the XML tree

0695b00000htLBMAA2.png 

This is what I get from the Talend job. The next <consumer> tag has the same consumerAgencyId but without AddressLine1 and instead one of the other values provided.

0695b00000htLCyAAM.png

Labels (3)
3 Replies
Anonymous
Not applicable

Hi

The 'All in one' option can't be used with Aggregate element together. In your case, you set a consumerAgencyId as an aggregate element, then 'All in one' becomes false.

I don't understand the problem you mentioned 'The next <consumer> tag has the same consumerAgencyId but without AddressLine1 and instead one of the other values provided." Can you post the full output from the talend Job? and what are your expected output?

 

Regards

Shong

NAdams1685481650
Contributor
Contributor
Author

I've attached the XML file that the job outputs. The output is identical even after removing the Aggregate element and setting the All In One option to true. My desired output is one <consumer> tag per consumerAgencyId with all of the attributes from the positional file.

 

The issue appears to be that the positional file contains one row per attribute for an consumer. So I need to read multiple rows from the positional file and transform that into a single XML 'row' using the consumerAgencyId as the key. I'm struggling to understand how to use Talend to accomplish that.

 

NAdams1685481650
Contributor
Contributor
Author

Just following up, is this something that Talend is able to accomplish?

 

To reiterate, I want to read data from a file, group the rows that have the same key (consumerAgencyId), read each row to determine which XML element is defined, and then fill out an XML tree using those rows.

 

If Talend Open Studio isn't able to do such work, what version will?