blob: 20fd9484eb87ab3376e467bfd33fee4e1454cb80 [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="Adding global elements" />
<meta name="abstract" content="A global element is an element with a global scope. It is one that has been declared as part of the main schema rather than as part of a content model." />
<meta name="description" content="A global element is an element with a global scope. It is one that has been declared as part of the main schema rather than as part of a content model." />
<meta content="XML schema editor, global elements, XML schema files" name="DC.subject" />
<meta content="XML schema editor, global elements, XML schema files" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/taddcmod.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/taddelmr.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="taddglem" 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 global elements</title>
</head>
<body id="taddglem"><a name="taddglem"><!-- --></a>
<h1 class="topictitle1">Adding global elements</h1>
<div><p>A global element is an element with a global scope. It is one that
has been declared as part of the main schema rather than as part of a content
model.</p>
<div class="section"><p>The following instructions were written for the Resource perspective,
but they will also work in many other perspectives.</p>
<p>To add a global
element, complete the following steps:</p>
</div>
<ol>
<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
<li class="stepexpand"><span>In the Outline view, select your schema.</span> The entire
schema and its contents are displayed in the Design view.</li>
<li class="stepexpand"><span>In the Design view, right-click in the <strong>Elements</strong> section
and click <span class="uicontrol">Add Element</span>.</span></li>
<li class="stepexpand"><span>In the Properties view, click the <span class="uicontrol">General</span> tab,
and type a new name for the global element in the <span class="uicontrol">Name</span> field.</span>
</li>
<li class="stepexpand"><span>In the Properties view, you can select the attribute type from
the predefined list in the menu next to the <span class="uicontrol">Type</span> field.</span>
<p>Alternatively, you can select <span class="uicontrol">Browse</span> from
the list for more options. </p>
<div class="p">The <span class="uicontrol">Set Type</span> dialog
box appears, and lists all built-in and user-defined types currently available.
You can change the <span class="uicontrol">Scope</span> of the list by selecting one
of the following options:<ul>
<li><span class="uicontrol">Workspace</span>: lists all of the types available in
your workspace. </li>
<li><span class="uicontrol">Enclosing Project</span>: lists all of the types available
in the project that contains your file. </li>
<li>(Default) <span class="uicontrol">Current Resource</span>: list all of the types
available in your current file.</li>
<li><span class="uicontrol">Working Sets</span>: list all the types available within
the selected working set.</li>
</ul>
</div>
<p>Select the type you want in the type list, then click <span class="uicontrol">OK</span>. </p>
</li>
<li class="stepexpand"><span>Click the <span class="uicontrol">Advanced</span> tab.</span> In this
page, you can specify the following various values for the global element:
<ul>
<li><span class="uicontrol">Abstract</span>: click <strong>true</strong> if you want the
global element to be abstract. When a global element is declared to be abstract,
it cannot be used in an instance document. Instead, a member of that global
element's substitution group must appear in the instance document.</li>
<li><span class="uicontrol">Block</span>: determines whether the global element
may be replaced by an element derived from it.</li>
<li><span class="uicontrol">Final</span>: determines whether this global element
may be derived from.</li>
<li><span class="uicontrol">Substitution Group</span>: a substitution group allows
elements to be substituted for other elements.</li>
<li><span class="uicontrol">Nillable</span>: select <strong>true</strong> if you do not
want the global element to be able to have any child elements, only attributes. </li>
</ul>
</li>
<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab to provide any
information about this global element.</span> The <span class="uicontrol">Documentation</span> page
is used for human readable material, such as a description.</li>
<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab 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>
<div class="section">You can add a content model to a global element, which is the representation
of any data that can be contained inside the global element. For more information
about working with content models, refer to the related tasks.</div>
</div>
<div><div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="../topics/taddcmod.html" title="A content model is the representation of any data that can be contained inside an element, global element, complex type, or group. It is a formal description of the structure and permissible content of an element, global element, complex type, or group, which may be used to validate a document instance.">Adding content models</a></div>
<div><a href="../topics/taddelmr.html" title="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration.">Adding element references</a></div>
</div>
</div>
</body>
</html>