Combine multiple XML documents (as rows) into a single XML document

Six Stars

Combine multiple XML documents (as rows) into a single XML document

I have a job where I've transformed a document with tXMLMap creating a single output, and then split it into rows using tExtractField to extract a node - I then need to filter this, and finally recombine into a single output document.
What I can't find is any talend component that will allow me to take a Document column and add it to an XML document as a node.
tWriteXMLField and tXMLMap treat nodes as strings, so that's no use.
There must be a way of doing this surely!
Community Manager

Re: Combine multiple XML documents (as rows) into a single XML document

On tXMLMap, the output is a Document node, and Document node can be generated directly as a XML file with tFileOutputXML component.
why you say it treat nodes as strings? If I don't understand you well, can you please explain it more?
Thank you!
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Six Stars

Re: Combine multiple XML documents (as rows) into a single XML document

What I've got is a document with lots of levels, but is is basically like this:
<Container>
<Content>...</Content>
<Content>...</Content>
...
<Content>...</Content>
</Container>

What I want to do is filter the <Content> element that have been created based on their sub-elements.
So I use tExtractXMLField to break the document into individual document objects for each <Content> element, and filter them using tFilterRow. That works fine.
Now I want to put them back together again. The problem seems to be there isn't an equivalent of the "extract node" flag in the tWriteXMLField - it only operates on strings, so if you write a Document type, it extracts the string value and applies that rather than inserting the document as a node.
I've managed to cludge it together using a tJavaFlex in an inappropriate way that breaks the "rules" of talend and isn't exactly supportable.
Community Manager

Re: Combine multiple XML documents (as rows) into a single XML document

What I've got is a document with lots of levels, but is is basically like this:
<Container>
<Content>...</Content>
<Content>...</Content>
...
<Content>...</Content>
</Container>

What I want to do is filter the <Content> element that have been created based on their sub-elements.
So I use tExtractXMLField to break the document into individual document objects for each <Content> element, and filter them using tFilterRow. That works fine.

If the incoming row is a document node, you can use tXMLMap and filter the rows directly on it, instead of extracting the rows and filter them using tFilterRow, the output is still a document node. see my screenshot.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

Re: Combine multiple XML documents (as rows) into a single XML document

. I am beginner in Talend  I want tutorial
Moderator

Re: Combine multiple XML documents (as rows) into a single XML document

Hi amolkhandekar92,
Please take a look at this component reference TalendHelpCenter:tXMLMap with related scenarios.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.