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.
Assembly: System.Xml (in System.Xml.dll)
Property Value
Type: System.Xml.XmlWriterSettingsThe 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()
Show: