axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
void axl_node_set_cdata_content ( axlNode node,
const char *  content,
int  content_size 

Allows to store CDATA enclosed content on the provided node.

Some characters are not allowed to be stored "as is" inside a parseable XML document. The basic set of them are: &, ', ", < or >.

In order to store content containing previous characters inside an xml node, and to remain valid, functions like axl_node_set_content will translate those value, into the accepted escape sequences.

As an alternative, the XML node content could be stored enclosed as a CDATA section: <![CDATA[..]]>, which allows to store unparsed characters, including those not allowed.

NOTE: In the case content received includes a ]]> declaration, it is escaped to allow it. This is provided not to allow nested CDATA declarations which is not allowed by XML 1.0 standard but to allow binary content to be stored that may include a ]]> declaration.

nodeThe node where the CDATA will be stored.
contentThe content to store.
content_sizeThe content size or -1 if required Axl to figure out current sizes.

References axl_false, AXL_LEVEL_DEBUG, axl_node_has_invalid_chars_cdata(), axl_return_if_fail, axl_strdup(), and axl_true.