blob: f5d45f719c5cafbf150850da56a54a2460ba8834 [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
2<!--Arbortext, Inc., 1988-2005, 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="taddcmod" xml:lang="en-us">
7<title>Adding content models</title>
8<titlealts>
9<searchtitle>Adding content models</searchtitle>
10</titlealts>
11<shortdesc>A content model is the representation of any data that can be contained
12inside an element, global element, complex type, or group. It is a formal
13description of the structure and permissible content of an element, global
14element, complex type, or group, which may be used to validate a document
15instance.</shortdesc>
16<prolog><metadata>
kprice9623e9d2007-05-03 03:43:05 +000017<keywords><indexterm>XML schema editor<indexterm>content models</indexterm></indexterm>
18<indexterm>XML schema files<indexterm>content models</indexterm></indexterm>
kprice159fa582006-05-08 21:30:45 +000019</keywords>
20</metadata></prolog>
21<taskbody>
22<context><p>There are three different kinds of content models:<ul>
23<li><b>Sequence</b>, which means that all the content model's children can
24appear in an instance of the XML schema. They must, however, appear in the
25order they are listed in the content model.</li>
26<li><b>Choice</b>, which means that only one of the content model's children
27can appear in an instance of the XML schema.</li>
28<li><b>All</b>, which means that all of the content model's children can appear
29once or not at all, and they can appear in any order. If you select this option,
30all of the contents model's children must be individual elements and no element
31in the content model can appear more than once.</li>
32</ul></p><p>The following instructions were written for the Resource perspective,
33but they will also work in many other perspectives.</p><p>To add a content
34model to an element, global element, complex type, or group, follow these
35steps:</p></context>
36<steps>
kprice647b7352006-05-17 21:27:16 +000037<step><cmd>In the Design view, select your complex type, or group:</cmd>
kprice159fa582006-05-08 21:30:45 +000038<choices>
39<choice>If you selected a complex type, you can right-click it and click <uicontrol>Add
40Sequence</uicontrol>, or <uicontrol>Add Choice</uicontrol> to add the type
41of content model you want to your complex type. If you wish to use the <uicontrol>all</uicontrol> content
kprice647b7352006-05-17 21:27:16 +000042model, you can change the model by clicking the model in the Design view,
43and in properties, select <uicontrol>all</uicontrol> as the <uicontrol>Kind</uicontrol>.
kprice159fa582006-05-08 21:30:45 +000044Your content model is automatically added as a child of your complex type
45- expand in the Outline view to see it. <b>Note:</b> These options will not
46appear if you have set a base type for your complex type. You can either set
47a base type for your complex type, or you add a content model to it, but you
48cannot do both.</choice>
49<choice>Your group is automatically created with a sequence content model
50child. Expand it in the Outline view to see it and select it. In the Properties
51view, you can select to change it to a <uicontrol>choice</uicontrol> or <uicontrol>all</uicontrol> content
52model by selecting these options from the <uicontrol>Kind</uicontrol> menu.</choice>
53</choices>
54</step>
55<step><cmd>(Optional) Select the appropriate value in the <uicontrol>MinOccurs</uicontrol> field.</cmd>
kprice647b7352006-05-17 21:27:16 +000056<info>This is the minimum number of times the content model must appear. If
57you want the content model to be optional, select <uicontrol>0</uicontrol>.
58Otherwise, select <uicontrol>1</uicontrol>. </info></step>
kprice159fa582006-05-08 21:30:45 +000059<step><cmd>(Optional) Select the appropriate value in the <uicontrol>MaxOccurs</uicontrol> field.</cmd>
60<info>This is the maximum number of times a content model can appear. You
61can select <uicontrol>unbounded</uicontrol> to indicate there is no maximum
62number of occurrences.</info></step>
63<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
64to provide any information about this content model.</cmd><info>The <uicontrol>Documentation</uicontrol> page
kprice9623e9d2007-05-03 03:43:05 +000065is used for human readable material, such as a description.</info>
kprice159fa582006-05-08 21:30:45 +000066</step>
kprice647b7352006-05-17 21:27:16 +000067<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
68add application information elements to your annotations of schema components.</cmd>
69<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
70schema and add XML content to your annotations.</info></step>
kprice159fa582006-05-08 21:30:45 +000071</steps>
72<postreq><p>You can add the following items to a content object model. </p><ul>
73<li>Another content model.</li>
74<li>A group reference which enables the referenced group to appear in the
75instance document in the context of the referencing declaration. This menu
76option only appears if there are global groups defined elsewhere in the document
77or if groups are defined in included schemas.</li>
78<li>An element, fundamental building blocks in XML.</li>
79<li>An element reference, which provides a reference to a global element.
80This menu option only appears if there are global elements defined elsewhere
81in the document.</li>
82<li>An <codeph>any</codeph> element. You can use an <codeph>any</codeph> element
83to extend your content model by any elements belonging to a specified namespace.</li>
84</ul></postreq>
85</taskbody>
86</task>
kprice647b7352006-05-17 21:27:16 +000087<?Pub *0000005317?>