kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
| 2 | <!--Arbortext, Inc., 1988-2005, v.4002-->
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 3 | <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
|
| 4 | "task.dtd">
|
| 5 | <?Pub Inc?>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 6 | <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
|
| 12 | inside an element, global element, complex type, or group. It is a formal
|
| 13 | description of the structure and permissible content of an element, global
|
| 14 | element, complex type, or group, which may be used to validate a document
|
| 15 | instance.</shortdesc>
|
| 16 | <prolog><metadata>
|
kprice | 9623e9d | 2007-05-03 03:43:05 +0000 | [diff] [blame] | 17 | <keywords><indexterm>XML schema editor<indexterm>content models</indexterm></indexterm>
|
| 18 | <indexterm>XML schema files<indexterm>content models</indexterm></indexterm>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 19 | </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
|
| 24 | appear in an instance of the XML schema. They must, however, appear in the
|
| 25 | order they are listed in the content model.</li>
|
| 26 | <li><b>Choice</b>, which means that only one of the content model's children
|
| 27 | can 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
|
| 29 | once or not at all, and they can appear in any order. If you select this option,
|
| 30 | all of the contents model's children must be individual elements and no element
|
| 31 | in the content model can appear more than once.</li>
|
| 32 | </ul></p><p>The following instructions were written for the Resource perspective,
|
| 33 | but they will also work in many other perspectives.</p><p>To add a content
|
| 34 | model to an element, global element, complex type, or group, follow these
|
| 35 | steps:</p></context>
|
| 36 | <steps>
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 37 | <step><cmd>In the Design view, select your complex type, or group:</cmd>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 38 | <choices>
|
| 39 | <choice>If you selected a complex type, you can right-click it and click <uicontrol>Add
|
| 40 | Sequence</uicontrol>, or <uicontrol>Add Choice</uicontrol> to add the type
|
| 41 | of content model you want to your complex type. If you wish to use the <uicontrol>all</uicontrol> content
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 42 | model, you can change the model by clicking the model in the Design view,
|
| 43 | and in properties, select <uicontrol>all</uicontrol> as the <uicontrol>Kind</uicontrol>.
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 44 | Your 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
|
| 46 | appear if you have set a base type for your complex type. You can either set
|
| 47 | a base type for your complex type, or you add a content model to it, but you
|
| 48 | cannot do both.</choice>
|
| 49 | <choice>Your group is automatically created with a sequence content model
|
| 50 | child. Expand it in the Outline view to see it and select it. In the Properties
|
| 51 | view, you can select to change it to a <uicontrol>choice</uicontrol> or <uicontrol>all</uicontrol> content
|
| 52 | model 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>
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 56 | <info>This is the minimum number of times the content model must appear. If
|
| 57 | you want the content model to be optional, select <uicontrol>0</uicontrol>.
|
| 58 | Otherwise, select <uicontrol>1</uicontrol>. </info></step>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 59 | <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
|
| 61 | can select <uicontrol>unbounded</uicontrol> to indicate there is no maximum
|
| 62 | number of occurrences.</info></step>
|
| 63 | <step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
|
| 64 | to provide any information about this content model.</cmd><info>The <uicontrol>Documentation</uicontrol> page
|
kprice | 9623e9d | 2007-05-03 03:43:05 +0000 | [diff] [blame] | 65 | is used for human readable material, such as a description.</info>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 66 | </step>
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 67 | <step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
|
| 68 | add application information elements to your annotations of schema components.</cmd>
|
| 69 | <info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
|
| 70 | schema and add XML content to your annotations.</info></step>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 71 | </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
|
| 75 | instance document in the context of the referencing declaration. This menu
|
| 76 | option only appears if there are global groups defined elsewhere in the document
|
| 77 | or 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.
|
| 80 | This menu option only appears if there are global elements defined elsewhere
|
| 81 | in the document.</li>
|
| 82 | <li>An <codeph>any</codeph> element. You can use an <codeph>any</codeph> element
|
| 83 | to extend your content model by any elements belonging to a specified namespace.</li>
|
| 84 | </ul></postreq>
|
| 85 | </taskbody>
|
| 86 | </task>
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 87 | <?Pub *0000005317?>
|