<?xml version="1.0" encoding="utf-8"?> | |
<!--Arbortext, Inc., 1988-2005, v.4002--> | |
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"> | |
<reference id="rrefintg" xml:lang="en-us"> | |
<title>Referential integrity in the XML schema editor</title> | |
<titlealts> | |
<searchtitle>Referential integrity</searchtitle> | |
</titlealts> | |
<shortdesc>The XML schema editor has a built-in mechanism to handle referential | |
integrity issues. When you delete certain nodes, clean up for any nodes affected | |
will automatically occur.</shortdesc> | |
<prolog><metadata> | |
<keywords><indexterm>XML schema editor<indexterm>referential integrity</indexterm></indexterm> | |
<indexterm>XML schema editor<indexterm>clean up in</indexterm></indexterm> | |
</keywords> | |
</metadata></prolog> | |
<refbody> | |
<section>When you define a complex type, you can add a content model to it | |
and reference a global element. <p>For example:<codeblock><schema> | |
<element name="comment" type="string"> | |
<complexType name="Items"> | |
<sequence> | |
<element ref="comment"> | |
</sequence> | |
</complexType> | |
</schema></codeblock></p><p>If the global element (comment) was deleted, | |
all references to it would be in error. However, when you delete the global | |
element, the XML schema editor will clean up using the following algorithm:</p><ul> | |
<li>If there are one or more global elements in the schema, it will change | |
all existing references to the first global element.</li> | |
<li>If there is no global element, then it will delete the element reference | |
from the content model.</li> | |
</ul></section> | |
<section><title>Deleting included and imported schema</title><p>If an included | |
or imported schema is deleted, you must manually reset the following type | |
references as appropriate: <ul> | |
<li>Global element and element's type</li> | |
<li>Attribute type</li> | |
<li>Complex type derivation</li> | |
<li>Simple type derivation </li> | |
</ul>They will not automatically be reset if an included or imported schema | |
is deleted.</p></section> | |
</refbody> | |
</reference> |