Stylus Studio XML Editor

Table of contents

Appendices

3.5 AttributeUses

AttributeUses

An attribute use is a utility component which controls the occurrence and defaulting behavior of attribute declarations. It plays the same role for attribute declarations in complex types that particles play for element declarations.

NOTE: 
<xs:complexType>
 . . .
 <xs:attribute ref="xml:lang" use="required"/>
 <xs:attribute ref="xml:space" default="preserve"/>
 <xs:attribute name="version" type="xs:number" fixed="1.0"/>
</xs:complexType>
     

XML representations which all involve attribute uses, illustrating some of the possibilities for controlling occurrence.

The Attribute Use Schema Component[top]

The Attribute Use Schema Component

The attribute use schema component has the following properties:

[Attribute Use]

[required] determines whether this use of an attribute declaration requires an appropriate attribute information item to be present, or merely allows it.

[attribute] provides the attribute declaration itself, which will in turn determine the simple type definition used.

[au-value_constraint] allows for local specification of a default or fixed value. This must be consistent with that of the [attribute], in that if the [attribute] specifies a fixed value, the only allowed [au-value_constraint] is the same fixed value.

XML Representation of Attribute Use Components[top]

XML Representation of Attribute Use Components

Attribute uses correspond to all uses of [attribute] which allow a use attribute. These in turn correspond to two components in each case, an attribute use and its [attribute] (although note the latter is not new when the attribute use is a reference to a top-level attribute declaration). The appropriate mapping is described in [XML Representation of Attribute Declaration Schema Components].

Constraints on XML Representations of Attribute Uses[top]

Constraints on XML Representations of Attribute Uses

None as such.

Attribute Use Validation Rules[top]

Attribute Use Validation Rules Attribute Locally Valid (Use)

For an attribute information item to bevalid with respect to an attribute use its normalized value must match the canonical lexical representation of the attribute use's [au-value_constraint] value, if it is present and fixed.

Attribute Use Information Set Contributions[top]

Attribute Use Information Set Contributions

None as such.

Constraints on Attribute Use Schema Components[top]

Constraints on Attribute Use Schema Components

All attribute uses (see [AttributeUses]) must satisfy the following constraints.

Attribute Use Correct
  1. The values of the properties of an attribute use must be as described in the property tableau in [The Attribute Use Schema Component], modulo the impact of [Missing Sub-components].

  2. If the [attribute] has a fixed [a-value_constraint], then if the attribute use itself has a [au-value_constraint], it must also be fixed and its value must match that of the [attribute]'s [a-value_constraint].