While creating BizTalk Schema, BizTalk provides Import, include and redefine mechanism through which there can be consume schema into other schema and it make easy to create schema, if there is require to create several schemas. Here we defined the mechanism how to create schema that use other schema
XML Schema definition (XSD) language provides three different but related mechanisms for using one schema within another schema. These mechanisms are as bellow:
- Importing a schema
- Including a schema
- Redefining a schema
The following table summarizes the characteristics of these mechanisms, as defined by XSD.
|Import||– Accesses and uses types defined in the imported schema.|
– Must use types in the imported schema as is, no type modification allowed.
– Provides a mechanism for using types defined in other namespaces. Indeed, an imported schema must have a target namespace that is different from the importing schema.
– Uses the import element and its namespace and schemaLocation attributes to reference the other schema.
|Include||– Accesses and uses types defined in the included schema.|
– Must use types in the included schema as is, no type modification allowed.
– The included schema must be in the same target namespace as the including schema, or the target namespace of the included schema must be empty.
– Uses the include element and its schemaLocation attribute to reference the other schema.
|Redefine||– Accesses and uses types defined in the redefined schema.|
– Can use types in the redefined schema as is, derive new types from them, or specify modifications to them.
– The redefined schema must be in the same target namespace as the redefining schema, or the target namespace of the redefined schema must be empty.
– Uses the redefine element and its schemaLocation attribute to reference the other schema. Any type redefinitions are specified with the redefine element. Note: Using the redefine mechanism is an advanced XSD concept and should only be used after you have sufficient understanding of how and when it should be used.
How to Import Schema:
- In BizTalk Editor, open the schema to which you want to import, include, or redefine another schema. You can open a schema by double-clicking it in Solution Explorer.
- Select the Schema node at the top of the schema tree view.
- If necessary, press F4 to open the Visual Studio Properties window.
- In the Properties window, in the Advanced category, in the value portion of the Imports property, click the ellipsis (…) button.
- In the Imports dialog box, in the Import New Schema as list, select XSD Import, XSD Include, or XSD Redefine, as appropriate, and then click Add.
- In the BizTalk Type Picker dialog box, expand the Schema node in the project tree, select the schema that you want to import, include, or redefine, and then click OK.
- In the Imports dialog box, click OK.