Expand Minimize
1 out of 2 rated this helpful - Rate this topic

ConformanceLevel Enumeration

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

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)
public enum ConformanceLevel
Member nameDescription
Supported by the .NET Compact FrameworkSupported by the XNA FrameworkAutoThe XmlReader or XmlWriter object automatically detects whether document or fragment checking should be performed, and does the appropriate checking. In the case where you are wrapping another XmlReader or XmlWriter object, the outer object does not do any additional conformance checking. Conformance checking is left up to the underlying object.
Supported by the .NET Compact FrameworkSupported by the XNA FrameworkFragmentThe XML data is a well-formed XML fragment.

This conformance level represents an XML document which does not necessarily 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 (http://www.w3.org/TR/REC-xml#NT-extParsedEnt).

Supported by the .NET Compact FrameworkSupported by the XNA FrameworkDocumentThe XML data is in conformance to the rules for a well-formed XML 1.0 document.

This level of checking ensures that the stream being read or written can be consumed by any processor as an XML 1.0 document (http://www.w3.org/TR/REC-xml#NT-document).

In addition to the ConformanceLevel.Fragment checks, the ConformanceLevel.Document level of checks also ensures the following:

  • The top-level item must not have any nodes other than XML Declaration, DTD, element, comment, white space, or processing instruction.

  • The XML data must have one, and only one, top-level element node.

When you create a 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 wish 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 does not comply with the conformance level, an exception is thrown.

For more information, see Data Conformance Checking with XmlReader and Data Conformance and the XmlWriter.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune

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

.NET Framework

Supported in: 3.5, 3.0, 2.0

.NET Compact Framework

Supported in: 3.5, 2.0

XNA Framework

Supported in: 3.0, 2.0, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.