System.Xml.Schema.XmlSchemaCollection.Add Method

Adds the System.Xml.Schema.XmlSchema to the collection. The specified System.Xml.XmlResolver is used to resolve any external references.

Syntax

public XmlSchema Add (XmlSchema schema, System.Xml.XmlResolver resolver)

Parameters

schema
The XmlSchema to add to the collection.
resolver
The System.Xml.XmlResolver used to resolve namespaces referenced in include and import elements. If this is null, external references are not resolved.

Returns

The XmlSchema added to the schema collection.

Remarks

The targetNamespace attribute is used to identify this schema.

If the schema contains include and import elements that reference other namespaces, the schemas for these other namespaces are loaded for validation purposes only. Unlike the original schema, these other schemas are not explicitly added to the schema collection. As a result, they are not accessible using any of the collection methods or properties.

Note:

The System.Xml.Schema.XmlSchemaCollection class is obsolete in the .NET Framework version 2.0 and has been replaced by the System.Xml.Schema.XmlSchemaSet class.

Requirements

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