blob: ef66d4ae9b0c65ce6a71743bb739622691ff7292 [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, 2009 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, 2009" />
<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="Adding redefine elements" />
<meta name="abstract" content="You can use the redefine 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." />
<meta name="description" content="You can use the redefine 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." />
<meta content="XML schema editor, adding redefine elements, XML schema files" name="DC.subject" />
<meta content="XML schema editor, adding redefine elements, XML schema files" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/taddimpt.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/taddincl.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/rnmspc.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="taddrdfn" 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>Adding redefine elements</title>
</head>
<body id="taddrdfn"><a name="taddrdfn"><!-- --></a>
<h1 class="topictitle1">Adding redefine elements</h1>
<div><p>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>
<div class="section"><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.</p>
<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, complete
the following steps:</p>
</div>
<ol>
<li><span>Open your XML schema in the XML schema editor.</span></li>
<li><span>In the Design view, right-click in the <strong>Directives</strong> section
and click <span class="uicontrol">Add Redefine</span>.</span></li>
<li><span>In the Select XML schema file wizard, you can import an
XML schema that is located in your workspace or you can import a schema
from an HTTP Web address. The XML schema file that you select must
have the same namespace as the current schema.</span>
<ul>
<li>If you want to import an XML schema located in your workspace:<ol type="a">
<li>Select <span class="uicontrol">Workbench projects</span> and click <span class="uicontrol">Next</span>. </li>
<li>Select the schema that you want to import and click <span class="uicontrol">Finish</span>.</li>
</ol>
</li>
<li>If you want to import an XML schema located at an HTTP Web
address:<ol type="a">
<li>Select <span class="uicontrol">HTTP</span> and click <span class="uicontrol">Next</span>.</li>
<li>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.<div class="note"><span class="notetitle">Note:</span> A
local copy of the schema is not stored in your workspace. If you validate
your schema, the schema's contents are checked from the URL that you
specify.</div>
</li>
</ol>
</li>
</ul>
</li>
<li><strong>Optional: </strong><span>Use the Properties view to define
additional properties for your import element.</span>
<ol type="a">
<li class="substepexpand"><span>If you want to edit the location of the included XML
schema file, click the <span class="uicontrol">General</span> tab and type
the new location display in the <span class="uicontrol">Schema location</span> field.</span>
</li>
<li class="substepexpand"><span>Click the <span class="uicontrol">Documentation</span> 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.</li>
<li class="substepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
want to add application information elements to your annotations of
schema components. </span> The <span class="uicontrol">Extensions</span> page
allows you to specify the schema and add XML content to your annotations.
</li>
</ol>
</li>
</ol>
<div class="section"><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><div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="../topics/taddimpt.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
<div><a href="../topics/taddincl.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="../topics/rnmspc.html" title="An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names.">XML namespaces</a></div>
</div>
</div>
</body>
</html>