This documentation is archived and is not being maintained.

XmlWriter.WriteName Method

When overridden in a derived class, writes out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation (http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).

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

Parameters

name
The name to write.

Exceptions

Exception Type Condition
ArgumentException name is not a valid XML name; or name is either a null reference (Nothing in Visual Basic) or String.Empty.

Remarks

If Namespaces is set to true, WriteName also checks that the name is also valid according to the W3C Namespaces in XML recommendation.

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: