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

System.Xml.XmlWriter.WriteSurrogateCharEntity Method

Generates and writes the surrogate character entity for the surrogate character pair. [Edit]

public abstract void WriteSurrogateCharEntity (char lowChar, char highChar)

Parameters

lowChar
A char containing the low surrogate. This must be a value between 0xDC00 and 0xDFFF. [Edit]
highChar
A char containing the high surrogate. This must be a value between 0xD800 and 0xDBFF. [Edit]
highChar
Documentation for this section has not yet been entered. [Edit]

Exceptions

TypeReason
ArgumentExceptionAn invalid surrogate character pair was passed. [Edit]
InvalidOperationExceptionThe XmlWriter.WriteState is WriteState.Closed. [Edit]

Remarks

Note:

Applications encode DOM strings using UTF-16. For both HTML and XML, the document character set (and therefore the notation of numeric character references) is based on UCS [ISO-10646]. A single numeric character reference in a source document might therefore in some cases correspond to two 16-bit units in a DOM string (a high surrogate and a low surrogate). These 16-bit units are referred to as a surrogate pair.

For more information regarding surrogates or characters, refer to section 3.7 of the Unicode 3.0/Unicode 2.0 standard located at http://www.unicode.org, or section 2.2 of the W3C XML 1.0 Recommendation located at http://www.w3.org/TR/REC-xml#charsets.

Operation
This method generates and writes the surrogate character entity for a surrogate character pair. The surrogate character entity is written in hexadecimal format. The range for surrogate characters is #x10000 to #x10FFFF. The following formula is used to generate the surrogate character entity: (highChar - 0xD800) * 0x400 + (lowChar - 0xDC00) + 0x10000.

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