blob: 8ed1076a33b9046c6a368f3ef59f71a1cb6cfd84 [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
kpricede20a692008-04-24 00:27:47 +00002<!--Arbortext, Inc., 1988-2006, v.4002-->
kprice647b7352006-05-17 21:27:16 +00003<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
4 "task.dtd">
kprice159fa582006-05-08 21:30:45 +00005<task id="taddagrp" xml:lang="en-us">
6<title>Adding attribute groups</title>
7<titlealts>
8<searchtitle>Adding attribute groups</searchtitle>
9</titlealts>
10<shortdesc>An attribute group definition is an association between a name
11and a set of attribute declarations. Named groups of attribute declarations
12can greatly facilitate the maintenance and reuse of common attribute declarations
13in an XML schema.</shortdesc>
14<prolog><metadata>
kprice9623e9d2007-05-03 03:43:05 +000015<keywords><indexterm>XML schema editor<indexterm>attribute groups</indexterm></indexterm>
16<indexterm>XML schema files<indexterm>attribute groups</indexterm></indexterm>
kprice159fa582006-05-08 21:30:45 +000017</keywords>
18</metadata></prolog>
19<taskbody>
20<context><p>The following instructions were written for the Resource perspective,
21but they will also work in many other perspectives.</p><p>To add an attribute
kpricede20a692008-04-24 00:27:47 +000022group to an XML schema, complete the following steps:</p></context>
kprice159fa582006-05-08 21:30:45 +000023<steps>
24<step><cmd>Open your XML schema in the XML schema editor.</cmd></step>
kpricede20a692008-04-24 00:27:47 +000025<step><cmd>In the Outline view, right-click the <uicontrol>Attributes</uicontrol> folder
kprice159fa582006-05-08 21:30:45 +000026and click <uicontrol>Add Attribute Group</uicontrol>.</cmd><info>It appears
kpricede20a692008-04-24 00:27:47 +000027in the <uicontrol>Attributes</uicontrol> folder.</info></step>
kprice647b7352006-05-17 21:27:16 +000028<step><cmd>Select your new group, and in the Design view, right-click the
29attribute group and select <menucascade><uicontrol>Refactor</uicontrol><uicontrol>Rename</uicontrol>
kprice159fa582006-05-08 21:30:45 +000030</menucascade>. In the <uicontrol>New Name</uicontrol> field, type a name
kpricede20a692008-04-24 00:27:47 +000031for the attribute group and click <uicontrol>OK</uicontrol>.</cmd></step>
kprice159fa582006-05-08 21:30:45 +000032<step><cmd>To add an attribute, right-click your attribute group in the Outline
33view, click <uicontrol>Add Attribute</uicontrol>.</cmd><info>The attribute
34appears below the attribute group in the Outline view.</info>
35<substeps>
kprice647b7352006-05-17 21:27:16 +000036<substep><cmd>Select the attribute, and in the Design view, click the current
kprice159fa582006-05-08 21:30:45 +000037(default) name of the attribute, then type the new <uicontrol>Name</uicontrol>.</cmd>
38</substep>
kprice647b7352006-05-17 21:27:16 +000039<substep><cmd>In the Design view, click the current (default) attribute type
kprice159fa582006-05-08 21:30:45 +000040and select a type from the menu. Alternately, you can select browse to invoke
41the Set Type menu for more options.</cmd><info>The Set Type dialog lists all
42built-in and user-defined types currently available. You can change the <uicontrol>Scope</uicontrol> of
43the list by selecting one of the following options:<ul>
44<li><uicontrol>Workspace</uicontrol>. Lists all of the types available in
45your workspace. </li>
46<li><uicontrol>Enclosing Project</uicontrol>. Lists all of the types available
47in the project that contains your file. </li>
kpricede20a692008-04-24 00:27:47 +000048<li><uicontrol>Current Resource</uicontrol> (default). List all of the types
kprice159fa582006-05-08 21:30:45 +000049available in your current file.</li>
50<li><uicontrol>Working Sets</uicontrol>. List all the types available within
51the selected working set.</li>
52</ul></info></substep>
53</substeps>
54</step>
55<step><cmd>An attribute reference provides a reference to a global attribute.
kprice647b7352006-05-17 21:27:16 +000056To add an attribute reference, in the Design view, right-click the complex
kprice159fa582006-05-08 21:30:45 +000057type containing the element, and click <uicontrol>Add Attribute Ref</uicontrol>.</cmd>
58<info>A declaration that references a global attribute enables the referenced
59attribute to appear in the instance document in the context of the referencing
kpricede20a692008-04-24 00:27:47 +000060declaration. Select the reference, then in the Properties view, select the
61attribute you want it to reference from the<uicontrol>Reference</uicontrol> drop-down</info>
kprice159fa582006-05-08 21:30:45 +000062</step>
63<step><cmd>An attribute group reference provides a reference to an attribute
kprice647b7352006-05-17 21:27:16 +000064group. To add an attribute group reference, in the Design view, right-click
kprice159fa582006-05-08 21:30:45 +000065the complex type containing the element, and click <uicontrol>Add Attribute
66Group Ref</uicontrol>.</cmd><info>A declaration that references a global attribute
67enables the referenced attribute to appear in the instance document in the
kpricede20a692008-04-24 00:27:47 +000068context of the referencing declaration. Select the reference, then in the
69Properties view, select the attribute group you want it to reference from
70the<uicontrol>Reference</uicontrol> drop-down.</info></step>
kprice159fa582006-05-08 21:30:45 +000071<step><cmd>An <codeph>any</codeph> element enables element content according
72to namespaces, and the corresponding <codeph>any</codeph> attribute element
73enables attributes to appear in elements. To add an <codeph>any</codeph> attribute,
74right-click your attribute group and click <uicontrol>Add Any Attribute</uicontrol>.</cmd>
75<info>The <codeph>any</codeph> appears below the attribute group in the Outline
76view. You can specify the following values for an <codeph>any</codeph> attribute:</info>
77<choices>
kpricede20a692008-04-24 00:27:47 +000078<choice>For a <uicontrol>namespace</uicontrol> value, you can select:<ul>
79<li><b>##any</b>: this allows any well-formed XML from any namespace.</li>
80<li><b>##local </b>: this allows any well-formed XML that is not declared
kprice647b7352006-05-17 21:27:16 +000081to be in a namespace.</li>
kpricede20a692008-04-24 00:27:47 +000082<li><b>##other</b>: this allows any well-formed XML that is not from the target
kprice647b7352006-05-17 21:27:16 +000083namespace of the type being defined.</li>
kpricede20a692008-04-24 00:27:47 +000084<li><b>##targetNamespace </b>: this is shorthand for the target namespace
kprice647b7352006-05-17 21:27:16 +000085of the type being defined.</li>
86</ul></choice>
87<choice>For a <uicontrol>processContents</uicontrol> value, you can select:<ul>
kpricede20a692008-04-24 00:27:47 +000088<li><b>skip</b>: t<?Pub Caret?>he XML processor will not validate the attribute
89content at all.</li>
90<li><b>lax</b>: the XML processor will validate the attribute content as much
kprice647b7352006-05-17 21:27:16 +000091as it can.</li>
kpricede20a692008-04-24 00:27:47 +000092<li><b>strict</b>: the XML processor will validate all the attribute content.</li>
kprice647b7352006-05-17 21:27:16 +000093</ul></choice>
kprice159fa582006-05-08 21:30:45 +000094</choices>
95</step>
96</steps>
97</taskbody>
98</task>
kpricede20a692008-04-24 00:27:47 +000099<?Pub *0000005543?>