ConformanceLevel Enumeration


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Specifies the amount of input or output checking that XmlReader and XmlWriter objects perform.

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

public enum ConformanceLevel

Member nameDescription

The XmlReader or XmlWriter object automatically detects whether document-level or fragment-level checking should be performed, and does the appropriate checking. If you're wrapping another XmlReader or XmlWriter object, the outer object doesn't do any additional conformance checking. Conformance checking is left up to the underlying object.

See the XmlReaderSettings.ConformanceLevel and XmlWriterSettings.ConformanceLevel properties for details on how the compliance level is determined.


The XML data complies with the rules for a well-formed XML 1.0 document, as defined by the W3C.


The XML data is a well-formed XML fragment, as defined by the W3C.

When you create an XML reader or writer instance, you can use the XmlReaderSettings or XmlWriterSettings class to specify the features that you want the new instance to support. One of the features that you can configure is the level of conformance you want to enforce on the XML data.

Creating a compliant reader or writer guarantees that the XML data being processed complies with the specified conformance level. If the stream being read or written doesn't comply with the conformance level, an exception is thrown.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top