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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Add Element In XML(Loop)

The Scenario here is i need to add some data in my xml:

Source:

<?xml version="1.0"?>
<BatchLvl>
<CustId>H2X</CustId>
<PrcId>NBL1</PrcId>
</BatchLvl>
<DocDet>
<Pages>
<Page>
<PageNo>1</PageNo>
<ImgFileName>abc</ImgFileName>
<ImgType>T1</ImgType>
</Page>
<Page>
<PageNo>2</PageNo>
<ImgFileName>abc2</ImgFileName>
<ImgType>T2</ImgType>
</Page>
<Page>
<PageNo>3</PageNo>
<ImgFileName>abc3</ImgFileName>
<ImgType>T1</ImgType>
</Page>
</Pages>
</DocDet>

 

The output Should be like:

 

<?xml version="1.0"?>
<BatchLvl>
<CustId>H2X</CustId>
<PrcId>NBL1</PrcId>
</BatchLvl>
<DocDet>
<Pages>
<Page>
<PageNo>1</PageNo>
<ImgFileName>abc</ImgFileName>
<ImgType>T1</ImgType>
</Page>
<Page>
<PageNo>2</PageNo>
<ImgFileName>abc2</ImgFileName>
<ImgType>T2</ImgType>
</Page>
<Page>
<PageNo>3</PageNo>
<ImgFileName>abc3</ImgFileName>
<ImgType>T1</ImgType>
</Page>
<Page>
<PageNo>4</PageNo>
<ImgFileName>StaticName</ImgFileName>
<ImgType>F</ImgType>
</Page>
</Pages>
</DocDet>

 

Anyone has any suggestion what approach should I follow in talend, I don't  want to use a  full fledged java code on this for now.

Labels (4)
2 Replies
Anonymous
Not applicable
Author

BUMP!

TRF
Champion II
Champion II

Did you try to add the 4th line using a tFixedFlowInput as a lookup for a tXMLMap?