XmlWriterSettings Constructor
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Initializes a new instance of the XmlWriterSettings class.
Assembly: System.Xml (in System.Xml.dll)
The following table shows initial property values for an instance of XmlWriterSettings.
Property | Initial Value |
|---|---|
true. | |
false. | |
Encoding.UTF8. | |
false. | |
Two spaces. | |
\r\n (carriage return, new line). | |
false. | |
false. |
Dim output As New StringBuilder() Dim settings As New XmlWriterSettings() settings.Indent = True settings.OmitXmlDeclaration = True settings.NewLineOnAttributes = True Using writer As XmlWriter = XmlWriter.Create(output, settings) writer.WriteStartElement("order") writer.WriteAttributeString("orderID", "367A54") writer.WriteAttributeString("date", "2001-05-03") writer.WriteElementString("price", "19.95") writer.WriteEndElement() writer.Flush() End Using OutputTextBlock.Text = output.ToString()
Show: