System.Xml.XmlWriter.WriteEndAttribute Method

When overridden in a derived class, closes the previous XmlWriter.WriteStartAttribute(string, string) call.

Syntax

public abstract void WriteEndAttribute ()

Exceptions

TypeReason
InvalidOperationExceptionThe XmlWriter.WriteState is not WriteState.Attribute.

Remarks

If you call WriteStartAttribute, you can close the attribute with this method.

You can also close the attribute by calling WriteStartAttribute again, calling XmlWriter.WriteAttributeString(string, string, string), or calling XmlWriter.WriteEndElement.

Note:

When you use the System.Xml.XmlWriter methods to output XML, the elements and attributes will not be written until you call the XmlWriter.Close method. For example, if you are using the XmlWriter to populate an System.Xml.XmlDocument, until you close the System.Xml.XmlWriter, you will not be able to observe the written elements and attributes in the target document.

For the asynchronous version of this method, see XmlWriter.WriteEndAttributeAsync.

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