blob: 5b2c285be25763751613c570692fdb575dca4c4f [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>
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>
23&lt;any namespace ="http://www.w3.org/1999/xhtml>
24 &lt; minOccurs="1" maxOccurs="unbounded" processContents="skip"/>
25&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
kprice647b7352006-05-17 21:27:16 +000029will also work in many other perspectives.</p><p>To add an <codeph>any</codeph> element:</p></context>
kprice159fa582006-05-08 21:30:45 +000030<steps>
31<step><cmd>In the Outline view, right-click the content model that you want
32to work with and click <uicontrol>Add Any</uicontrol>. </cmd></step>
33<step><cmd>Select the new <codeph>any</codeph> element.</cmd></step>
kprice9623e9d2007-05-03 03:43:05 +000034<step><cmd>In the Properties view of the schema editor, for a <uicontrol>namespace</uicontrol> value,
kprice647b7352006-05-17 21:27:16 +000035you can select:</cmd>
36<choices>
37<choice><b>##any</b>. This allows any well-formed XML from any namespace.</choice>
38<choice><b>##local </b>. This allows any well-formed XML that is not declared
39to be in a namespace.</choice>
40<choice><b>##other </b>. This allows any well-formed XML that is not from
41the target namespace of the type being defined.</choice>
42<choice><b>##targetNamespace</b>. This is shorthand for the target namespace
43of the type being defined.</choice>
44</choices>
45</step>
46<step><cmd>For a <uicontrol>processContents</uicontrol> value, you can select:</cmd>
47<choices>
48<choice><b>skip</b>. The XML processor will not validate the content at all.</choice>
49<choice><b>lax</b>. The XML processor will validate the content as much as
50it can.</choice>
51<choice><b>strict</b>. The XML processor will validate all the content.</choice>
52</choices>
53</step>
kprice159fa582006-05-08 21:30:45 +000054<step><cmd>The <uicontrol>minOccurs</uicontrol> value is the number of times
55the <codeph>any</codeph> element must appear in an instance document. You
56can select <uicontrol>0</uicontrol> if you want the element to be optional;
57otherwise, select <uicontrol>1</uicontrol>. </cmd></step>
58<step><cmd>The <uicontrol>maxOccurs</uicontrol> value is the maximum number
59of times an <codeph>any</codeph> element can appear in an instance document.
60You can select <uicontrol>0</uicontrol>, <uicontrol>1</uicontrol>, or, to
61indicate there is no maximum number of occurrences, <uicontrol>unbounded</uicontrol>.</cmd>
62</step>
63<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
64to provide any information about this element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
kprice647b7352006-05-17 21:27:16 +000065is used for human readable material, such as a description.</info></step>
66<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
67add application information elements to your annotations of schema components.</cmd>
68<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
69schema and add XML content to your annotations.</info></step>
kprice159fa582006-05-08 21:30:45 +000070</steps>
71<postreq><p>(c) Copyright 2001, World Wide Web (Massachusetts Institute of
72Technology, Institut National de Recherche en Informatique et en Automatique,
73Keio University).</p></postreq>
74</taskbody>
75</task>
kprice647b7352006-05-17 21:27:16 +000076<?Pub *0000004291?>