System.Xml.Schema.XmlSchema.Includes Property

Gets the collection of included and imported schemas.

Syntax

[System.Xml.Serialization.XmlElement("include", typeof(System.Xml.Schema.XmlSchemaInclude))]
[System.Xml.Serialization.XmlElement("import", typeof(System.Xml.Schema.XmlSchemaImport))]
[System.Xml.Serialization.XmlElement("redefine", typeof(System.Xml.Schema.XmlSchemaRedefine))]
public XmlSchemaObjectCollection Includes { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The XmlSchemaObjectCollection.Add(XmlSchemaObject) method expects only System.Xml.Schema.XmlSchemaExternal and its derived types (System.Xml.Schema.XmlSchemaImport, System.Xml.Schema.XmlSchemaInclude, and System.Xml.Schema.XmlSchemaRedefine) as parameters. The following example illustrates adding an included schema to the XmlSchema.Includes collection of an existing System.Xml.Schema.XmlSchema object.

Example

Dim schema As XmlSchema = New XmlSchema()

Dim textReader As XmlTextReader = New XmlTextReader("include.xsd")
Dim includeSchema As XmlSchema = XmlSchema.Read(textReader, null)

Dim include As XmlSchemaInclude = New XmlSchemaInclude()
include.Schema = includeSchema;
schema.Includes.Add(include);

Example

XmlSchema schema = new XmlSchema();

XmlTextReader textReader = new XmlTextReader("include.xsd");
XmlSchema includeSchema = XmlSchema.Read(textReader, null);

XmlSchemaInclude include = new XmlSchemaInclude();
include.Schema = includeSchema;
schema.Includes.Add(include);

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