System.Xml.Schema.XmlSchemaSet.Add Method

Adds the XML Schema definition language (XSD) schema contained in the System.Xml.XmlReader to the System.Xml.Schema.XmlSchemaSet.

Syntax

public XmlSchema Add (string targetNamespace, System.Xml.XmlReader schemaDocument)

Parameters

targetNamespace
The schema targetNamespace property, or null to use the targetNamespace specified in the schema.
schemaDocument
The System.Xml.XmlReader object.

Returns

An System.Xml.Schema.XmlSchema object if the schema is valid. If the schema is not valid and a System.Xml.Schema.ValidationEventHandler is specified, then null is returned and the appropriate validation event is raised. Otherwise, an System.Xml.Schema.XmlSchemaException is thrown.

Remarks

Before a schema can be added to an System.Xml.Schema.XmlSchemaSet, it has to be successfully preprocessed. Preprocessing performs the following basic tasks.

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

The following are important notes to consider when using the XmlSchemaSet.Add(string, System.Xml.XmlReader) method.

The remaining functionality of this method is identical to that of the XmlSchemaSet.Add(string, string) method.

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