blob: 40177eb6a066be70585c1a4a21734a3bce341d0d [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?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">
2<html lang="en-us" xml:lang="en-us">
syeshinf3d0d4b2005-07-27 18:33:03 +00003<head>
kprice159fa582006-05-08 21:30:45 +00004<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
5<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" />
6<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
7<meta content="public" name="security" />
8<meta content="index,follow" name="Robots" />
9<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))' />
10<meta content="task" name="DC.Type" />
11<meta name="DC.Title" content="Adding element references" />
12<meta name="abstract" content="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration." />
13<meta name="description" content="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration." />
14<meta content="XML schema editor, adding, element references, XML schema files, element references, XML schema files" name="DC.subject" />
15<meta content="XML schema editor, adding, element references, XML schema files, element references, XML schema files" name="keywords" />
kprice43d0c0f2006-05-18 15:56:09 +000016<meta scheme="URI" name="DC.Relation" content="../topics/taddglem.html" />
17<meta scheme="URI" name="DC.Relation" content="../topics/taddelm.html" />
18<meta scheme="URI" name="DC.Relation" content="../topics/taddanye.html" />
19<meta scheme="URI" name="DC.Relation" content="../topics/taddglba.html" />
kprice159fa582006-05-08 21:30:45 +000020<meta content="XHTML" name="DC.Format" />
21<meta content="taddelmr" name="DC.Identifier" />
22<meta content="en-us" name="DC.Language" />
23<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
24<title>Adding element references</title>
syeshin8f077832005-09-06 04:22:45 +000025</head>
kprice159fa582006-05-08 21:30:45 +000026<body id="taddelmr"><a name="taddelmr"><!-- --></a>
27
28
29<h1 class="topictitle1">Adding element references</h1>
30
31
32
33
34<div><p>An element reference provides a reference to a global element.
35A declaration that references a global element enables the referenced global
36element to appear in the instance document in the context of the referencing
37declaration.</p>
38
39<div class="section"><p>The following instructions were written for the Resource perspective,
40but they will also work in many other perspectives.</p>
41<p>To add an element
kprice43d0c0f2006-05-18 15:56:09 +000042reference:</p>
kprice159fa582006-05-08 21:30:45 +000043</div>
44
45<ol>
kprice43d0c0f2006-05-18 15:56:09 +000046<li class="stepexpand"><span>In the Design view, right-click the content model you want to work
kprice159fa582006-05-08 21:30:45 +000047with and click <span class="uicontrol">Add Element Ref</span>.</span> If
48no global element is defined in the document, a new global element is created
49for you, and the element reference will point to it.</li>
50
kprice43d0c0f2006-05-18 15:56:09 +000051<li class="stepexpand"><span>Select the element reference. To specify values for an element
52reference:</span>
kprice159fa582006-05-08 21:30:45 +000053<ul>
kprice43d0c0f2006-05-18 15:56:09 +000054<li>Click the name of the element reference in the Design view. Enter
55the name of the element reference.</li>
kprice159fa582006-05-08 21:30:45 +000056
kprice43d0c0f2006-05-18 15:56:09 +000057<li>Click the element reference type in the Design view.
58Select a type from the menu, or select <span class="uicontrol">Browse</span> for more
59options.</li>
kprice159fa582006-05-08 21:30:45 +000060
61</ul>
62
63</li>
64
65<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">MinOccurs</span> field.</span>
66 This is the number of times the global element referenced can appear
67in an instance document. If you want the element to be optional, select <span class="uicontrol">0</span>.
68Otherwise, select <span class="uicontrol">1</span>. </li>
69
70<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">MaxOccurs</span> field.</span>
71 This is the maximum number of times the global element referenced can
72appear. You can select <span class="uicontrol">unbounded</span> to indicate there
73is no maximum number of occurrences.</li>
74
75<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
76to provide any information about this element reference.</span> The <span class="uicontrol">Documentation</span> page
kprice43d0c0f2006-05-18 15:56:09 +000077is used for human readable material, such as a description.</li>
78
79<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
80add application information elements to your annotations of schema components.</span>
81 The <span class="uicontrol">Extensions</span> page allows you to specify the
82schema and add XML content to your annotations.</li>
kprice159fa582006-05-08 21:30:45 +000083
84</ol>
85
86</div>
87
kprice43d0c0f2006-05-18 15:56:09 +000088<div><div class="reltasks"><strong>Related tasks</strong><br />
89<div><a href="../topics/taddglem.html" title="A global element is an element with a global scope. It is one that has been declared as part of the main schema rather than as part of a content model.">Adding global elements</a></div>
90<div><a href="../topics/taddelm.html" title="Elements are fundamental building blocks in XML. Element declarations provide value constraints, provide a description that can be used for validation, establish constraining relationships between related elements and attributes, and control the substitution of elements.">Adding elements</a></div>
91<div><a href="../topics/taddanye.html" title="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.">Adding an any element</a></div>
92<div><a href="../topics/taddglba.html" title="A global attribute is an attribute that can be recognized anywhere in a document. Once declared, a global attribute can be referenced in one or more declarations using an attribute reference.">Adding global attributes</a></div>
93</div>
94</div>
kprice159fa582006-05-08 21:30:45 +000095
96</body>
97</html>