Altova MapForce 2022 Basic Edition

CDATA sections are used to escape blocks of text containing characters which would normally be interpreted as markup. CDATA sections start with <![CDATA[" and end with the "]]>.


Target nodes can now write the input data that they receive as CDATA sections. The target node components can be any of the following:


XML data

XML data embedded in database fields

XML child elements of typed dimensions in an XBRL target

To create a CDATA section:

1.Right-click the target node that you want to define as the CDATA section and select "Write Content as CDATA section".

A prompt appears warning you that the input data should not contain the CDATA section close delimiter ']]>', click OK to close the prompt.

The [C.. icon shown below the element tag shows that this node is now defined as a CDATA section.

Note:CDATA sections can also be defined on duplicate nodes, and xsi:type nodes.



The HTMLinCDATA.mfd mapping file available in the ...\MapForceExamples folder shows an example of where CDATA sections can be very useful.


In this example:


Bold start (<b>) and end (</b>) tags are added to the content of the Trademark source element.

Italic start (<i>) and end (</i>) tags are added to the content of the Keyword source element.

The resulting data is passed on to duplicate text() nodes in the order that they appear in the source document, due to the fact the Subsection element connector, has been defined as a Source Driven (Mixed content) node.

The output of the MixedContent node is then passed on to the Description node in the ShortInfo target component, which has been defined as a CDATA section.


Clicking the Output button shows the CDATA section containing the marked-up text.


© 2016-2022 Altova GmbH