blob: 5feb8465ca8bb15576e7dc178c5d1e433561b9c3 [file] [log] [blame]
<?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">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<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" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<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))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Refactoring in XML Schema Files" />
<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." />
<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." />
<meta content="dependent artifacts, refactoring XML schema files, refactoring, XML schema files, renaming, XML schema files, schemas, editing" name="DC.subject" />
<meta content="dependent artifacts, refactoring XML schema files, refactoring, XML schema files, renaming, XML schema files, schemas, editing" name="keywords" />
<meta content="XHTML" name="DC.Format" />
<meta content="refactoring" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Refactoring in XML Schema Files</title>
</head>
<body id="refactoring"><a name="refactoring"><!-- --></a>
<h1 class="topictitle1">Refactoring in XML Schema Files</h1>
<div><p>Within an XML Schema file, refactoring allows authors to make a
single artifact change, and have that change implemented throughout all other
dependant artifacts.</p>
<div class="p" />
<div class="section">Refactoring eliminates the need for the tedious editing necessary
to recover broken dependencies caused by artifact changes which cause ripple
effects on other dependant artifacts (such as renaming an XML Schema element).</div>
<ol>
<li class="stepexpand"><span>Create a new XML schema or double-click an existing schema in the
Navigator view.</span> It will automatically open in the XML schema editor.
</li>
<li class="stepexpand"><span>To refactor an artifact, position cursor within the artifact, right-click
the artifact, click <span class="menucascade"><span class="uicontrol">Refactor</span> &gt; <span class="uicontrol">Rename</span>
</span></span> A popup dialog will request the entry of a new name
for that artifact
<ol type="a">
<li class="substepexpand"><span>Type in the new name of the artifact.</span></li>
<li class="substepexpand"><span>(Optional) Click <strong>Preview</strong>.</span> A window will open
indicating all of the changes which will take place due to the refactoring.
</li>
<li class="substepexpand"><span>Click <span class="uicontrol">OK.</span></span></li>
</ol>
</li>
</ol>
<div class="section">The new name will be entered in the opened XSD source, as well as
in all dependant artifacts.</div>
<div class="example"><strong><u>Component References in XML Schema</u></strong><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
<tr>
<th valign="bottom" align="left" id="N100FE">Global named components</th>
<th valign="bottom" align="left" id="N10104">Reference</th>
</tr>
<tr>
<td valign="top" headers="N100FE"><ul>
<li>&lt;element name="foo"&gt;</li>
</ul>
</td>
<td valign="top" headers="N10104"><ul>
<li>&lt;element ref="foo"&gt;</li>
<li>&lt;element substitutionGroup="foo"</li>
</ul>
</td>
</tr>
<tr>
<td valign="top" headers="N100FE"><ul>
<li>&lt;simple/complexType name="foo"&gt;</li>
</ul>
</td>
<td valign="top" headers="N10104"><ul>
<li>&lt;element type="foo"&gt;</li>
<li>&lt;attribute type="foo"&gt;</li>
<li>&lt;restriction base="foo"&gt;</li>
<li>&lt;substitution base="foo"&gt;</li>
</ul>
</td>
</tr>
<tr>
<td valign="top" headers="N100FE"><ul>
<li>&lt;attribute name="foo"&gt;</li>
</ul>
</td>
<td valign="top" headers="N10104"><ul>
<li>&lt;attribute ref="foo"&gt;</li>
</ul>
</td>
</tr>
<tr>
<td valign="top" headers="N100FE"><ul>
<li>&lt;attributeGroup name="foo"&gt;</li>
</ul>
</td>
<td valign="top" headers="N10104"><ul>
<li>&lt;attributeGroup ref="foo"&gt;</li>
</ul>
</td>
</tr>
<tr>
<td valign="top" headers="N100FE"><ul>
<li>&lt;group name="foo"&gt;</li>
</ul>
</td>
<td valign="top" headers="N10104"><ul>
<li>&lt;group ref="foo"&gt;</li>
</ul>
</td>
</tr>
</table>
</div>
<div class="section" />
</div>
<div />
</body>
</html>