XmlWriter.WriteString Method
.NET Framework 1.1
When overridden in a derived class, writes the given text content.
[Visual Basic] Public MustOverride Sub WriteString( _ ByVal text As String _ ) [C#] public abstract void WriteString( string text ); [C++] public: virtual void WriteString( String* text ) = 0; [JScript] public abstract function WriteString( text : String );
Parameters
- text
- The text to write.
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentException | The text string contains an invalid surrogate pair. |
Remarks
WriteString does the following
- The characters &, <, and > are replaced with &, <, and >, respectively.
- Character values in the range 0x-0x1F (excluding white space characters 0x9, 0x10, and 0x13) are replaced with numeric character entities (� through �x1F).
- If WriteString is called in the context of an attribute value, double and single quotes are replaced with " and ' respectively.
For example, this input string test<item>test is written out as
test<item>test
If text is either a null reference (Nothing in Visual Basic) or String.Empty, this method writes a text node with no data content.
Example
See WriteString (in the XmlTextWriter class) for an example using this method.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard