Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
stan1609735726
Contributor
Contributor

XML file generation

Could you please help me with this issue:         

 As per the XML schema, Location, CountryCode, Number and Extension are all mandatory fields when the Phone block is use. But I don't have Extension information is not available. How to make the extension tag to always even when it is blank. like sample below.

 

<Phone>

<Location>home</Location>

<CountryCode>1</CountryCode>

<Number>41633331</Number>

<Extension></Extension>

</Phone>

 

Labels (3)
6 Replies
stan1609735726
Contributor
Contributor
Author

My flow is built in Talend to extract the data and convert to XML. I am using tmap and tAdvancedFileoutputXML. How will I be able to use this tool?

David_Beaty
Creator III
Creator III

Hi

 

On the tAdvancedFileOutputXML properties, Advanced Settings tab, ensure the tick box "Create empty element if needed" is ticked.

 

Thanks

 

David

stan1609735726
Contributor
Contributor
Author

I did try this and it is turning on for all the elements. I only want this <Extension></Extension> to show empty, for the rest I don't want them showing when null

Anonymous
Not applicable

Hi

Try to convert null value of extension column to empty string on tMap before tAdvancedFileOutputXML.

row1.extension==null?"":row1.extension

 

and uncheck the 'Create empty element if needed' box.

 

Regards

Shong

stan1609735726
Contributor
Contributor
Author

Thank you for your help. This is working

stan1609735726
Contributor
Contributor
Author

Thanks you for your help. This is working.