XmlWriter.WriteAttributeString Method (String, String, String)
Microsoft Silverlight will reach end of support after October 2021. Learn more.
When overridden in a derived class, writes an attribute with the specified local name, namespace URI, and value.
Assembly: System.Xml (in System.Xml.dll)
'Declaration Public Sub WriteAttributeString ( _ localName As String, _ ns As String, _ value As String _ )
public void WriteAttributeString( string localName, string ns, string value )
This method writes out the attribute with a user defined namespace prefix and associates it with the given namespace. If localName is "xmlns" then this method also treats this as a namespace declaration. In this case, the ns argument can be nulla null reference (Nothing in Visual Basic).
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.
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
Supported in: Xbox 360, Windows Phone OS 7.0
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.