blob: 391b4909a5277ea63fdbce60ca9025922af8276f [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2005, v.4002-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<!-- /*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/ -->
<link href="../../org.eclipse.wst.doc.user/common.css" rel="stylesheet" type="text/css"/>
<title>Referential integrity</title>
</head>
<body id="rrefintg"><a name="rrefintg"><!-- --></a> <h1 class="topictitle1">Referential
integrity in the XML schema editor</h1> <div><p>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.</p> <div><p>When
you define a complex type, you can add a content model to it and reference
a global element. </p><div class="skipspace"><div class="p">For example:<pre>&lt;schema&gt;
&lt;element name="comment" type="string"&gt;
&lt;complexType name="Items"&gt;
&lt;sequence&gt;
&lt;element ref="comment"&gt;
&lt;/sequence&gt;
&lt;/complexType&gt;
&lt;/schema&gt;</pre> </div> <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> </div> <div class="section"><h4 class="sectiontitle">Deleting included
and imported schema</h4><div class="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.</div> </div> </div> <p><div class="relconcepts"><strong>Related
concepts</strong><br/> <div><a href="../topics/cxmlsced.html" title="XML schemas are an XML language for describing and constraining the content of XML files."
>XML schema editor</a></div> </div></p> <p class="reltasks"><strong>Related
tasks</strong><br/> <div><a href="../topics/tedtschm.html" title="After you create an XML schema, you can edit its various properties, such as its namespace and prefix."
>Editing XML schema properties</a></div> </p></div> <p></p></body>
</html>