System.Xml.Schema.XmlSchemaSet Class

Contains a cache of XML Schema definition language (XSD) schemas.

See Also: XmlSchemaSet Members

Syntax

public class XmlSchemaSet

Remarks

In System.Xml version 1.0, XML schemas were loaded into an System.Xml.Schema.XmlSchemaCollection class as a library of schemas. In System.Xml version 2.0, the System.Xml.XmlValidatingReader and the System.Xml.Schema.XmlSchemaCollection classes are obsolete, and have been replaced by the erload:System.Xml.XmlReader.Create method and the System.Xml.Schema.XmlSchemaSet class, respectively.

The System.Xml.Schema.XmlSchemaSet has been introduced to fix a number of issues, including standards compatibility, performance, and the obsolete Microsoft XML-Data Reduced (XDR) schema format.

The following is a comparison between the System.Xml.Schema.XmlSchemaCollection class and the System.Xml.Schema.XmlSchemaSet class.

Supports Microsoft XDR and W3C XML schemas.

Only supports W3C XML schemas.

Schemas are compiled when the erload:System.Xml.Schema.XmlSchemaCollection.Add method is called.

Schemas are not compiled when the erload:System.Xml.Schema.XmlSchemaSet.Add method is called. This provides a performance improvement during creation of the schema library.

Each schema generates an individual compiled version that can result in "schema islands." As a result, all includes and imports are scoped only within that schema.

Compiled schemas generate a single logical schema, a "set" of schemas. Any imported schemas within a schema that are added to the set are directly added to the set themselves. This means that all types are available to all schemas.

Only one schema for a particular target namespace can exist in the collection.

Multiple schemas for the same target namespace can be added as long as there are no type conflicts.

Security Considerations

Requirements

Namespace: System.Xml.Schema
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0