Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

XmlWriterSettings.ConformanceLevel Property

Gets or sets the level of conformance which the XmlWriter complies with.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)
'Declaration
Public Property ConformanceLevel As ConformanceLevel

Property Value

Type: System.Xml.ConformanceLevel
One of the ConformanceLevel values. The default is ConformanceLevel.Document.

If the writer detects any information items that would violate the specified level of conformance, it throws an exception. In some cases, the writer automatically corrects the conformance error. For example, the writer closes an unclosed attribute without throwing an exception.

For more information and code examples, see XML Data.


            Dim settings As New XmlWriterSettings()
            settings.OmitXmlDeclaration = True
            settings.ConformanceLevel = ConformanceLevel.Fragment
            settings.CloseOutput = False

            ' Create the XmlWriter object and write some content.
            Dim strm As New MemoryStream()
            Using writer As XmlWriter = XmlWriter.Create(strm, settings)
                writer.WriteElementString("orderID", "1-456-ab")
                writer.WriteElementString("orderID", "2-36-00a")
                writer.Flush()
            End Using



Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.