Please enable JavaScript to view this site.

Altova MapForce 2020 Professional 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".

cdata2

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.

cdata3

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

 

Example

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.

cdata1

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

cdata4

© 2019 Altova GmbH