Export (0) Print
Expand All
Expand Minimize

ConformanceLevel Enumeration

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
Supported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsAutoThe 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.
Supported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsDocumentThe XML data complies with the rules for a well-formed XML 1.0 document, as defined by the W3C.

This level of checking ensures that the stream being read or written can be consumed by any processor as an XML 1.0 document.

Document-level checks enforce fragment-level checks and also ensure the following:

  • The top-level item doesn't have any nodes other than the XML declaration, DTD, element, comment, white space, or processing instruction.

  • The XML data has one and only one top-level element node.

Supported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsFragmentThe XML data is a well-formed XML fragment, as defined by the W3C.

This conformance level represents an XML document that might not have a root element but is otherwise well-formed. This level of checking ensures that the stream being read or written can be consumed by any processor as an XML 1.0 external parsed entity.

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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft