Adds an existing schema collection to the current schema collection.

Note
References to DTDs from custom XML parts are not supported. DTD references in custom XML parts will not resolve, and custom XML parts containing DTD references generate an exception when an attempt is made to save the file's content to a flat XML file.

Syntax

expression.AddCollection(SchemaCollection)

expression An expression that returns a CustomXMLSchemaCollection object.

Parameters

Name Required/Optional Data Type Description
SchemaCollection Required CustomXMLSchemaCollection Represents a collection of schemas to be imported into the current schema collection.

Remarks

If there is a conflict between namespaces while importing the collection, for example if x.xsd is already linked to "urn:invoice:namespace" but the incoming collection has z.xsd for the same namespace, the incoming collection wins.

Example
The following example receives the target schema collection and incoming schema collection arguments and then adds the one collection to the other.

Visual Basic for Applications
Sub AddSchema(objTargetCustomXMLSchemaCollection As CustomXMLSchemaCollection, _ objTargetCustomXMLSchemaCollection As CustomXMLSchemaCollection) ' Adds a schema collection to another schema the collection. objTargetCustomXMLSchemaCollection.AddCollection(objIncomingCustomXMLSchemaCollection) End Sub

See also: