blob: d7820c8d36f78a2fb7ad4bf38ca9124ae8f5833f [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" />
5<meta name="copyright" content="Copyright (c) 2000, 2006 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, 2006" />
7<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="Adding redefine elements" />
12<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." />
13<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." />
14<meta content="XML schema editor, adding, redefine elements, XML schema files, redefine elements, XML schema files" name="DC.subject" />
15<meta content="XML schema editor, adding, redefine elements, XML schema files, redefine elements, XML schema files" name="keywords" />
kprice43d0c0f2006-05-18 15:56:09 +000016<meta scheme="URI" name="DC.Relation" content="../topics/taddimpt.html" />
17<meta scheme="URI" name="DC.Relation" content="../topics/taddincl.html" />
18<meta scheme="URI" name="DC.Relation" content="../topics/rnmspc.html" />
kprice159fa582006-05-08 21:30:45 +000019<meta content="XHTML" name="DC.Format" />
20<meta content="taddrdfn" 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" />
syeshind0bdb8e2005-10-27 17:44:14 +000023<title>Adding redefine elements</title>
syeshin8f077832005-09-06 04:22:45 +000024</head>
kprice159fa582006-05-08 21:30:45 +000025<body id="taddrdfn"><a name="taddrdfn"><!-- --></a>
26
27
28<h1 class="topictitle1">Adding redefine elements</h1>
29
30
31
32
33<div><p>You can use the <samp class="codeph">redefine</samp> mechanism to redefine
34simple and complex types, groups, and attribute groups obtained from external
35schema files. When you redefine a component, you are modifying its contents.</p>
36
37<div class="section"><p>Like the <samp class="codeph">include</samp> mechanism, <samp class="codeph">redefine</samp> requires
38the external components to be in the same target namespace as the redefining
39schema, although external components from schemas that have no namespace can
40also be redefined.</p>
41<p>The following instructions were written for the Resource
42perspective, but they will also work in many other perspectives.</p>
43<p>To
kprice43d0c0f2006-05-18 15:56:09 +000044add a redefine element:</p>
kprice159fa582006-05-08 21:30:45 +000045</div>
46
47<ol>
48<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
49
50<li class="stepexpand"><span>In the Outline view, select your schema.</span> The entire
kprice43d0c0f2006-05-18 15:56:09 +000051schema and its contents are displayed in the Design view.</li>
kprice159fa582006-05-08 21:30:45 +000052
kprice43d0c0f2006-05-18 15:56:09 +000053<li class="stepexpand"><span>In the Design view, right-click in the <strong>Directives</strong> section
syeshinf3d0d4b2005-07-27 18:33:03 +000054and click <span class="uicontrol">Add Redefine</span>.</span></li>
kprice159fa582006-05-08 21:30:45 +000055
kprice43d0c0f2006-05-18 15:56:09 +000056<li class="stepexpand"><span>In the Properties view, click the <strong>General</strong> tab and click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This graphic is the Browse button" /> to
57the right of the <span class="uicontrol">Schema location</span> field.</span>
58 The XML schema file you select must have the same namespace as the current
59schema.</li>
kprice159fa582006-05-08 21:30:45 +000060
kprice43d0c0f2006-05-18 15:56:09 +000061<li class="stepexpand"><span>If you want to select an XML schema located in the workbench, select <span class="uicontrol">Workbench
62projects</span> and click <span class="uicontrol">Next.</span></span></li>
63
64<li class="stepexpand"><span>Select the schema you want to include and click <span class="uicontrol">Finish</span>.</span>
kprice159fa582006-05-08 21:30:45 +000065</li>
66
kprice43d0c0f2006-05-18 15:56:09 +000067<li class="stepexpand"><span>If you want to select an XML schema located on the Web, select <span class="uicontrol">HTTP</span> and
68click <span class="uicontrol">Next</span>.</span></li>
kprice159fa582006-05-08 21:30:45 +000069
kprice43d0c0f2006-05-18 15:56:09 +000070<li class="stepexpand"><span>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.</span>
kpriceebd54462006-05-15 22:15:20 +000071 <div class="note"><span class="notetitle">Note:</span> A local copy of the schema will not be stored in the workbench.
kprice159fa582006-05-08 21:30:45 +000072Every time you validate your schema, the schema's contents will be checked
73from the URL you specify.</div>
74</li>
75
76<li class="stepexpand"><span>The XML schema editor will retrieve the location of the included
77XML schema file, and display it in the <span class="uicontrol">Schema location</span> field.
78This field can be edited at any time to reflect the location of the XML schema
79file.</span></li>
80
81<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
82to provide any information about this redefine element.</span> The <span class="uicontrol">Documentation</span> page
kprice43d0c0f2006-05-18 15:56:09 +000083is used for human readable material, such as a description.</li>
84
85<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
86add application information elements to your annotations of schema components.</span>
87 The <span class="uicontrol">Extensions</span> page allows you to specify the
88schema and add XML content to your annotations.</li>
kprice159fa582006-05-08 21:30:45 +000089
90</ol>
91
92<div class="section"><p>Once you have added the redefine element to your XML schema, you
93can redefine any of the simple and complex types, groups, and attribute groups
94in the XML schema you selected in the redefine element. </p>
95</div>
96
97</div>
98
kprice43d0c0f2006-05-18 15:56:09 +000099<div><div class="reltasks"><strong>Related tasks</strong><br />
100<div><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. 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>
101<div><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. 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>
102</div>
103<div class="relref"><strong>Related reference</strong><br />
104<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>
105</div>
106</div>
kprice159fa582006-05-08 21:30:45 +0000107
108</body>
109</html>