blob: 500b3b01b819238f356561cf5a43b03d7acce158 [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 attribute groups" />
12<meta name="abstract" content="An attribute group definition is an association between a name and a set of attribute declarations. Named groups of attribute declarations can greatly facilitate the maintenance and reuse of common attribute declarations in an XML schema." />
13<meta name="description" content="An attribute group definition is an association between a name and a set of attribute declarations. Named groups of attribute declarations can greatly facilitate the maintenance and reuse of common attribute declarations in an XML schema." />
14<meta content="XML schema editor, adding, attribute groups, attributes groups, XML schema files, attribute groups, XML schema files, attributes groups" name="DC.subject" />
15<meta content="XML schema editor, adding, attribute groups, attributes groups, XML schema files, attribute groups, XML schema files, attributes groups" name="keywords" />
16<meta content="XHTML" name="DC.Format" />
17<meta content="taddagrp" name="DC.Identifier" />
18<meta content="en-us" name="DC.Language" />
19<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
syeshind0bdb8e2005-10-27 17:44:14 +000020<title>Adding attribute groups</title>
syeshin8f077832005-09-06 04:22:45 +000021</head>
syeshinf3d0d4b2005-07-27 18:33:03 +000022<body id="taddagrp"><a name="taddagrp"><!-- --></a>
23
kprice159fa582006-05-08 21:30:45 +000024
syeshind0bdb8e2005-10-27 17:44:14 +000025<h1 class="topictitle1">Adding attribute groups</h1>
kprice159fa582006-05-08 21:30:45 +000026
27
28
29
syeshinf3d0d4b2005-07-27 18:33:03 +000030<div><p>An attribute group definition is an association between a name
syeshind0bdb8e2005-10-27 17:44:14 +000031and a set of attribute declarations. Named groups of attribute declarations
32can greatly facilitate the maintenance and reuse of common attribute declarations
33in an XML schema.</p>
kprice159fa582006-05-08 21:30:45 +000034
syeshind0bdb8e2005-10-27 17:44:14 +000035<div class="section"><p>The following instructions were written for the Resource perspective,
36but they will also work in many other perspectives.</p>
kprice159fa582006-05-08 21:30:45 +000037<p>To add an attribute
38group to an XML schema, follow these steps:</p>
syeshinf3d0d4b2005-07-27 18:33:03 +000039</div>
kprice159fa582006-05-08 21:30:45 +000040
41<ol>
42<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
43
44<li class="stepexpand"><span>In the Outline view, right-click the <span class="uicontrol">Attribute Groups</span> folder
45and click <span class="uicontrol">Add Attribute Group</span>.</span> It appears
46in the <span class="uicontrol">Attribute Groups</span> folder.</li>
47
kprice43d0c0f2006-05-18 15:56:09 +000048<li class="stepexpand"><span>Select your new group, and in the Design view, right-click the
49attribute group and select <span class="menucascade"><span class="uicontrol">Refactor</span> &gt; <span class="uicontrol">Rename</span>
kprice159fa582006-05-08 21:30:45 +000050</span>. In the <span class="uicontrol">New Name</span> field, type a name
51for the attribute group.</span></li>
52
53<li class="stepexpand"><span>To add an attribute, right-click your attribute group in the Outline
54view, click <span class="uicontrol">Add Attribute</span>.</span> The attribute
55appears below the attribute group in the Outline view.
56<ol type="a">
kprice43d0c0f2006-05-18 15:56:09 +000057<li class="substepexpand"><span>Select the attribute, and in the Design view, click the current
kprice159fa582006-05-08 21:30:45 +000058(default) name of the attribute, then type the new <span class="uicontrol">Name</span>.</span>
59</li>
60
kprice43d0c0f2006-05-18 15:56:09 +000061<li class="substepexpand"><span>In the Design view, click the current (default) attribute type
kprice159fa582006-05-08 21:30:45 +000062and select a type from the menu. Alternately, you can select browse to invoke
63the Set Type menu for more options.</span> The Set Type dialog lists all
64built-in and user-defined types currently available. You can change the <span class="uicontrol">Scope</span> of
65the list by selecting one of the following options:<ul>
66<li><span class="uicontrol">Workspace</span>. Lists all of the types available in
67your workspace. </li>
68
69<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types available
70in the project that contains your file. </li>
71
72<li>(Default) <span class="uicontrol">Current Resource</span>. List all of the types
73available in your current file.</li>
74
75<li><span class="uicontrol">Working Sets</span>. List all the types available within
76the selected working set.</li>
77
78</ul>
79</li>
80
81</ol>
82
83</li>
84
85<li class="stepexpand"><span>An attribute reference provides a reference to a global attribute.
kprice43d0c0f2006-05-18 15:56:09 +000086To add an attribute reference, in the Design view, right-click the complex
kprice159fa582006-05-08 21:30:45 +000087type containing the element, and click <span class="uicontrol">Add Attribute Ref</span>.</span>
88 A declaration that references a global attribute enables the referenced
89attribute to appear in the instance document in the context of the referencing
kprice43d0c0f2006-05-18 15:56:09 +000090declaration. Select the reference, then select the attribute group you want
91it to reference in the Properties view, from the<span class="uicontrol">Ref</span> menu.
kprice159fa582006-05-08 21:30:45 +000092</li>
93
94<li class="stepexpand"><span>An attribute group reference provides a reference to an attribute
kprice43d0c0f2006-05-18 15:56:09 +000095group. To add an attribute group reference, in the Design view, right-click
kprice159fa582006-05-08 21:30:45 +000096the complex type containing the element, and click <span class="uicontrol">Add Attribute
97Group Ref</span>.</span> A declaration that references a global attribute
98enables the referenced attribute to appear in the instance document in the
kprice43d0c0f2006-05-18 15:56:09 +000099context of the referencing declaration. Select the reference, then select
100the attribute group you want it to reference in the Properties view, from
101the<span class="uicontrol">Ref</span> menu.</li>
kprice159fa582006-05-08 21:30:45 +0000102
103<li class="stepexpand"><span>An <samp class="codeph">any</samp> element enables element content according
104to namespaces, and the corresponding <samp class="codeph">any</samp> attribute element
105enables attributes to appear in elements. To add an <samp class="codeph">any</samp> attribute,
106right-click your attribute group and click <span class="uicontrol">Add Any Attribute</span>.</span>
107 The <samp class="codeph">any</samp> appears below the attribute group in the Outline
108view. You can specify the following values for an <samp class="codeph">any</samp> attribute:
syeshind0bdb8e2005-10-27 17:44:14 +0000109<ul>
kprice43d0c0f2006-05-18 15:56:09 +0000110<li>For a <span class="uicontrol">namespace</span> value, you can
111select:<ul>
112<li><strong>##any</strong>. This allows any well-formed XML from any namespace.</li>
kprice159fa582006-05-08 21:30:45 +0000113
kprice43d0c0f2006-05-18 15:56:09 +0000114<li><strong>##local </strong>. This allows any well-formed XML that is not declared
115to be in a namespace.</li>
116
117<li><strong>##other</strong>. This allows any well-formed XML that is not from the target
118namespace of the type being defined.</li>
119
120<li><strong>##targetNamespace </strong>. This is shorthand for the target namespace
121of the type being defined.</li>
122
123</ul>
124</li>
125
126<li>For a <span class="uicontrol">processContents</span> value, you can select:<ul>
127<li><strong>skip</strong>. The XML processor will not validate the attribute content
128at all.</li>
129
130<li><strong>lax</strong>. The XML processor will validate the attribute content as much
131as it can.</li>
132
133<li><strong>strict</strong>. The XML processor will validate all the attribute content.</li>
134
135</ul>
136</li>
kprice159fa582006-05-08 21:30:45 +0000137
syeshinf3d0d4b2005-07-27 18:33:03 +0000138</ul>
kprice159fa582006-05-08 21:30:45 +0000139
140</li>
141
syeshinf3d0d4b2005-07-27 18:33:03 +0000142</ol>
kprice159fa582006-05-08 21:30:45 +0000143
syeshinf3d0d4b2005-07-27 18:33:03 +0000144</div>
kprice159fa582006-05-08 21:30:45 +0000145
146
syeshinf3d0d4b2005-07-27 18:33:03 +0000147</body>
148</html>