XSD reverse generation: Include - Import
Include
The "Include" tag enables a schema to include types, elements, attributes, and groups from a schema belonging to the same namespace. This provides a way to reuse existing definitions and avoid redundancies. There can thus be a high level of modularity between the schemas used.
The "Include" tag is modeled by the "UML Reference Class-to-Class" link between the including schema and and the included schema.
Attributes of "Include"
• Id: modeled by the XSD Id link attribute.
• SchemaLocation: modeled by the XSD SpecificationLocation generation parameter, which is located on the referenced class.
• Reference: this is a MEGA attribute that can be used to find out whether the viewed schema is included or imported. It is represented by the XSD Schema Reference attribute.
Importing
The "Import" tag allows a schema to import types, elements, attributes, and groups from a schema belonging to another namespace. This provides a way to reuse existing definitions and avoid redundancies.
The "Import" tag can be modeled in two ways:
• by the "UML Reference Class-to-Class" link between two classes. In this case, the current schema imports a unique schema.
• by the "UML Reference Class-to-Package" link between a class and a package. The current schema then imports a complete namespace.
Attributes of "Import"
• Id: modeled by the XSD Id link attribute.
• SchemaLocation: modeled by the XSD SpecificationLocation generation parameter, which is located on the referenced class. This attribute is only used when importing a schema.
• Namespace: modeled by the XDD Urn attribute of the package owner of the imported schema or imported package.
• Reference: this is a MEGA attribute that can be used to find out whether the viewed schema is included or imported. It is represented by the XSD Schema Reference attribute. This attribute is only used when importing or including a schema.