System.Xml.XmlWriter.WriteStartElement Method

When overridden in a derived class, writes the specified start tag and associates it with the given namespace and prefix.

Syntax

public abstract void WriteStartElement (string prefix, string localName, string ns)

Parameters

prefix
The namespace prefix of the element.
localName
The local name of the element.
ns
The namespace URI to associate with the element.

Exceptions

TypeReason
InvalidOperationExceptionThe XmlWriter.WriteState is WriteState.Closed.

Remarks

For the asynchronous version of this method, see XmlWriter.WriteStartElementAsync(string, string, string).

Example

See XmlTextWriter.WriteStartElement(string, string, string) for an example demonstrating this method.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0