blob: 723b39aef5228721d7f6c639a6a70d6fd73a0fe5 [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, 2009 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, 2009" />
<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 attribute groups" />
<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." />
<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." />
<meta content="XML schema editor, attribute groups, XML schema files" name="DC.subject" />
<meta content="XML schema editor, attribute groups, XML schema files" name="keywords" />
<meta content="XHTML" name="DC.Format" />
<meta content="taddagrp" 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 attribute groups</title>
</head>
<body id="taddagrp"><a name="taddagrp"><!-- --></a>
<h1 class="topictitle1">Adding attribute groups</h1>
<div><p>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.</p>
<div class="section"><p>The following instructions were written for the Resource
perspective, but they will also work in many other perspectives.</p>
<p>To
add an attribute group to an XML schema, complete the following steps:</p>
</div>
<ol>
<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
<li class="stepexpand"><span>In the Outline view, right-click the <span class="uicontrol">Attributes</span> folder
and click <span class="uicontrol">Add Attribute Group</span>. </span> It
appears in the <span class="uicontrol">Attributes</span> folder.</li>
<li class="stepexpand"><span>Select your new group, and in the Design view, right-click
the attribute group and select <span class="menucascade"><span class="uicontrol">Refactor</span>
&gt; <span class="uicontrol">Rename</span></span>. In the <span class="uicontrol">New
Name</span> field, type a name for the attribute group and click <span class="uicontrol">OK</span>.</span>
</li>
<li class="stepexpand"><span>To add an attribute, right-click your attribute group in
the Outline view, click <span class="uicontrol">Add Attribute</span>. </span>
The attribute appears below the attribute group in the Outline
view.
<ol type="a">
<li class="substepexpand"><span>Select the attribute, and in the Design view, click
the current (default) name of the attribute, then type the new <span class="uicontrol">Name</span>.</span>
</li>
<li class="substepexpand"><span>In the Design view, click the current (default) attribute
type and select a type from the menu. Alternately, you can select
browse to invoke the Set Type menu for more options. </span> The
Set Type dialog lists all built-in and user-defined types currently
available. You can change the <span class="uicontrol">Scope</span> of the
list by selecting one of the following options:<ul>
<li><span class="uicontrol">Workspace</span>. Lists all of the types available
in your workspace. </li>
<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types
available in the project that contains your file. </li>
<li><span class="uicontrol">Current Resource</span> (default). List all of
the types available in your current file.</li>
<li><span class="uicontrol">Working Sets</span>. List all the types available
within the selected working set.</li>
</ul>
</li>
</ol>
</li>
<li class="stepexpand"><span>An attribute reference provides a reference to a global
attribute. To add an attribute reference, in the Design view, right-click
the complex type containing the element, and click <span class="uicontrol">Add
Attribute Ref</span>. </span> A declaration that references
a global attribute enables the referenced attribute to appear in the
instance document in the context of the referencing declaration. Select
the reference, then in the Properties view, select the attribute you
want it to reference from the <span class="uicontrol">Reference</span> list.</li>
<li class="stepexpand"><span>An attribute group reference provides a reference to an
attribute group. To add an attribute group reference, in the Design
view, right-click the complex type containing the element, and click <span class="uicontrol">Add
Attribute Group Ref</span>. </span> A declaration that references
a global attribute enables the referenced attribute to appear in the
instance document in the context of the referencing declaration. Select
the reference, then in the Properties view, select the attribute group
you want it to reference from the <span class="uicontrol">Reference</span> list.
</li>
<li class="stepexpand"><span>An <samp class="codeph">any</samp> element enables element content
according to namespaces, and the corresponding <samp class="codeph">any</samp> attribute
element enables attributes to appear in elements. To add an <samp class="codeph">any</samp> attribute,
right-click your attribute group and click <span class="uicontrol">Add Any Attribute</span>. </span>
The <samp class="codeph">any</samp> appears below the attribute group in
the Outline view. You can specify the following values for an <samp class="codeph">any</samp> attribute:
<ul>
<li>For a <span class="uicontrol">Namespace</span> value, you can select:<ul>
<li><strong>##any</strong>: this allows any well-formed XML from any namespace.</li>
<li><strong>##local </strong>: this allows any well-formed XML that is not declared
to be in a namespace.</li>
<li><strong>##other</strong>: this allows any well-formed XML that is not from
the target namespace of the type being defined.</li>
<li><strong>##targetNamespace </strong>: this is shorthand for the target namespace
of the type being defined.</li>
</ul>
</li>
<li>For a <span class="uicontrol">Process Contents</span> value, you can
select:<ul>
<li><strong>skip</strong>: the XML processor will not validate the attribute
content at all.</li>
<li><strong>lax</strong>: the XML processor will validate the attribute content
as much as it can.</li>
<li><strong>strict</strong>: the XML processor will validate all the attribute
content.</li>
</ul>
</li>
</ul>
</li>
</ol>
</div>
</body>
</html>