Skip to content

Write

Writes the specified value as text content to the current element.

1
myXmlWriter.Write(value: string):XmlWriter

Parameters

string value
    Value to write. This value will be XML encoded.

Returns

The current XmlWriter instance, allowing for method chaining.

Remarks

This method writes the specified value as text content within the current element.
The value is encoded using XML encoding rules to ensure proper formatting and prevent potential security issues.

Example

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

See Also