Export (0) Print
Expand All
Expand Minimize

XmlSchemaValidationFlags Enumeration

Specifies schema validation options used by the XmlSchemaValidator and XmlReader classes.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

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

[FlagsAttribute]
public enum XmlSchemaValidationFlags

Member nameDescription
Supported by the .NET Compact FrameworkSupported by the XNA FrameworkNoneDo not process identity constraints, inline schemas, schema location hints, or report schema validation warnings.
Supported by the .NET Compact FrameworkSupported by the XNA FrameworkProcessInlineSchemaProcess inline schemas encountered during validation.
Supported by the .NET Compact FrameworkSupported by the XNA FrameworkProcessSchemaLocationProcess schema location hints (xsi:schemaLocation, xsi:noNamespaceSchemaLocation) encountered during validation.
Supported by the .NET Compact FrameworkSupported by the XNA FrameworkReportValidationWarningsReport schema validation warnings encountered during validation.
Supported by the .NET Compact FrameworkSupported by the XNA FrameworkProcessIdentityConstraintsProcess identity constraints (xs:ID, xs:IDREF, xs:key, xs:keyref, xs:unique) encountered during validation.
Supported by the .NET Compact FrameworkSupported by the XNA FrameworkAllowXmlAttributesAllow xml:* attributes even if they are not defined in the schema. The attributes will be validated based on their data type.

The following are notes to consider when using XmlSchemaValidationFlags values with the XmlReader.

  • XmlSchemaValidationFlags values define validation options used by a schema validating XmlReader to perform XML validation against a schema. XmlSchemaValidationFlags values for a validating XmlReader are specified using the ValidationFlags property.

The following are notes to consider when using the AllowXmlAttributes value.

  1. When a schema doesn’t import the Xml namespace.

    1. If AllowXmlAttributes is set to true (default) and the instance document contains Xml attributes, the validation engine will load a snapshot of the default Xml namespace schema and use it for validation. If Xml attributes used in the instance document are not found in the default schema, the document will not validate.

    2. If AllowXmlAttributes is set to false and the instance document contains Xml attributes, the validation engine will report an error.

  2. When a schema imports the Xml namespace without a location.

    1. If AllowXmlAttributes is set to true (default) and the instance document contains Xml attributes, the validation engine will use the default Xml namespace schema for validation. If Xml attributes used in the instance document are not found in the default schema, the document will not validate.

    2. If AllowXmlAttributes is set to false and the instance document contains Xml attributes that are not explicitly allowed by the schema, the validation engine will report an error.

    3. If AllowXmlAttributes is set to false and the instance document contains Xml attributes that are explicitly allowed by the schema, the validation engine will validate the attributes the same way it validates other attributes using the default Xml namespace schema.

  3. When a schema imports a custom Xml namespace schema with a custom schemaLocation.

    1. If AllowXmlAttributes is set to true (default) and the instance document contains Xml attributes, the validation engine will use the custom Xml namespace schema for validation. If Xml attributes used in the instance document are not found in the specified schema, the document will not validate.

    2. If AllowXmlAttributes is set to false and the instance document contains Xml attributes that are not explicitly allowed by the schema, the validation engine will report an error.

    3. If AllowXmlAttributes is set to false and the instance document contains Xml attributes that are explicitly allowed by the schema, the validation engine will validate the attributes the same way it validates other attributes using specified Xml namespace schema.

  4. When a schema defines an xml:* attribute with use="required".

    1. The following applies when AllowXmlAttributes is set to true and false. Required xml:* attributes should be treated as other attributes and validated using the specified Xml namespace schema.

  5. When a schema defines an xml:* attribute with use="prohibited".

    1. The following applies when AllowXmlAttributes is set to true and false. If an instance document contains xml:* attributes that are explicitly prohibited by the schema, the validation engine will report an error.

  6. When a schema specifies an attribute wildcard.

    1. If an instance document contains an Xml attribute and the schema specifies an attribute wildcard with processContents either omitted or set to "strict", the validation engine will use the Xml namespace schema present in the XmlSchemaSet. If no Xml namespace schema is specified, the validation engine will behave as follows.

    2. If AllowXmlAttributes is set to true, the validation engine will use the default Xml namespace schema to perform validation.

    3. If AllowXmlAttributes is set to false, the validation engine will report an error.

    4. If an instance document contains an Xml attribute and the schema specifies an attribute wildcard with processContents set to "skip", the validation engine will skip attribute validation.

    5. If an instance document contains an Xml attribute and the schema specifies an attribute wildcard with processContents set to "lax", the validation engine will use the Xml namespace schema present in the XmlSchemaSet. If no Xml namespace schema is specified, the validation engine will behave as follows.

    6. If AllowXmlAttributes is set to true, the validation engine will use the default Xml namespace schema to perform validation.

    7. If AllowXmlAttributes is set to false, attribute validation will not be performed.

  7. When validating simple types.

    1. When AllowXmlAttributes is set to true (default), Xml attributes will be allowed on elements of simple types.

For an example of the XmlSchemaValidationFlags class, see the XmlSchemaValidator class.

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

Community Additions

ADD
Show:
© 2014 Microsoft