Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

XmlWriter.WriteString Method

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

For example, this input string test<item>test is written out as

test&lt;item&gt;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

See Also

XmlWriter Class | XmlWriter Members | System.Xml Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.