This documentation is archived and is not being maintained.

XmlWriter.WriteCData Method

When overridden in a derived class, writes out a <![CDATA[...]]> block containing the specified text.

[Visual Basic]
Public MustOverride Sub WriteCData( _
   ByVal text As String _
)
[C#]
public abstract void WriteCData(
 string text
);
[C++]
public: virtual void WriteCData(
 String* text
) = 0;
[JScript]
public abstract function WriteCData(
   text : String
);

Parameters

text
The text to place inside the CDATA block.

Exceptions

Exception Type Condition
ArgumentException The text would result in a non-well formed XML document.

Remarks

If text is either a null reference (Nothing in Visual Basic) or String.Empty, this method writes an empty CDATA block, for example <![CDATA[]]>.

Example

See XmlTextWriter.WriteCData 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

Show: