blob: 812b302209ce01dc82a61ce94a7dcf062f9f4fd6 [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
kpricede20a692008-04-24 00:27:47 +00002<!--Arbortext, Inc., 1988-2006, v.4002-->
3<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
4 "reference.dtd">
kprice159fa582006-05-08 21:30:45 +00005<reference id="rrefintg" xml:lang="en-us">
6<title>Referential integrity in the XML schema editor</title>
8<searchtitle>Referential integrity</searchtitle>
10<shortdesc>The XML schema editor has a built-in mechanism to handle referential
11integrity issues. When you delete certain nodes, clean up for any nodes affected
12will automatically occur.</shortdesc>
14<keywords><indexterm>XML schema editor<indexterm>referential integrity</indexterm></indexterm>
15<indexterm>XML schema editor<indexterm>clean up in</indexterm></indexterm>
19<section>When you define a complex type, you can add a content model to it
20and reference a global element. <p>For example:<codeblock>&lt;schema>
21 &lt;element name="comment" type="string">
22 &lt;complexType name="Items">
23 &lt;sequence>
kpricede20a692008-04-24 00:27:47 +000024<?Pub Caret?> &lt;element ref="comment">
kprice159fa582006-05-08 21:30:45 +000025 &lt;/sequence>
26 &lt;/complexType>
27&lt;/schema></codeblock></p><p>If the global element (comment) was deleted,
28all references to it would be in error. However, when you delete the global
29element, the XML schema editor will clean up using the following algorithm:</p><ul>
30<li>If there are one or more global elements in the schema, it will change
31all existing references to the first global element.</li>
32<li>If there is no global element, then it will delete the element reference
33from the content model.</li>
35<section><title>Deleting included and imported schema</title><p>If an included
36or imported schema is deleted, you must manually reset the following type
37references as appropriate: <ul>
kpricede20a692008-04-24 00:27:47 +000038<li>Global element and element's type.</li>
39<li>Attribute type.</li>
40<li>Complex type derivation.</li>
41<li>Simple type derivation.</li>
kprice159fa582006-05-08 21:30:45 +000042</ul>They will not automatically be reset if an included or imported schema
43is deleted.</p></section>
kpricede20a692008-04-24 00:27:47 +000046<?Pub *0000002046?>