Attribute Properties

You can modify an object's properties from its property sheet. To open an attribute property sheet, double-click its diagram symbol or its Browser entry in the Attributes folder beneath an entity or complex type.

The General tab contains the following properties:

Property

Description

Name

The name of the item which should be clear and meaningful, and should convey the item's purpose to non-technical users.

Code

The technical name of the item used for generating code or scripts, which may be abbreviated, and should not generally include spaces.

Comment

Descriptive label of the attribute.

Stereotype

Sub-classification used to extend the semantics of an object without changing its structure. It can be predefined or user-defined.

Reference

Name of an attribute in the current model or another model opened in the workspace. A reference allows you to reuse an attribute with all its properties without having to define it again. Use the list to select an attribute in the current model. Use the Browse tool to select an attribute from any model opened in the workspace. If you select an attribute from another model, a shortcut is created with the referencing attribute. When you define a reference, the name and code are those of the target attribute and these properties are grayed.

Type

Attribute data type, which must be a qualified name. Use the list to select a built-in data type. Use the Browse tool to select a simple type defined in the current model or another model opened in the workspace.

Embedded Type

If selected, the attribute data type disappears and a <simple type> tag is created in the schema within the <attribute> tag. Only available in a model targeted with XSD.

Derivation

Derivation method for the attribute data type. Used to extend or restrict the values of the attribute data type. When you define a derivation, the data type disappears. You must click Apply and then the Properties tool to select a type, a base type or member types for the corresponding derivation (list, restriction or union). Only available in a model targeted with XSD.

Detail Tab

The Detail tab of an attribute property sheet displays the following properties:

Property

Description

Default

Default value. Enter a default value only if there is no fixed value.

Fixed

Fixed value. Enter a fixed value only if there is no default value.

Use

Indicator of how the attribute is used.

If you select Optional, the attribute is optional and may have any value. If you select Prohibited, the attribute cannot be used. Use this value to prohibit the use of an existing attribute in the restriction of another complex type. If you select Required, the attribute must appear at least once and may have any value matching its data type.

Form

Form of the attribute. If you select Qualified, Form must be qualified by combining the target namespace of the schema with the no-colon-name of the attribute. If you select Unqualified, Form is not required to be qualified with the namespace prefix and is matched against the no-colon-name of the attribute.

ID

ID of the attribute. Its value must be of type ID and unique within the model containing the attribute.

Attribute Property Sheet Values Tab

The Values tab of an attribute property sheet is only available in a model targeted with DTD or XDR. You can set a list of predefined values for an attribute.

Note:

In a model targeted with the XML-Data Reduced language, there is also a Values tab in the element property sheet.

Defining Attributes in XDR Files

In an XML-Data Reduced language model, attributes tags are defined by different attributes:

XDR attribute attribute

Description

name

Specifies the name of the attribute.

Tab: General

Field: Name

default

Specifies a default value for the attribute.

Tab: Detail

Field: Default

dt:type

Specifies a type for the attribute.

Tab: General

Field: Type

dt:values

To specify a list of available values for a global attribute

Tab: General

Field: Values

type

Specifies the name of a global attribute as a reference for a local attribute.

Tab: General

Field: Reference

The following example shows an XDR file: