kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
| 2 | <!--Arbortext, Inc., 1988-2005, v.4002-->
|
| 3 | <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
|
| 4 | <reference id="rrefintg" xml:lang="en-us">
|
| 5 | <title>Referential integrity in the XML schema editor</title>
|
| 6 | <titlealts>
|
| 7 | <searchtitle>Referential integrity</searchtitle>
|
| 8 | </titlealts>
|
| 9 | <shortdesc>The XML schema editor has a built-in mechanism to handle referential
|
| 10 | integrity issues. When you delete certain nodes, clean up for any nodes affected
|
| 11 | will automatically occur.</shortdesc>
|
| 12 | <prolog><metadata>
|
| 13 | <keywords><indexterm>XML schema editor<indexterm>referential integrity</indexterm></indexterm>
|
| 14 | <indexterm>XML schema editor<indexterm>clean up in</indexterm></indexterm>
|
| 15 | </keywords>
|
| 16 | </metadata></prolog>
|
| 17 | <refbody>
|
| 18 | <section>When you define a complex type, you can add a content model to it
|
| 19 | and reference a global element. <p>For example:<codeblock><schema>
|
| 20 | <element name="comment" type="string">
|
| 21 | <complexType name="Items">
|
| 22 | <sequence>
|
| 23 | <element ref="comment">
|
| 24 | </sequence>
|
| 25 | </complexType>
|
| 26 | </schema></codeblock></p><p>If the global element (comment) was deleted,
|
| 27 | all references to it would be in error. However, when you delete the global
|
| 28 | element, the XML schema editor will clean up using the following algorithm:</p><ul>
|
| 29 | <li>If there are one or more global elements in the schema, it will change
|
| 30 | all existing references to the first global element.</li>
|
| 31 | <li>If there is no global element, then it will delete the element reference
|
| 32 | from the content model.</li>
|
| 33 | </ul></section>
|
| 34 | <section><title>Deleting included and imported schema</title><p>If an included
|
| 35 | or imported schema is deleted, you must manually reset the following type
|
| 36 | references as appropriate: <ul>
|
| 37 | <li>Global element and element's type</li>
|
| 38 | <li>Attribute type</li>
|
| 39 | <li>Complex type derivation</li>
|
| 40 | <li>Simple type derivation </li>
|
| 41 | </ul>They will not automatically be reset if an included or imported schema
|
| 42 | is deleted.</p></section>
|
| 43 | </refbody>
|
| 44 | </reference>
|