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="taddanye" xml:lang="en-us">
|
| 7 | <title>Adding an any element</title>
|
| 8 | <titlealts>
|
| 9 | <searchtitle>Adding an any element</searchtitle>
|
| 10 | </titlealts>
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 11 | <shortdesc>You can use the <codeph>any</codeph> element in a similar way as
|
| 12 | a DTD's ANY content model, however, it must be done in conjunction with namespaces.
|
| 13 | This enables you to include any well-formed XML content, such as an HTML Web
|
| 14 | page that conforms to XHTML 1.0 syntax.</shortdesc>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 15 | <prolog><metadata>
|
kprice | 9623e9d | 2007-05-03 03:43:05 +0000 | [diff] [blame] | 16 | <keywords><indexterm>XML schema editor<indexterm>adding an any element</indexterm></indexterm>
|
| 17 | <indexterm>XML schema files<indexterm>adding an any element</indexterm></indexterm>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 18 | </keywords>
|
| 19 | </metadata></prolog>
|
| 20 | <taskbody>
|
| 21 | <context><p>For example:</p><p><codeblock><element name = "MyWebPage">
|
| 22 | <complexType>
|
| 23 | <any namespace ="http://www.w3.org/1999/xhtml>
|
| 24 | < minOccurs="1" maxOccurs="unbounded" processContents="skip"/>
|
| 25 | </complexType>
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 26 | </element></codeblock></p><p>The preceding schema fragment allows a <codeph><MyWebPage></codeph> element
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 27 | to contain any well-formed XHTML data that appears in the specified namespace.</p><p>The
|
| 28 | following instructions were written for the Resource perspective, but they
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 29 | will also work in many other perspectives.</p><p>To add an <codeph>any</codeph> element:</p></context>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 30 | <steps>
|
| 31 | <step><cmd>In the Outline view, right-click the content model that you want
|
| 32 | to work with and click <uicontrol>Add Any</uicontrol>. </cmd></step>
|
| 33 | <step><cmd>Select the new <codeph>any</codeph> element.</cmd></step>
|
kprice | 9623e9d | 2007-05-03 03:43:05 +0000 | [diff] [blame] | 34 | <step><cmd>In the Properties view of the schema editor, for a <uicontrol>namespace</uicontrol> value,
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 35 | you 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
|
| 39 | to be in a namespace.</choice>
|
| 40 | <choice><b>##other </b>. This allows any well-formed XML that is not from
|
| 41 | the target namespace of the type being defined.</choice>
|
| 42 | <choice><b>##targetNamespace</b>. This is shorthand for the target namespace
|
| 43 | of 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
|
| 50 | it can.</choice>
|
| 51 | <choice><b>strict</b>. The XML processor will validate all the content.</choice>
|
| 52 | </choices>
|
| 53 | </step>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 54 | <step><cmd>The <uicontrol>minOccurs</uicontrol> value is the number of times
|
| 55 | the <codeph>any</codeph> element must appear in an instance document. You
|
| 56 | can select <uicontrol>0</uicontrol> if you want the element to be optional;
|
| 57 | otherwise, select <uicontrol>1</uicontrol>. </cmd></step>
|
| 58 | <step><cmd>The <uicontrol>maxOccurs</uicontrol> value is the maximum number
|
| 59 | of times an <codeph>any</codeph> element can appear in an instance document.
|
| 60 | You can select <uicontrol>0</uicontrol>, <uicontrol>1</uicontrol>, or, to
|
| 61 | indicate 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
|
| 64 | to provide any information about this element.</cmd><info>The <uicontrol>Documentation</uicontrol> page
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 65 | is used for human readable material, such as a description.</info></step>
|
| 66 | <step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to
|
| 67 | add application information elements to your annotations of schema components.</cmd>
|
| 68 | <info>The <uicontrol>Extensions</uicontrol> page allows you to specify the
|
| 69 | schema and add XML content to your annotations.</info></step>
|
kprice | 159fa58 | 2006-05-08 21:30:45 +0000 | [diff] [blame] | 70 | </steps>
|
| 71 | <postreq><p>(c) Copyright 2001, World Wide Web (Massachusetts Institute of
|
| 72 | Technology, Institut National de Recherche en Informatique et en Automatique,
|
| 73 | Keio University).</p></postreq>
|
| 74 | </taskbody>
|
| 75 | </task>
|
kprice | 647b735 | 2006-05-17 21:27:16 +0000 | [diff] [blame] | 76 | <?Pub *0000004291?>
|