Working with CDATA inside your BusinessWorks Process

One of the most misterious things when you are working with your TIBCO BusinessWorks software is how to handle the CDATA sections inside the XML you are transforming in the BW process.

The CDATA section are special XML sections when you can use unescaped text (like XML tags or similar) as a XML tag value, as you can see here:

function matchwo(a,b)
if (a < b && a < 0) then
  return 1;
  return 0;

If you want to increase your knowledge about this sections, please visit this link: Link

The main problem you could be facing when you are trying to use this kind of section in BW is that the software always try to scape this kind of values and it not check if it is a CDATA section or something special. It always treats the value as a normal string value and it executes the ‘escape process’.

If you have a simple process with only a Mapper activity and a Render XML activity to get an XML value of your XML tree object, you can see the CDATA content is going to be escapen without your ‘permission’ :), as you can see here:


(Process CDATANormalError.process)

2014 Nov 04 22:16:04:868 GMT +0100 BW.CDATA User [BW-User] - Job-2000 [CDATANormalError.process/Log]: <?xml version="1.0" encoding="UTF-8"?>

Ok, If we only want to log a CDATA or persist it inside a file, there is no problem, because you could use the configuration available inside the Render XML activity as you can see here:


After this configuration you get this output in your Designer console:

[CDATAEscapedRenderXML.process/Log]: <?xml version="1.0" encoding="UTF-8"?>
<ns0:root xmlns:ns0="">

You must think: “Ok, it’s a little bit tricky but that’s all. We have reach our goal” but that’s not true, because if we want to use the CDATA section inside an SOAP Request/Reply we’ve facing a more difficult problem.

Because you will be getting something like this:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV=""><SOAP-ENV:Body><ns0:operationRequest xmlns:ns0=""><in xmlns="">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ns0:root xmlns:ns0=""&gt;

This problem is still unsolved for us, so if you have some thoughts or help, please, leave a comment!!!!!


3 thoughts on “Working with CDATA inside your BusinessWorks Process

  1. I’ve found working with cdata in BW to be a challenge for sure. Not sure if this helps, but I had to recently parse data coming in from another application that had a cdata section. Basically the structure was:

    — long cdata string here

    I needed to parse the string in the metadata element using the Parse XML activity, but it was treating the CDATA as part of the string and it kept giving me a parsing error even though technically the XML was correct. I had to write this formula to strip it out, and then it worked. In this case I knew it would always be there so I didn’t do any conditional checking. It seems silly that I had to do this, but couldn’t find any other way:

    substring-before(substring-after($Start/pfx2:metadata, “<![CDATA["), "]")

    Hopefully that helps someone

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s