blob: a7c7276026e1177f520dc29744ad3cb1f48ee78b [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Adding an any element" />
<meta name="abstract" content="You can use the any element to provide something similar to 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." />
<meta name="description" content="You can use the any element to provide something similar to 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." />
<meta content="XML schema editor, adding, an any element, XML schema files" name="DC.subject" />
<meta content="XML schema editor, adding, an any element, XML schema files" name="keywords" />
<meta content="XHTML" name="DC.Format" />
<meta content="taddanye" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Adding an any element</title>
</head>
<body id="taddanye"><a name="taddanye"><!-- --></a>
<h1 class="topictitle1">Adding an any element</h1>
<div><p>You can use the <samp class="codeph">any</samp> element to provide something
similar to 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.</p>
<div class="section"><p>For example:</p>
<div class="p"><pre>&lt;element name = "MyWebPage"&gt;
&lt;complexType&gt;
&lt;any namespace ="http://www.w3.org/1999/xhtml&gt;
&lt; minOccurs="1" maxOccurs="unbounded" processContents="skip"/&gt;
&lt;/complexType&gt;
&lt;/element&gt;</pre>
</div>
<p>The preceding schema fragment allows a <var class="varname">&lt;MyWebPage&gt;</var> 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 <samp class="codeph">any</samp> element,
follow these steps:</p>
</div>
<ol>
<li class="stepexpand"><span>In the Outline view, right-click the content model that you want
to work with and click <span class="uicontrol">Add Any</span>. </span></li>
<li class="stepexpand"><span>Select the new <samp class="codeph">any</samp> element.</span></li>
<li class="stepexpand"><span>In the Properties view of the schema editor, for a <strong>namespace</strong> value,
you can select <strong>##any</strong> (this allows any well-formed XML from any namespace), <strong>##local </strong> (this
allows any well-formed XML that is not declared to be in a namespace), <strong>##other </strong> (this
allows any well-formed XML that is not from the target namespace of the type
being defined) or <strong>##targetNamespace </strong> (which is shorthand for the target
namespace of the type being defined). </span></li>
<li class="stepexpand"><span>For a <span class="uicontrol">processContents</span> value, you can select <strong>skip</strong> (the
XML processor will not validate the content at all), <strong>lax</strong> (the XML processor
will validate the content as much as it can), or <strong>strict </strong> (the XML processor
will validate all the content).</span></li>
<li class="stepexpand"><span>The <span class="uicontrol">minOccurs</span> value is the number of times
the <samp class="codeph">any</samp> element must appear in an instance document. You
can select <span class="uicontrol">0</span> if you want the element to be optional;
otherwise, select <span class="uicontrol">1</span>. </span></li>
<li class="stepexpand"><span>The <span class="uicontrol">maxOccurs</span> value is the maximum number
of times an <samp class="codeph">any</samp> element can appear in an instance document.
You can select <span class="uicontrol">0</span>, <span class="uicontrol">1</span>, or, to
indicate there is no maximum number of occurrences, <span class="uicontrol">unbounded</span>.</span>
</li>
<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
to provide any information about this element.</span> The <span class="uicontrol">Documentation</span> page
is used for human readable material, such as a description, and the <span class="uicontrol">App
Info</span> page can be used to provide information for applications.
</li>
</ol>
<div class="section"><p>(c) Copyright 2001, World Wide Web (Massachusetts Institute of
Technology, Institut National de Recherche en Informatique et en Automatique,
Keio University).</p>
</div>
</div>
</body>
</html>