Import and Inclusion of Other Schemas
As in any programming language, it is important to be able to program in a modular manner. In this way the programmed elements are classified by concept. Several concepts can be assembled in the same library.
Standard libraries are also provided in XML. Each of these libraries contains hundreds of schemas, each treating a particular concept.
Import and inclusion of these schemas is treated differently in XSD.
XSD
You can however reference types belonging to other namespaces. To do this, you must reference the namespaces using the xmnls attribute. This attribute defines an alias on a namespace.
However, this reference is not sufficient to use types. They must be included or imported into the current schema. Distinction is made between:
• Inclusion: this consists of including schemas that belong to the same namespace as the current schema.
• Import: this consists of importing schemas that that do not belong to the namespace of the current schema, or complete namespaces.
In the following example, the "Library" schema imports the "Person" schema that belongs to another namespace.
To import the schema of another namespace:
1. Select the schema into which you want to import another schema.
2. In its properties dialog box, select the References tab.
3. Select "Referenced Class" or "Referenced Package" depending on whether you want to import a particular schema or all schemas contained in another namespace.
4. To do click the Connect button.
5. Find the schema or package and click OK.
UML modeling
To reference a package from a class diagram:
1. Select View > Views and Details and select the Schema check box.
2. In the objects tool bar, click the
Link button

3. In the diagram, click the schema class and connect it to the package to be referenced.
4. A dialog box will ask you to select the type of link you wish to create. Select Referenced Package and click OK.

In the same way you can connect a class to a schema class. This is a link of "Referenced class" type.