XmlWriterSettings Constructor
Collapse the table of content
Expand the table of content

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.

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

'Declaration
Public Sub New

The following table shows initial property values for an instance of XmlWriterSettings.

Property

Initial Value

CheckCharacters

true.

CloseOutput

false.

ConformanceLevel

Document.

Encoding

Encoding.UTF8.

Indent

false.

IndentChars

Two spaces.

NewLineChars

\r\n (carriage return, new line).

NewLineHandling

Replace.

NewLineOnAttributes

false.

OmitXmlDeclaration

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()


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft