Defining complexTypes That Contain Only Attributes

An XML Schema allows you to create groups of attributes. This makes it easy to create a complexType that contains only attributes. The first step is to create an attributeGroup. You can then create a complexType and add a reference to the attributeGroup to the complexType.

Diagram View

To define a complex type that contains only attributes:
1. Right-click the schema node .
2. In the shortcut menu, select Add > AttributeGroup.

Alternatives: This operation is also available from the XMLSchema > Diagram > Add > AttributeGroup menu and from the Add button .

The new attributeGroup is added to the XML Schema. It is displayed in the diagram and in the text pane (if you have it open). The properties for the new attributeGroup are displayed in the Properties window.

3. Right-click the new attributeGroup.
4. In the shortcut menu that appears, select Add > Attribute.

The new attribute is added to the attributeGroup.

Figure 221. attributeGroup with New Attribute

5. Make sure the new attribute is selected. In the Properties window, click the Data Type field.
6. Enter or select the type of the attribute.
7. Repeat step 3 through step 6 for each attribute that you want to be in the group.
9. Drag the attributeGroup to the complexType.

Tree View

To define a complex type that contains only attributes:
1. Click the Schema node.
2. In the left tool bar, click New Attribute Group . In the Tree view, Stylus Studio displays a field for new attributeGroup.
3. Enter a name for the attributeGroup.
4. In the left tool bar, click New Attribute Definition . In the Tree view, Stylus Studio displays a field for the new attribute definition.
5. Enter a name for the new attribute. Stylus Studio displays a scrollable, pop-up menu that lists the built-in simpleTypes and any previously defined simpleTypes.
6. Double-click the type of the new attribute.
7. For each additional attribute you want to add to the group, click the name of the attributeGroup in the Tree view, and repeat step 4 through step 6.
8. Click the Schema node.
9. In the left tool bar, click New complexType . In the Tree view, Stylus Studio displays a field for the new complexType.
10. Type a name for the new complexType and press Enter.
11. In the left tool bar, click New Reference to Attribute Group . Stylus Studio displays a pop-up menu that contains a list of attributeGroups.
12. Double-click the attributeGroup that you want this complexType to contain.

Forest & Paper Products

Many forest & paper product companies realize the best XML suite doesn't have "pay per" features. That's why these top forest & paper product companies choose Stylus Studio 2006 to get the world's best XML features all in one bundle!

EII - Enterprise Information Integration

Learn how to build EII applications with Stylus Studio's powerful Enterprise Information Integration Tools.

The Java Architecture for XML Binding (JAXB)

In this JAXB tutorial, we'll show you how easy it is to generate JAXB bindings!

Telecommunications Companies That Use Stylus Studio

Can you here me now? When it comes to telecommunications and XML it can get a little fuzzy. That's why these top telecommunication companies turn to Stylus Studio to connect them to their XML needs.

Stylus Most Wanted

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.