Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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).
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
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.