blob: 6a5384aff1380c6caf83ac21573bbdca6b66785a [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
kprice4873f982007-04-05 03:39:40 +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">
kprice159fa582006-05-08 21:30:45 +00005<task id="taddelm" xml:lang="en-us">
6<title>Adding elements</title>
7<titlealts>
8<searchtitle>Adding elements</searchtitle>
9</titlealts>
10<shortdesc>Elements are fundamental building blocks in XML. Element declarations
kprice647b7352006-05-17 21:27:16 +000011provide value constraints, provide a description that can be used for validation,
12establish constraining relationships between related elements and attributes,
13and control the substitution of elements.</shortdesc>
kprice159fa582006-05-08 21:30:45 +000014<prolog><metadata>
kprice9623e9d2007-05-03 03:43:05 +000015<keywords><indexterm>XML schema editor<indexterm>elements</indexterm></indexterm>
kpricede20a692008-04-24 00:27:47 +000016<indexterm>XML schema files<indexterm>elements</indexterm></indexterm></keywords>
kprice159fa582006-05-08 21:30:45 +000017</metadata></prolog>
18<taskbody>
19<context><p>The following instructions were written for the Resource perspective,
kpricede20a692008-04-24 00:27:47 +000020but they will also work in many other perspectives.</p><p>To add an element,
21complete the following steps:</p></context>
kprice159fa582006-05-08 21:30:45 +000022<steps>
kprice647b7352006-05-17 21:27:16 +000023<step><cmd>To add an element, in the Design view, right-click the content
kpricede20a692008-04-24 00:27:47 +000024model (sequence, choice, or all element) you want to work with and click <uicontrol>Add
25Element</uicontrol>.</cmd><info>The element appears attached to the content
26model in the Design view.</info>
kprice159fa582006-05-08 21:30:45 +000027<substeps>
kprice647b7352006-05-17 21:27:16 +000028<substep><cmd>In the Design view, select the element, and click the current
kprice159fa582006-05-08 21:30:45 +000029(default) name of the element, which puts you in direct editing mode, then
kprice647b7352006-05-17 21:27:16 +000030type the new <uicontrol>Name</uicontrol> and press enter.</cmd></substep>
31<substep><cmd>In the Design view, click the current (default) element type
kprice159fa582006-05-08 21:30:45 +000032and select a type from the menu. Alternately, you can select browse to invoke
33the Set Type dialog for more options.</cmd><info>The Set Type dialog lists
34all built-in and user-defined types currently available. You can change the <uicontrol>Scope</uicontrol> of
35the list by selecting one of the following options:<ul>
kpricede20a692008-04-24 00:27:47 +000036<li><uicontrol>Workspace</uicontrol>: lists all of the types available in
kprice4873f982007-04-05 03:39:40 +000037your workspace.</li>
kpricede20a692008-04-24 00:27:47 +000038<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types available
kprice4873f982007-04-05 03:39:40 +000039in the project that contains your file.</li>
kpricede20a692008-04-24 00:27:47 +000040<li>(Default) <uicontrol>Current Resource</uicontrol>: list all of the types
kprice159fa582006-05-08 21:30:45 +000041available in your current file.</li>
kpricede20a692008-04-24 00:27:47 +000042<li><uicontrol>Working Sets</uicontrol>: list all the types available within
kprice159fa582006-05-08 21:30:45 +000043the selected working set.</li>
44</ul></info></substep>
45</substeps>
46</step>
47<step><cmd>(Optional) In the Properties view, select the appropriate value
kpricede20a692008-04-24 00:27:47 +000048in the <uicontrol>Minimum Occurrence</uicontrol> field.</cmd><info>This is
49the number of times the element can appear in an instance document. If you
50want the element to be optional, select <uicontrol>0</uicontrol>. Otherwise,
51select <uicontrol>1</uicontrol>. </info></step>
52<step><cmd>(Optional) Select the appropriate value in the <uicontrol>Maximum
53Occurre<?Pub Caret?>nce</uicontrol> field.</cmd><info>This is the maximum
54number of times the element can appear in an instance document. Select <uicontrol>unbounded</uicontrol> to
55indicate there is no maximum number of occurrences.</info></step>
kprice159fa582006-05-08 21:30:45 +000056<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
57to provide any information about this element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
kprice647b7352006-05-17 21:27:16 +000058is used for human readable material, such as a description.</info></step>
59<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
60add application information elements to your annotations of schema components.</cmd>
61<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
62schema and add XML content to your annotations.</info></step>
kprice159fa582006-05-08 21:30:45 +000063</steps>
64<postreq>You can add a content model to an element, which is the representation
65of any data that can be contained inside the element. For more information
66about working with content models, refer to the related tasks.</postreq>
67</taskbody>
68</task>
kpricede20a692008-04-24 00:27:47 +000069<?Pub *0000003885?>