blob: 90abd007ef8b843e22a52c26620b53b535a1e33a [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
kpricede20a692008-04-24 00:27:47 +00002<!--Arbortext, Inc., 1988-2006, v.4002-->
kprice647b7352006-05-17 21:27:16 +00003<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
4 "task.dtd">
5<?Pub Inc?>
kprice159fa582006-05-08 21:30:45 +00006<task id="taddglem" xml:lang="en-us">
7<title>Adding global elements</title>
9<searchtitle>Adding global elements</searchtitle>
11<shortdesc>A global element is an element with a global scope. It is one that
12has been declared as part of the main schema rather than as part of a content
kprice9623e9d2007-05-03 03:43:05 +000015<keywords><indexterm>XML schema editor<indexterm>global elements</indexterm></indexterm>
16<indexterm>XML schema files<indexterm>global elements</indexterm></indexterm>
kprice159fa582006-05-08 21:30:45 +000017</keywords>
20<context><p>The following instructions were written for the Resource perspective,
21but they will also work in many other perspectives.</p><p>To add a global
kpricede20a692008-04-24 00:27:47 +000022element, complete the following steps:</p></context>
kprice159fa582006-05-08 21:30:45 +000023<steps>
24<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
25<step><cmd>In the Outline view, select your schema.</cmd><info>The entire
kprice647b7352006-05-17 21:27:16 +000026schema and its contents are displayed in the Design view.</info></step>
27<step><cmd>In the Design view, right-click in the <b>Elements</b> section
28and click <uicontrol>Add Element</uicontrol>.</cmd></step>
kprice159fa582006-05-08 21:30:45 +000029<step><cmd>In the Properties view, click the <uicontrol>General</uicontrol> tab,
30and type a new name for the global element in the <uicontrol>Name</uicontrol> field.</cmd>
kprice647b7352006-05-17 21:27:16 +000032<step><cmd>In the Properties view, you can select the attribute type from
kprice159fa582006-05-08 21:30:45 +000033the predefined list in the menu next to the <uicontrol>Type</uicontrol> field.</cmd>
kprice647b7352006-05-17 21:27:16 +000034<info><p>Alternatively, you can select <uicontrol>Browse</uicontrol> from
35the list for more options. </p><p>The <uicontrol>Set Type</uicontrol> dialog
36box appears, and lists all built-in and user-defined types currently available.
37You can change the <uicontrol>Scope</uicontrol> of the list by selecting one
38of the following options:<ul>
kpricede20a692008-04-24 00:27:47 +000039<li><uicontrol>Workspace</uicontrol>: lists all of the types available in
kprice159fa582006-05-08 21:30:45 +000040your workspace. </li>
kpricede20a692008-04-24 00:27:47 +000041<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types available
kprice159fa582006-05-08 21:30:45 +000042in the project that contains your file. </li>
kpricede20a692008-04-24 00:27:47 +000043<li>(Default) <uicontrol>Current Resource</uicontrol>: list all of the types
kprice159fa582006-05-08 21:30:45 +000044available in your current file.</li>
kpricede20a692008-04-24 00:27:47 +000045<li><uicontrol>Working Sets</uicontrol>: list all the types available within
kprice159fa582006-05-08 21:30:45 +000046the selected working set.</li>
47</ul></p><p>Select the type you want in the type list, then click <uicontrol>OK</uicontrol>. </p></info>
kpricede20a692008-04-24 00:27:47 +000049<step><cmd>Click the <uicontrol>Advanced</uicontrol> tab.</cmd><info>In this
50page, you can specify the following various values for the global element: </info>
kprice159fa582006-05-08 21:30:45 +000051<choices>
kpricede20a692008-04-24 00:27:47 +000052<choice><uicontrol>Abstract</uicontrol>: click <b>true</b> if you want the
kprice159fa582006-05-08 21:30:45 +000053global element to be abstract. When a global element is declared to be abstract,
54it cannot be used in an instance document. Instead, a member of that global
55element's substitution group must appear in the instance document.</choice>
kpricede20a692008-04-24 00:27:47 +000056<choice><uicontrol>Block</uicontrol>: determines whether the global element
57may be replaced by an element derived from it.</choice>
58<choice><uicontrol>Final</uicontrol>: determines whether this global element
59may be derived from.</choice>
60<choice><uicontrol>Substitution Group</uicontrol>: a substitution group allows
kprice159fa582006-05-08 21:30:45 +000061elements to be substituted for other elements.</choice>
kpricede20a692008-04-24 00:27:47 +000062<choice><uicontrol>Nillable</uicontrol>: select <b>true</b> if you do not
63want the global element to be able to have any child elements, only attributes. </choice>
kprice159fa582006-05-08 21:30:45 +000064</choices>
kpricede20a692008-04-24 00:27:47 +000066<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab to provide any
67information about this global element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
kprice647b7352006-05-17 21:27:16 +000068is used for human readable material, such as a description.</info></step>
kpricede20a692008-04-24 00:27:47 +000069<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab to add application
70information elements to your annotations of schema components.</cmd><info>The <uicontrol>Extensions</uicontrol> page
71allows you to specify the schema and add XML content to your annotations.</info>
72</step><?Pub Caret?>
kprice159fa582006-05-08 21:30:45 +000073</steps>
74<postreq>You can add a content model to a global element, which is the representation
75of any data that can be contained inside the global element. For more information
76about working with content models, refer to the related tasks.</postreq>
kpricede20a692008-04-24 00:27:47 +000079<?Pub *0000004383?>