blob: ae77e6bc06e08b2d709a037addfdf958dfa6456a [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="taddanye" xml:lang="en-us">
7<title>Adding an any element</title>
8<titlealts>
9<searchtitle>Adding an any element</searchtitle>
10</titlealts>
kprice647b7352006-05-17 21:27:16 +000011<shortdesc>You can use the <codeph>any</codeph> element in a similar way as
12a DTD's ANY content model, however, it must be done in conjunction with namespaces.
13This enables you to include any well-formed XML content, such as an HTML Web
14page that conforms to XHTML 1.0 syntax.</shortdesc>
kprice159fa582006-05-08 21:30:45 +000015<prolog><metadata>
kprice9623e9d2007-05-03 03:43:05 +000016<keywords><indexterm>XML schema editor<indexterm>adding an any element</indexterm></indexterm>
17<indexterm>XML schema files<indexterm>adding an any element</indexterm></indexterm>
kprice159fa582006-05-08 21:30:45 +000018</keywords>
19</metadata></prolog>
20<taskbody>
21<context><p>For example:</p><p><codeblock>&lt;element name = "MyWebPage">
22&lt;complexType>
kpricede20a692008-04-24 00:27:47 +000023&lt;any namespace="http://www.w3.org/1999/xhtml"
24 minOccurs="1" maxOccurs="unbounded" processContents="skip"/>
kprice159fa582006-05-08 21:30:45 +000025&lt;/complexType>
kprice647b7352006-05-17 21:27:16 +000026&lt;/element></codeblock></p><p>The preceding schema fragment allows a <codeph>&lt;MyWebPage></codeph> element
kprice159fa582006-05-08 21:30:45 +000027to contain any well-formed XHTML data that appears in the specified namespace.</p><p>The
28following instructions were written for the Resource perspective, but they
kpricede20a692008-04-24 00:27:47 +000029will also work in many other perspectives.</p><p>To add an <codeph>any</codeph> element,
30complete the following steps:</p></context>
kprice159fa582006-05-08 21:30:45 +000031<steps>
32<step><cmd>In the Outline view, right-click the content model that you want
33to work with and click <uicontrol>Add Any</uicontrol>. </cmd></step>
34<step><cmd>Select the new <codeph>any</codeph> element.</cmd></step>
kpricede20a692008-04-24 00:27:47 +000035<step><cmd>In the Properties view, for a <uicontrol>namespace</uicontrol> value,
kprice647b7352006-05-17 21:27:16 +000036you can select:</cmd>
37<choices>
kpricede20a692008-04-24 00:27:47 +000038<choice><b>##any</b>: this allows any well-formed XML from any namespace.</choice>
39<choice><b>##local </b>: this allows any well-formed XML that is not declared
kprice647b7352006-05-17 21:27:16 +000040to be in a namespace.</choice>
kpricede20a692008-04-24 00:27:47 +000041<choice><b>##other </b>: this allows any well-formed XML that is not from
kprice647b7352006-05-17 21:27:16 +000042the target namespace of the type being defined.</choice>
kpricede20a692008-04-24 00:27:47 +000043<choice><b>##targetNamespace</b>: this is shorthand for the target namespace
kprice647b7352006-05-17 21:27:16 +000044of the type being defined.</choice>
45</choices>
46</step>
47<step><cmd>For a <uicontrol>processContents</uicontrol> value, you can select:</cmd>
48<choices>
kpricede20a692008-04-24 00:27:47 +000049<choice><b>skip</b>: the XML processor will not validate the content at all.</choice>
50<choice><b>lax</b>: the XML processor will validate the content as much as
kprice647b7352006-05-17 21:27:16 +000051it can.</choice>
kpricede20a692008-04-24 00:27:47 +000052<choice><b>strict</b>: the XML processor will validate all the content.</choice>
kprice647b7352006-05-17 21:27:16 +000053</choices>
54</step>
kpricede20a692008-04-24 00:27:47 +000055<step><cmd>The <uicontrol>Minimum Occurrence</uicontrol> value is the number
56of times the <codeph>any</codeph> element must appear in an instance document.
57You can select <uicontrol>0</uicontrol> if you want the element to be optional;
kprice159fa582006-05-08 21:30:45 +000058otherwise, select <uicontrol>1</uicontrol>. </cmd></step>
kpricede20a692008-04-24 00:27:47 +000059<step><cmd>The <uicontrol>Maximum Occurrence</uicontrol> value is the maximum
60number of times an <codeph>any</codeph> element can appear in an instance
61document. You can select <uicontrol>0</uicontrol>, <uicontrol>1</uicontrol>,
62or, to indicate there is no maximum number of occurrences, <uicontrol>unbounded</uicontrol>.</cmd>
kprice159fa582006-05-08 21:30:45 +000063</step>
64<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
65to provide any information about this element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
kprice647b7352006-05-17 21:27:16 +000066is used for human readable material, such as a description.</info></step>
67<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>
kpricede20a692008-04-24 00:27:47 +000072<postreq><draft-comment>(<?Pub Caret1?>c) Copyright 2001, World Wide Web (Massachusetts
73Institute of Technology, Institut National de Recherche en Informatique et
74en Automatique, Keio University).</draft-comment></postreq>
kprice159fa582006-05-08 21:30:45 +000075</taskbody>
76</task>
kpricede20a692008-04-24 00:27:47 +000077<?Pub *0000004081?>