StaticContextSettings.Schemas PropertyStaticContextSettings.Schemas PropertyStaticContextSettings::Schemas Property

Gets or sets the set of schemas used for type checking and schema validation in the query.

Syntax

Public Property Schemas As System.Xml.Schema.XmlSchemaSet
        Get
        Set(ByVal value As System.Xml.Schema.XmlSchemaSet)
public System.Xml.Schema.XmlSchemaSet Schemas { get; set; }
 

Property Value

Type: System.Xml.Schema.XmlSchemaSetSystem.Xml.Schema.XmlSchemaSetSystem.Xml.Schema::XmlSchemaSet^

The XmlSchemaSetXmlSchemaSetXmlSchemaSet containing the schemas used for type checking and schema validation.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionSchemasSchemasSchemas was set to null a null reference (Nothing in Visual Basic) nullptr.

Remarks

If an import schema declaration references a namespace that is already defined in this schema set, then no additional schemas are imported.

Any schemas imported by a query will be added to this XmlSchemaSetXmlSchemaSetXmlSchemaSet. The resolver specified by the XmlResolverXmlResolverXmlResolver property is used to resolve schema location hints in import schema declarations.

Documents passed into the query can be validated against this schema set in order to take full advantage of their type information.

 
 
Warning
If TypeCheckingModeTypeCheckingModeTypeCheckingMode is not set to OptimisticOptimisticOptimistic then the schemas must not be modified after the query has compiled. If a module is compiled independently then this schema set must contain all the schemas that are used anywhere in the query. This is because during compilation the static typing rules rely on knowing about any type that extends any other type. If the schemas change after compilation then the static typing judgements become unsound, and the query will have an undefined result.
 

If TypeCheckingModeTypeCheckingModeTypeCheckingMode is set to OptimisticOptimisticOptimistic then XmlPrime makes no assumptions about external schemas, and so it is fine for other schema types to be introduced before the query is run.

By default this is a new XmlSchemaSetXmlSchemaSetXmlSchemaSet instance.