System.Xml.XmlValidatingReader.Schemas Property

Gets a System.Xml.Schema.XmlSchemaCollection to use for validation.

Syntax

public System.Xml.Schema.XmlSchemaCollection Schemas { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Note:

The System.Xml.XmlValidatingReader class is obsolete in dnprdnext. You can create a validating System.Xml.XmlReader instance by using the System.Xml.XmlReaderSettings class and the erload:System.Xml.XmlReader.Create method. For more information, see Validating XML Data with XmlReader.

The XmlSchemaCollection holds pre-loaded XML-Data Reduced (XDR) and XML Schema definition language (XSD) schemas. This property gives the reader access to the cache of schemas and allows it to validate without having to re-load schemas every time. The reader does not add anything to the XmlSchemaCollection.

If the XmlSchemaCollection includes an XML schema (XSD) which contains include or import elements that reference other namespaces, the schemas for these other namespaces are loaded for validation purposes only. Unless these schemas were explicitly added to the schema collection, they will not be accessible using any of the collection methods or properties. For example, if the collection contains the schema file a.xsd, which contains a reference to the schema file b.xsd, you must add b.xsd to the schema collection before you can access it using any of the collection methods or properties.

When the XmlSchemaCollection is accessed using the Schemas property, the System.Xml.Schema.XmlSchemaCollection.Add(string, string) method uses the System.Xml.XmlResolver specified by the XmlValidatingReader.XmlResolver property.

Note:

The schemas must be added to the XmlSchemaCollection before the first Read call.

For more information, refer to Validation of XML with XmlValidatingReader.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0