System.Xml.XmlWriter.WriteStartAttribute Method

Writes the start of an attribute with the specified local name and namespace URI.

Syntax

public void WriteStartAttribute (string localName, string ns)

Parameters

ns
The namespace URI of the attribute.
localName
The local name of the attribute.
ns
The namespace URI of the attribute.

Exceptions

TypeReason
InvalidOperationExceptionThe XmlWriter.WriteState is WriteState.Closed.

Remarks

This is a more advanced version of XmlWriter.WriteAttributeString(string, string, string) that allows you to write an attribute value using multiple write methods, such as XmlWriter.WriteString(string), XmlWriter.WriteQualifiedName(string, string), and so on.

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

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