blob: 442e591be9112e56c4cf9953388f9db93db7c07a [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">
3<head>
4<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="task" name="DC.Type" />
11<meta name="DC.Title" content="Refactoring in XML Schema Files" />
12<meta name="abstract" content="Within an XML Schema file, refactoring allows authors to make a single artifact change, and have that change implemented throughout all other dependant artifacts." />
13<meta name="description" content="Within an XML Schema file, refactoring allows authors to make a single artifact change, and have that change implemented throughout all other dependant artifacts." />
kpricede20a692008-04-24 00:27:47 +000014<meta content="dependent artifacts, refactorting XML schema files, refactoring, XML schema files, renaming, XML schemas, editing" name="DC.subject" />
15<meta content="dependent artifacts, refactorting XML schema files, refactoring, XML schema files, renaming, XML schemas, editing" name="keywords" />
kprice159fa582006-05-08 21:30:45 +000016<meta content="XHTML" name="DC.Format" />
17<meta content="refactoring" name="DC.Identifier" />
18<meta content="en-us" name="DC.Language" />
19<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
20<title>Refactoring in XML Schema Files</title>
21</head>
22<body id="refactoring"><a name="refactoring"><!-- --></a>
23
24
25<h1 class="topictitle1">Refactoring in XML Schema Files</h1>
26
27
28
29
30<div><p>Within an XML Schema file, refactoring allows authors to make a
31single artifact change, and have that change implemented throughout all other
32dependant artifacts.</p>
33
34<div class="p" />
35
36<div class="section">Refactoring eliminates the need for the tedious editing necessary
37to recover broken dependencies caused by artifact changes which cause ripple
38effects on other dependant artifacts (such as renaming an XML Schema element).</div>
39
40<ol>
41<li class="stepexpand"><span>Create a new XML schema or double-click an existing schema in the
42Navigator view.</span> It will automatically open in the XML schema editor.
43</li>
44
45<li class="stepexpand"><span>To refactor an artifact, position cursor within the artifact, right-click
46the artifact, click <span class="menucascade"><span class="uicontrol">Refactor</span> &gt; <span class="uicontrol">Rename</span>
47</span></span> A popup dialog will request the entry of a new name
48for that artifact
49<ol type="a">
50<li class="substepexpand"><span>Type in the new name of the artifact.</span></li>
51
kpricede20a692008-04-24 00:27:47 +000052<li class="substepexpand"><span>(Optional) Click <strong>Preview</strong>.</span> A window will open
53indicating all of the changes which will take place due to the refactoring.
kprice159fa582006-05-08 21:30:45 +000054</li>
55
56<li class="substepexpand"><span>Click <span class="uicontrol">OK.</span></span></li>
57
58</ol>
59
60</li>
61
62</ol>
63
64<div class="section">The new name will be entered in the opened XSD source, as well as
kpricede20a692008-04-24 00:27:47 +000065in all dependant artifacts.</div>
kprice159fa582006-05-08 21:30:45 +000066
67<div class="example"><strong><u>Component References in XML Schema</u></strong><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
68<tr>
kpricede20a692008-04-24 00:27:47 +000069<th valign="bottom" align="left" id="N100F5">Global named components</th>
kprice159fa582006-05-08 21:30:45 +000070
kpricede20a692008-04-24 00:27:47 +000071<th valign="bottom" align="left" id="N100FB">Reference</th>
kprice159fa582006-05-08 21:30:45 +000072
73</tr>
74
75<tr>
kpricede20a692008-04-24 00:27:47 +000076<td valign="top" headers="N100F5"><ul>
kprice159fa582006-05-08 21:30:45 +000077<li>&lt;element name="foo"&gt;</li>
78
79</ul>
80</td>
81
kpricede20a692008-04-24 00:27:47 +000082<td valign="top" headers="N100FB"><ul>
kprice159fa582006-05-08 21:30:45 +000083<li>&lt;element ref="foo"&gt;</li>
84
85<li>&lt;element substitutionGroup="foo"</li>
86
87</ul>
88</td>
89
90</tr>
91
92<tr>
kpricede20a692008-04-24 00:27:47 +000093<td valign="top" headers="N100F5"><ul>
kprice159fa582006-05-08 21:30:45 +000094<li>&lt;simple/complexType name="foo"&gt;</li>
95
96</ul>
97</td>
98
kpricede20a692008-04-24 00:27:47 +000099<td valign="top" headers="N100FB"><ul>
kprice159fa582006-05-08 21:30:45 +0000100<li>&lt;element type="foo"&gt;</li>
101
102<li>&lt;attribute type="foo"&gt;</li>
103
104<li>&lt;restriction base="foo"&gt;</li>
105
106<li>&lt;substitution base="foo"&gt;</li>
107
108</ul>
109</td>
110
111</tr>
112
113<tr>
kpricede20a692008-04-24 00:27:47 +0000114<td valign="top" headers="N100F5"><ul>
kprice159fa582006-05-08 21:30:45 +0000115<li>&lt;attribute name="foo"&gt;</li>
116
117</ul>
118</td>
119
kpricede20a692008-04-24 00:27:47 +0000120<td valign="top" headers="N100FB"><ul>
kprice159fa582006-05-08 21:30:45 +0000121<li>&lt;attribute ref="foo"&gt;</li>
122
123</ul>
124</td>
125
126</tr>
127
128<tr>
kpricede20a692008-04-24 00:27:47 +0000129<td valign="top" headers="N100F5"><ul>
kprice159fa582006-05-08 21:30:45 +0000130<li>&lt;attributeGroup name="foo"&gt;</li>
131
132</ul>
133</td>
134
kpricede20a692008-04-24 00:27:47 +0000135<td valign="top" headers="N100FB"><ul>
kprice159fa582006-05-08 21:30:45 +0000136<li>&lt;attributeGroup ref="foo"&gt;</li>
137
138</ul>
139</td>
140
141</tr>
142
143<tr>
kpricede20a692008-04-24 00:27:47 +0000144<td valign="top" headers="N100F5"><ul>
kprice159fa582006-05-08 21:30:45 +0000145<li>&lt;group name="foo"&gt;</li>
146
147</ul>
148</td>
149
kpricede20a692008-04-24 00:27:47 +0000150<td valign="top" headers="N100FB"><ul>
kprice159fa582006-05-08 21:30:45 +0000151<li>&lt;group ref="foo"&gt;</li>
152
153</ul>
154</td>
155
156</tr>
157
158</table>
159</div>
160
161<div class="section" />
162
163</div>
164
165<div />
166
167</body>
168</html>