Settings Property
Collapse the table of content
Expand the table of content

XmlWriter.Settings Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the XmlWriterSettings object used to create this XmlWriter instance.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

'Declaration
Public Overridable ReadOnly Property Settings As XmlWriterSettings

Property Value

Type: System.Xml.XmlWriterSettings
The XmlWriterSettings object used to create this writer instance. If this writer was not created using the Create method, this property returns Nothing.

The XmlWriterSettings class is used to specify the set of features to support on the created writer instance. The XmlWriterSettings object returned by the Settings property cannot be modified. Any attempt to change individual settings results in an exception being thrown.


Dim settings As New XmlWriterSettings()
settings.OmitXmlDeclaration = True
Dim sw As New StringWriter()

Using writer As XmlWriter = XmlWriter.Create(sw, settings)
    writer.WriteStartElement("book")
    writer.WriteElementString("price", "19.95")
    writer.WriteEndElement()
    writer.Flush()
End Using

OutputTextBlock.Text = sw.ToString()


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft