| <?xml version="1.0" encoding="utf-8"?> | |
| <!--Arbortext, Inc., 1988-2005, v.4002--> | |
| <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> | |
| <task id="taddelm" xml:lang="en-us"> | |
| <title>Adding elements</title> | |
| <titlealts> | |
| <searchtitle>Adding elements</searchtitle> | |
| </titlealts> | |
| <shortdesc>Elements are fundamental building blocks in XML. Element declarations | |
| provide value constraints, and a description that can be used for validation, | |
| as well as establishing constraining relationships between related elements | |
| and attributes, and controlling substitution of elements.</shortdesc> | |
| <prolog><metadata> | |
| <keywords><indexterm>XML schema editor<indexterm>adding<indexterm>elements</indexterm></indexterm></indexterm> | |
| <indexterm>XML schema editor<indexterm>elements<indexterm>adding</indexterm></indexterm></indexterm> | |
| <indexterm>XML schema files<indexterm>adding<indexterm>elements</indexterm></indexterm></indexterm> | |
| <indexterm>XML schema files<indexterm>elements<indexterm>adding</indexterm></indexterm></indexterm> | |
| </keywords> | |
| </metadata></prolog> | |
| <taskbody> | |
| <context><p>The following instructions were written for the Resource perspective, | |
| but they will also work in many other perspectives.</p><p>To add an element, | |
| follow these steps:</p></context> | |
| <steps> | |
| <step><cmd>To add an element, in the Graph view, right-click the content model | |
| you want to work with and click <uicontrol>Add Element</uicontrol>.</cmd> | |
| <info>The element appears attached to the content model in the Graph view.</info> | |
| <substeps> | |
| <substep><cmd>Select the element, and in the Graph view, click the current | |
| (default) name of the element, which puts you in direct editing mode, then | |
| type the new <uicontrol>Name</uicontrol> and hit enter.</cmd></substep> | |
| <substep><cmd>In the Graph view, click the current (default) element type | |
| and select a type from the menu. Alternately, you can select browse to invoke | |
| the Set Type dialog for more options.</cmd><info>The Set Type dialog 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></info></substep> | |
| </substeps> | |
| </step> | |
| <step><cmd>(Optional) In the Properties view, select the appropriate value | |
| in the <uicontrol>MinOccurs</uicontrol> field.</cmd><info>This is the minimum | |
| number of times the element can appear in an instance document. If you want | |
| the element to be optional, select <uicontrol>0</uicontrol>. Otherwise, select <uicontrol>1</uicontrol>. </info> | |
| </step> | |
| <step><cmd>(Optional) Select the appropriate value in the <uicontrol>MaxOccurs</uicontrol> field.</cmd> | |
| <info>This is the maximum number of times the element can appear in an instance | |
| document. You can select <uicontrol>unbounded</uicontrol> to indicate there | |
| is no maximum number of occurrences.</info></step> | |
| <step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want | |
| to provide any information about this element.</cmd><info>The <uicontrol>Documentation</uicontrol> page | |
| is used for human readable material, such as a description, and the <uicontrol>App | |
| Info</uicontrol> page can be used to provide information for applications.</info> | |
| </step> | |
| </steps> | |
| <postreq>You can add a content model to an element, which is the representation | |
| of any data that can be contained inside the element. For more information | |
| about working with content models, refer to the related tasks.</postreq> | |
| </taskbody> | |
| </task> |