Writes out the attribute with the specified name and value.
[Visual Basic] Overloads Public Sub WriteAttribute( _ ByVal name As String, _ ByVal value As String _ ) [C#] public void WriteAttribute( string name, string value ); [C++] public: void WriteAttribute( String* name, String* value ); [JScript] public function WriteAttribute( name : String, value : String );
Exception Type | Condition |
---|---|
InvalidOperationException | Writer is not WriteState.Element or writer is closed. |
If the name is "xmlns" or starts with "xmlns:", this method also treats this as a namespace declaration and assocates the declared prefix with the given namespace.
XmlWriter Class | XmlWriter Members | System.NewXml Namespace | XmlWriter.WriteAttribute Overload List