Skip to content

CData

Writes the specified value to the current element as CDATA.

1
myXmlWriter.CData(value: string):XmlWriter

Writes the specified value to the current element as CDATA.

1
myXmlWriter.CData(elementName: string, value: string):XmlWriter

Parameters

string value
    value to write

string elementName
    name of element

Remarks

This method writes the specified value to the current element as CDATA and returns the current writer instance.

Example

1
2
3
4
5
6
var writer = $Xml.Create();
writer.StartElement('Customer');
writer.CData('Doe');
writer.EndElement();
var xml = writer.ToXml();
// xml: <Customer><![CDATA[Doe]]></Customer>

This method writes the specified value to the current element as CDATA and returns the current writer instance.

Example

1
2
3
4
var writer = $Xml.Create();
writer.CData('Customer', 'Doe');
var xml = writer.ToXml();
// xml: <Customer><![CDATA[Doe]]></Customer>

See Also