blob: d05610049d14879f9cdad2a493b4a96574820ba4 [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>
<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 rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
<title>Adding redefine elements</title>
</head>
<body id="taddrdfn"><a name="taddrdfn"><!-- --></a>
<h1 class="topictitle1">Adding redefine elements</h1>
<div>
<div class="skipspace">
<div>
<div>
You can use the <samp class="codeph">redefine</samp> mechanism
to redefine simple and complex types, groups, and attribute
groups obtained from external schema files. When you redefine a
component, you are modifying its contents.<p>Like the
<samp class="codeph">include</samp> mechanism,
<samp class="codeph">redefine</samp> requires the external
components to be in the same target namespace as the redefining
schema, although external components from schemas that have no
namespace can also be redefined.</div>
</div>
<p>The following instructions were written for the Resource perspective,
but they will also work in many other perspectives.</p>
<p>To
add a redefine element, follow these steps:</p>
</div>
<ol><li class="skipspace"><span>Open your XML schema in the XML schema editor.</span></li>
<li class="skipspace"><span>In the Outline view, select your schema.</span> The entire
schema and its contents should be displayed in the Graph view.</li>
<li class="skipspace"><span>In the Graph view, right-click in the <b>Directives</b> section
and click <span class="uicontrol">Add Redefine</span>.</span></li>
<li class="skipspace"><span>In the Properties view, click the <b>General</b> tab and click
the <b> <span class="uicontrol">More</span></b> button
<img border="0" src="../images/More.gif" width="22" height="18"> to the right of the
<b> <span class="uicontrol">Schema
location</span> </b>field.</span> The XML schema file you select must
have the same namespace as the current schema.</li>
<li class="skipspace"><span>If you want to select an XML schema located in the workbench, select
the <b> <span class="uicontrol">Workbench projects</span> </b>radio button and click <span class="uicontrol">
<b>Next</b>.</span></span><ol type="a"><li><span> Select the schema you want to include and click
<b> <span class="uicontrol">Finish</span></b>.</span></li>
</ol>
</li>
<li class="skipspace"><span>If you want to select an XML schema located on the Web, select
the <b> <span class="uicontrol">HTTP</span></b> radio button and click <b> <span class="uicontrol">Next</span></b>.</span><ol type="a"><li><span>Type the URL of the XML schema and click
<b> <span class="uicontrol">Finish</span></b>.
</span></li>
</ol>
<div class="note"><span class="notetitle"><b>Note</b>: </span>A local copy of the schema will not be stored in the workbench.
Every time you validate your schema, the schema's contents will be checked
from the URL you specify.</div>
</li>
<li class="skipspace"><span>The XML schema editor will retrieve the location of the included
XML schema file and display it as read-only in the <b> <span class="uicontrol">Schema location</span>
</b>field.</span></li>
<li class="skipspace"><span>Click the <b> <span class="uicontrol">Documentation</span></b> tab if you want
to provide any information about this redefine element.</span> The <span class="uicontrol">Documentation</span> page is used for human readable
material, such as a description, and the <span class="uicontrol">App Info</span>
page can be used to provide information for applications.</li>
</ol>
<div class="skipspace"><p>Once you have added the redefine element to your XML
schema, you can redefine any of the simple and complex types, groups, and
attribute groups in the XML schema you selected in the redefine element. </p>
</div>
</div>
<div><p><b class="reltaskshd">Related tasks</b><br />
<a href="../topics/taddimpt.html" title="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. XML schema defines two constructs to support this: include and import. The include element brings in definitions and declarations from the included schema into the current schema. It requires the included schema to be in the same target namespace as the including schema. The import element behaves in a similar way, with the exception that the imported schema can come from a different namespace.">Adding an import element</a><br />
<a href="../topics/taddincl.html" title="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. XML schema defines two constructs to support this: include and import. The include element brings in definitions and declarations from the included schema into the current schema. It requires the included schema to be in the same target namespace as the including schema. The import element behaves in a similar way, with the exception that the imported schema can come from a different namespace.">Adding an include element</a><br />
</p>
<p><b class="relrefhd">Related reference</b><br />
<a href="../topics/rnmspc.html" title="">XML namespaces</a><br />
</p>
</div>
</body>
</html>