CDATA in script tags

Hi all…

I’m using a new version of bpmn.io and realized that maybe cdata isn’t working like it used to.
I use a script in the script tag and I get this result in the old version

<bpmn2:scriptTask id="Task_1xiponc" name="Gravar abastecimento" scriptFormat="javascript">
      <bpmn2:script> **<![CDATA**[var f = vScriptService.loadScript('abastecimento_gravar_registros', 'javascript');f(execution); **]]>** </bpmn2:script>
    </bpmn2:scriptTask>

But now I got this result with the new version:

<bpmn2:scriptTask id="Task_1xiponc" name="Gravar abastecimento" scriptFormat="javascript">
 <bpmn2:script> var f = vScriptService.loadScript('abastecimento_gravar_registros', 'javascript');f(execution); </bpmn2:script>
    </bpmn2:scriptTask>

CDATA is no longer applied.

For various reasons, we need to use CDATA in these cases.

Is there some configuration to make it work?

Thank you very much!

Hi,

There is no configuration which would make the editor export any content as CDATA. The change was introduced here.

Why do you need the content to be included in CDATA?

What is important to understand is that entity escaping and CDATA sections are two ways to accomplish the same thing in XML.

We moved away from CDATA to entity escaping. If that is an issue with your XML reader I’d love to understand why. Both mechanisms should be well understood by any XML tool.

1 Like