TreeNode::SetCDATA

Description

Ensures that any string set to it will be preserved without modifications when saved into a file.

Syntax

BOOL SetCDATA( bool bSet = true )

Parameters

bSet
[input] if true, it will put any string already in the node into a CDATA xml section, otherwise it will remove such a section, if any.

Return

TRUE if it succeeds, otherwise FALSE.

Examples

EX1

void TreeNode_SetCDATA_ex1()
{
    Tree myTree;
    TreeNode tn;
    tn = myTree.AddTextNode("abc", "node1", 1);
 
    tn.SetCDATA(true);              // Put the string "abc" of node tn into a CDATA xml section
    out_str(myTree.XML);
 
    tn.SetCDATA(false);             // The CDATA section will not be added into the XML
    out_str(myTree.XML);
        //Result:
        //<OriginStorage><node1 NodeID="1"><![CDATA[abc]]></node1></OriginStorage>
        //<OriginStorage><node1 NodeID="1">abc</node1></OriginStorage>
}

Remark

See Also

header to Include

origin.h