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: 
Anonymous
Not applicable

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!
Labels (3)
5 Replies
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

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
0683p000009ME44.png
Anonymous
Not applicable
Author

. I am beginner in Talend  I want tutorial
Anonymous
Not applicable
Author

Hi amolkhandekar92,
Please take a look at this component reference TalendHelpCenter:tXMLMap with related scenarios.
Best regards
Sabrina