Mono Class Library: System.Xml.XmlWriter Overview | Members

System.Xml.XmlWriter.WriteString Method

Writes the specified text. [Edit]

public abstract void WriteString (string text)

Parameters

text
A string specifying the text to write. [Edit]

Exceptions

TypeReason
InvalidOperationExceptionThe XmlWriter.WriteState is WriteState.Closed. [Edit]

Remarks

Operation

This method performs the following conversions before writing the text:

  • The characters '&', '<', and '>' are replaced with "&amp;", "&lt;", and "&gt;", respectively.
  • Character values in the range 0x-0x1F (excluding the white space characters 0x9, 0x10, and 0x13) are replaced with numeric character entities ("&#0;" through "&#0x1F").
  • If called in the context of an attribute value, double and single quotes are replaced with "&quot;" and "&apos;" respectively.

If text is null or string.Empty, this method writes a text node with no data content.

Note to Inheritors
This method must be overridden in order to provide the functionality described above, as there is no default implementation.

[Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0