blob: 702582d1b2df8f79887fb439f5e06fe0eb59b921 [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="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>
16<keywords><indexterm>XML schema editor<indexterm>adding<indexterm>an any element</indexterm></indexterm></indexterm>
17<indexterm>XML schema editor<indexterm>an any element<indexterm>adding</indexterm></indexterm></indexterm>
18<indexterm>XML schema files<indexterm>adding<indexterm>an any element</indexterm></indexterm></indexterm>
19<indexterm>XML schema files<indexterm>an any element<indexterm>adding</indexterm></indexterm></indexterm>
20</keywords>
21</metadata></prolog>
22<taskbody>
23<context><p>For example:</p><p><codeblock>&lt;element name = "MyWebPage">
24&lt;complexType>
25&lt;any namespace ="http://www.w3.org/1999/xhtml>
26 &lt; minOccurs="1" maxOccurs="unbounded" processContents="skip"/>
27&lt;/complexType>
kprice647b7352006-05-17 21:27:16 +000028&lt;/element></codeblock></p><p>The preceding schema fragment allows a <codeph>&lt;MyWebPage></codeph> element
kprice159fa582006-05-08 21:30:45 +000029to contain any well-formed XHTML data that appears in the specified namespace.</p><p>The
30following instructions were written for the Resource perspective, but they
kprice647b7352006-05-17 21:27:16 +000031will also work in many other perspectives.</p><p>To add an <codeph>any</codeph> element:</p></context>
kprice159fa582006-05-08 21:30:45 +000032<steps>
33<step><cmd>In the Outline view, right-click the content model that you want
34to work with and click <uicontrol>Add Any</uicontrol>. </cmd></step>
35<step><cmd>Select the new <codeph>any</codeph> element.</cmd></step>
kprice647b7352006-05-17 21:27:16 +000036<step><cmd>In the Properties view of the schema editor, for a <uicontrol>namespace</uicontrol> <?Pub Caret1?>value,
37you can select:</cmd>
38<choices>
39<choice><b>##any</b>. This allows any well-formed XML from any namespace.</choice>
40<choice><b>##local </b>. This allows any well-formed XML that is not declared
41to be in a namespace.</choice>
42<choice><b>##other </b>. This allows any well-formed XML that is not from
43the target namespace of the type being defined.</choice>
44<choice><b>##targetNamespace</b>. This is shorthand for the target namespace
45of the type being defined.</choice>
46</choices>
47</step>
48<step><cmd>For a <uicontrol>processContents</uicontrol> value, you can select:</cmd>
49<choices>
50<choice><b>skip</b>. The XML processor will not validate the content at all.</choice>
51<choice><b>lax</b>. The XML processor will validate the content as much as
52it can.</choice>
53<choice><b>strict</b>. The XML processor will validate all the content.</choice>
54</choices>
55</step>
kprice159fa582006-05-08 21:30:45 +000056<step><cmd>The <uicontrol>minOccurs</uicontrol> value is the number of times
57the <codeph>any</codeph> element must appear in an instance document. You
58can select <uicontrol>0</uicontrol> if you want the element to be optional;
59otherwise, select <uicontrol>1</uicontrol>. </cmd></step>
60<step><cmd>The <uicontrol>maxOccurs</uicontrol> value is the maximum number
61of times an <codeph>any</codeph> element can appear in an instance document.
62You can select <uicontrol>0</uicontrol>, <uicontrol>1</uicontrol>, or, to
63indicate there is no maximum number of occurrences, <uicontrol>unbounded</uicontrol>.</cmd>
64</step>
65<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
66to provide any information about this element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
kprice647b7352006-05-17 21:27:16 +000067is used for human readable material, such as a description.</info></step>
68<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
69add application information elements to your annotations of schema components.</cmd>
70<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
71schema and add XML content to your annotations.</info></step>
kprice159fa582006-05-08 21:30:45 +000072</steps>
73<postreq><p>(c) Copyright 2001, World Wide Web (Massachusetts Institute of
74Technology, Institut National de Recherche en Informatique et en Automatique,
75Keio University).</p></postreq>
76</taskbody>
77</task>
kprice647b7352006-05-17 21:27:16 +000078<?Pub *0000004291?>