blob: ae77e6bc06e08b2d709a037addfdf958dfa6456a [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2006, v.4002-->
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
"task.dtd">
<?Pub Inc?>
<task id="taddanye" xml:lang="en-us">
<title>Adding an any element</title>
<titlealts>
<searchtitle>Adding an any element</searchtitle>
</titlealts>
<shortdesc>You can use the <codeph>any</codeph> element in a similar way as
a DTD's ANY content model, however, it must be done in conjunction with namespaces.
This enables you to include any well-formed XML content, such as an HTML Web
page that conforms to XHTML 1.0 syntax.</shortdesc>
<prolog><metadata>
<keywords><indexterm>XML schema editor<indexterm>adding an any element</indexterm></indexterm>
<indexterm>XML schema files<indexterm>adding an any element</indexterm></indexterm>
</keywords>
</metadata></prolog>
<taskbody>
<context><p>For example:</p><p><codeblock>&lt;element name = "MyWebPage">
&lt;complexType>
&lt;any namespace="http://www.w3.org/1999/xhtml"
minOccurs="1" maxOccurs="unbounded" processContents="skip"/>
&lt;/complexType>
&lt;/element></codeblock></p><p>The preceding schema fragment allows a <codeph>&lt;MyWebPage></codeph> element
to contain any well-formed XHTML data that appears in the specified namespace.</p><p>The
following instructions were written for the Resource perspective, but they
will also work in many other perspectives.</p><p>To add an <codeph>any</codeph> element,
complete the following steps:</p></context>
<steps>
<step><cmd>In the Outline view, right-click the content model that you want
to work with and click <uicontrol>Add Any</uicontrol>. </cmd></step>
<step><cmd>Select the new <codeph>any</codeph> element.</cmd></step>
<step><cmd>In the Properties view, for a <uicontrol>namespace</uicontrol> value,
you can select:</cmd>
<choices>
<choice><b>##any</b>: this allows any well-formed XML from any namespace.</choice>
<choice><b>##local </b>: this allows any well-formed XML that is not declared
to be in a namespace.</choice>
<choice><b>##other </b>: this allows any well-formed XML that is not from
the target namespace of the type being defined.</choice>
<choice><b>##targetNamespace</b>: this is shorthand for the target namespace
of the type being defined.</choice>
</choices>
</step>
<step><cmd>For a <uicontrol>processContents</uicontrol> value, you can select:</cmd>
<choices>
<choice><b>skip</b>: the XML processor will not validate the content at all.</choice>
<choice><b>lax</b>: the XML processor will validate the content as much as
it can.</choice>
<choice><b>strict</b>: the XML processor will validate all the content.</choice>
</choices>
</step>
<step><cmd>The <uicontrol>Minimum Occurrence</uicontrol> value is the number
of times the <codeph>any</codeph> element must appear in an instance document.
You can select <uicontrol>0</uicontrol> if you want the element to be optional;
otherwise, select <uicontrol>1</uicontrol>. </cmd></step>
<step><cmd>The <uicontrol>Maximum Occurrence</uicontrol> value is the maximum
number of times an <codeph>any</codeph> element can appear in an instance
document. You can select <uicontrol>0</uicontrol>, <uicontrol>1</uicontrol>,
or, to indicate there is no maximum number of occurrences, <uicontrol>unbounded</uicontrol>.</cmd>
</step>
<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want
to provide any information about this element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
is used for human readable material, such as a description.</info></step>
<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
add application information elements to your annotations of schema components.</cmd>
<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
schema and add XML content to your annotations.</info></step>
</steps>
<postreq><draft-comment>(<?Pub Caret1?>c) Copyright 2001, World Wide Web (Massachusetts
Institute of Technology, Institut National de Recherche en Informatique et
en Automatique, Keio University).</draft-comment></postreq>
</taskbody>
</task>
<?Pub *0000004081?>