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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rajanbhat67
Contributor II
Contributor II

How to remove a specific XML tag when i am not using xpath input

i have a requirement where i am supposed to remove particular xml tag when it has a blank value. But the issue is that the source is a flat file and i am using tFileInputDelimited as the source (then tmap for transformation) and then tAdvancedXMLOutput for generating the xml.

i couldnt find the option to remove that specific tag anywhere.

If i try removing it, it removes the whole tag from the the xml even when it doesnt have a blank value.

any suggestions on how to do it?

Labels (8)
3 Replies
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Rajan Bhat​ 

 

I would try using tXMLMap instead of tMap.

 

On its output schema, create one column of Document type and map your XML tree in there.

 

To remove the empty elements, in the mapping window, on the output you created there will be a wrench icon. Click on it and there will be an option "Create empty element". Set it to false and connect tXMLMap output to a tFileOutputRaw component (you can use a tConvertType in the middle to avoid schema incompatibility).

rajanbhat67
Contributor II
Contributor II
Author

Hi @Anselmo Peixoto​ ,

i did as you have mentioned. Though tFileOutputRaw wasnt giving the desired result in form of xml tags so i used tFileOutputXML but still the same issue. I am still getting that tag with blank value in the file

anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Rajan Bhat​ 

 

Did you disable the "create empty element" option on tXMLMap?

Try putting a tLogRow on tXMLMap output just to verify if this option is working as expected. If not, try mapping a null value to an element to see if it works.