Five Stars

Escape Special Characters - XML

In my tmap, i am concatenating some txmlmap, it appears correctly in the tlog but not in xml file generated : 

 

Expression builder where i am concatenating the xml with type "List":

Capture1.PNG

 

Displaying correctly in tlog :

 

Capture2.PNG

 

Xml file generated : 

 

Capture3.PNG

 

Is there a way to use the escape special characters?

 

Can someone advice or help me out?

 

Thank you.

  • Big Data
Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Eleven Stars

Re: Escape Special Characters - XML

This looks like you are trying to insert XML within an XML structure (possibly within a tMap?). The problem you have here is that the tMap will interpret the String XML you are creating as a String. It is quite rightly escaping the content so that it will not break the XML structure you are inserting it into.

 

What you can do to get round this is to put a value to replace (maybe something like "**REPLACE**") into the XML field where you want to insert the XML you are writing as a String. Once the main XML is built, use a tConvertType component to convert the XML Document to a String. Then use String replace functionality to replace the "**REPLACE**" value with your String XML. The (after removing the XML Header) use a tConvertType component to convert the modified String XML to an XML Document.

 

It is a bit fiddly, but works quite effectively if you want to add XML sections to an existing XML document. 

 

Rilhia Solutions
1 REPLY
Eleven Stars

Re: Escape Special Characters - XML

This looks like you are trying to insert XML within an XML structure (possibly within a tMap?). The problem you have here is that the tMap will interpret the String XML you are creating as a String. It is quite rightly escaping the content so that it will not break the XML structure you are inserting it into.

 

What you can do to get round this is to put a value to replace (maybe something like "**REPLACE**") into the XML field where you want to insert the XML you are writing as a String. Once the main XML is built, use a tConvertType component to convert the XML Document to a String. Then use String replace functionality to replace the "**REPLACE**" value with your String XML. The (after removing the XML Header) use a tConvertType component to convert the modified String XML to an XML Document.

 

It is a bit fiddly, but works quite effectively if you want to add XML sections to an existing XML document. 

 

Rilhia Solutions