When you define a complex type, you can add a content model to it and reference a global element.
<schema> <element name="comment" type="string"> <complexType name="Items"> <sequence> <element ref="comment"> </sequence> </complexType> </schema>
If the global element (comment) was deleted, all references to it would be in error. To prevent this, the XML schema editor has a built-in mechanism to handle such referential integrity issues. When you delete the global element, the XML schema editor will clean up using the following algorithm:
Similar cleanup operations are performed when other types of objects are deleted. The following lists describes various cleanup operations.
Deleting a global attribute will cause the following cleanup:
Deleting a complex type will cause the following cleanup:
Deleting a simple type will cause the following cleanup:
Deleting a group or attribute group will cause the following cleanup:
When an include or import element is added to a schema, types from the included or imported schema become visible to the current schema. For example, the following schema references the Address type from the Address.xsd file
<schema targetNamespace="http://www.example.com/IPO" xmlns="http://www.w3.org/1999/XMLSchema" xmlns:ipo="http://www.example.com/IPO> <include schemaLocation="F:\vabase\itp\workbench\B2B\Project1\Address.xsd"/> <complexType name="PurchaseOrder"> <sequence> <element name="shipTo" type="ipo:Address"> </sequence> </complexType> </schema>
If the included schema is subsequently deleted, the include element would be in error. To prevent this, the XML schema editor will perform the necessary cleanup. In this example, the type for the element shipTo would be reset to the string data type.
The XML schema editor resets the following type references when an include or import element is deleted:
The cleanup is similar to the other operations outlined above. The XML schema editor will write an information message to the Problems view to notify you of such operations.
(c) Copyright 2001, World Wide Web Consortium (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University)
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.