When overridden in a derived class, writes out the attribute with the specified local name and value.
Type Reason ArgumentException localName is null or string.Empty. InvalidOperationException The XmlWriter.WriteState is not WriteState.Element.
WriteAttributeString does the following:
If the attribute value includes double or single quotes, they are replaced with " and ' respectively.
If writing an xml:space attribute, the writer verifies the attribute value is valid. (Valid values are preserve or default.)
If writing an xml:lang attribute, the writer does not verify that the attribute value is valid according to the W3C XML 1.0 recommendation.
For the asynchronous version of this method, see XmlWriter.WriteAttributeStringAsync(string, string).