blob: 90abd007ef8b843e22a52c26620b53b535a1e33a [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2006, v.4002-->
<?Pub Inc?>
<task id="taddglem" xml:lang="en-us">
<title>Adding global elements</title>
<searchtitle>Adding global elements</searchtitle>
<shortdesc>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
<keywords><indexterm>XML schema editor<indexterm>global elements</indexterm></indexterm>
<indexterm>XML schema files<indexterm>global elements</indexterm></indexterm>
<context><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></context>
<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
<step><cmd>In the Outline view, select your schema.</cmd><info>The entire
schema and its contents are displayed in the Design view.</info></step>
<step><cmd>In the Design view, right-click in the <b>Elements</b> section
and click <uicontrol>Add Element</uicontrol>.</cmd></step>
<step><cmd>In the Properties view, click the <uicontrol>General</uicontrol> tab,
and type a new name for the global element in the <uicontrol>Name</uicontrol> field.</cmd>
<step><cmd>In the Properties view, you can select the attribute type from
the predefined list in the menu next to the <uicontrol>Type</uicontrol> field.</cmd>
<info><p>Alternatively, you can select <uicontrol>Browse</uicontrol> from
the list for more options. </p><p>The <uicontrol>Set Type</uicontrol> dialog
box appears, and lists all built-in and user-defined types currently available.
You can change the <uicontrol>Scope</uicontrol> of the list by selecting one
of the following options:<ul>
<li><uicontrol>Workspace</uicontrol>: lists all of the types available in
your workspace. </li>
<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types available
in the project that contains your file. </li>
<li>(Default) <uicontrol>Current Resource</uicontrol>: list all of the types
available in your current file.</li>
<li><uicontrol>Working Sets</uicontrol>: list all the types available within
the selected working set.</li>
</ul></p><p>Select the type you want in the type list, then click <uicontrol>OK</uicontrol>. </p></info>
<step><cmd>Click the <uicontrol>Advanced</uicontrol> tab.</cmd><info>In this
page, you can specify the following various values for the global element: </info>
<choice><uicontrol>Abstract</uicontrol>: click <b>true</b> 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.</choice>
<choice><uicontrol>Block</uicontrol>: determines whether the global element
may be replaced by an element derived from it.</choice>
<choice><uicontrol>Final</uicontrol>: determines whether this global element
may be derived from.</choice>
<choice><uicontrol>Substitution Group</uicontrol>: a substitution group allows
elements to be substituted for other elements.</choice>
<choice><uicontrol>Nillable</uicontrol>: select <b>true</b> if you do not
want the global element to be able to have any child elements, only attributes. </choice>
<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab to provide any
information about this global element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
is used for human readable material, such as a description.</info></step>
<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab to add application
information elements to your annotations of schema components.</cmd><info>The <uicontrol>Extensions</uicontrol> page
allows you to specify the schema and add XML content to your annotations.</info>
</step><?Pub Caret?>
<postreq>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.</postreq>
<?Pub *0000004383?>