blob: 33654b09b8fdf41855bf326b6fc6edff6a110399 [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html lang="en-us" xml:lang="en-us">
syeshinf3d0d4b2005-07-27 18:33:03 +00003<head>
kprice159fa582006-05-08 21:30:45 +00004<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
kpricede20a692008-04-24 00:27:47 +00005<meta name="copyright" content="Copyright (c) 2000, 2008 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" />
6<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
kprice159fa582006-05-08 21:30:45 +00007<meta content="public" name="security" />
8<meta content="index,follow" name="Robots" />
9<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
10<meta content="reference" name="DC.Type" />
11<meta name="DC.Title" content="Referential integrity in the XML schema editor" />
12<meta name="abstract" content="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." />
13<meta name="description" content="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." />
14<meta content="XML schema editor, referential integrity, clean up in" name="DC.subject" />
15<meta content="XML schema editor, referential integrity, clean up in" name="keywords" />
kprice43d0c0f2006-05-18 15:56:09 +000016<meta scheme="URI" name="DC.Relation" content="../topics/cxmlsced.html" />
17<meta scheme="URI" name="DC.Relation" content="../topics/tedtschm.html" />
18<meta scheme="URI" name="DC.Relation" content="../topics/tdelscmp.html" />
kprice159fa582006-05-08 21:30:45 +000019<meta content="XHTML" name="DC.Format" />
20<meta content="rrefintg" name="DC.Identifier" />
21<meta content="en-us" name="DC.Language" />
22<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
syeshinf3d0d4b2005-07-27 18:33:03 +000023<title>Referential integrity</title>
syeshin8f077832005-09-06 04:22:45 +000024</head>
kprice159fa582006-05-08 21:30:45 +000025<body id="rrefintg"><a name="rrefintg"><!-- --></a>
26
27
28<h1 class="topictitle1">Referential integrity in the XML schema editor</h1>
29
30
31
32
33<div><p>The XML schema editor has a built-in mechanism to handle referential
34integrity issues. When you delete certain nodes, clean up for any nodes affected
35will automatically occur.</p>
36
37<div class="section">When you define a complex type, you can add a content model to it
38and reference a global element. <div class="p">For example:<pre>&lt;schema&gt;
syeshind0bdb8e2005-10-27 17:44:14 +000039 &lt;element name="comment" type="string"&gt;
kprice159fa582006-05-08 21:30:45 +000040 &lt;complexType name="Items"&gt;
41 &lt;sequence&gt;
42 &lt;element ref="comment"&gt;
43 &lt;/sequence&gt;
44 &lt;/complexType&gt;
45&lt;/schema&gt;</pre>
46</div>
47<p>If the global element (comment) was deleted,
syeshind0bdb8e2005-10-27 17:44:14 +000048all references to it would be in error. However, when you delete the global
kprice159fa582006-05-08 21:30:45 +000049element, the XML schema editor will clean up using the following algorithm:</p>
50<ul>
lmandel79573072006-03-30 03:29:16 +000051<li>If there are one or more global elements in the schema, it will change
syeshinf3d0d4b2005-07-27 18:33:03 +000052all existing references to the first global element.</li>
kprice159fa582006-05-08 21:30:45 +000053
syeshinf3d0d4b2005-07-27 18:33:03 +000054<li>If there is no global element, then it will delete the element reference
55from the content model.</li>
kprice159fa582006-05-08 21:30:45 +000056
57</ul>
58</div>
59
60<div class="section"><h4 class="sectiontitle">Deleting included and imported schema</h4><div class="p">If an included
61or imported schema is deleted, you must manually reset the following type
62references as appropriate: <ul>
kpricede20a692008-04-24 00:27:47 +000063<li>Global element and element's type.</li>
kprice159fa582006-05-08 21:30:45 +000064
kpricede20a692008-04-24 00:27:47 +000065<li>Attribute type.</li>
kprice159fa582006-05-08 21:30:45 +000066
kpricede20a692008-04-24 00:27:47 +000067<li>Complex type derivation.</li>
kprice159fa582006-05-08 21:30:45 +000068
kpricede20a692008-04-24 00:27:47 +000069<li>Simple type derivation.</li>
kprice159fa582006-05-08 21:30:45 +000070
71</ul>
72They will not automatically be reset if an included or imported schema
73is deleted.</div>
74</div>
75
76</div>
77
kprice43d0c0f2006-05-18 15:56:09 +000078<div><div class="relconcepts"><strong>Related concepts</strong><br />
79<div><a href="../topics/cxmlsced.html" title="This product provides an XML schema editor for creating, viewing, and validating XML schemas. XML schemas are a formal specification of element names that indicates which elements are allowed in an XML file, and in which combinations.">XML schema editor</a></div>
80</div>
81<div class="reltasks"><strong>Related tasks</strong><br />
82<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>
83<div><a href="../topics/tdelscmp.html" title="If you have created any XML schema components you no longer need, you can delete them.">Deleting XML schema components</a></div>
84</div>
85</div>
kprice159fa582006-05-08 21:30:45 +000086
87</body>
88</html>