You can use the any 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.
For example:
<element name = "MyWebPage">
<complexType>
<any namespace="http://www.w3.org/1999/xhtml"
minOccurs="1" maxOccurs="unbounded" processContents="skip"/>
</complexType>
</element>
The preceding schema fragment allows
a <MyWebPage> element to contain any well-formed
XHTML data that appears in the specified namespace.
The following
instructions were written for the Resource perspective, but they will
also work in many other perspectives.
To add an any element,
complete the following steps:
- In the Outline view, right-click the content model that
you want to work with and click Add Any.
- Select the new any element.
- In the Properties view, for a Namespace value,
you can select:
- ##any: this allows any well-formed XML from any namespace.
- ##local : this allows any well-formed XML that is not
declared to be in a namespace.
- ##other : this allows any well-formed XML that is not
from the target namespace of the type being defined.
- ##targetNamespace: this is shorthand for the target
namespace of the type being defined.
- For a Process Contents value, you
can select:
- skip: the XML processor will not validate the content
at all.
- lax: the XML processor will validate the content as
much as it can.
- strict: the XML processor will validate all the content.
- The Minimum Occurrence value is
the number of times the any element must appear in
an instance document. You can select 0 if you
want the element to be optional; otherwise, select 1.
- The Maximum Occurrence value is
the maximum number of times an any element can appear
in an instance document. You can select 0, 1,
or, to indicate there is no maximum number of occurrences, unbounded.
- Click the Documentation tab if you
want to provide any information about this element.
The Documentation page is used for human
readable material, such as a description.
- Click the Extensions tab if you
want to add application information elements to your annotations of
schema components. The Extensions page
allows you to specify the schema and add XML content to your annotations.