WebSphere Message Brokers
File: ad10420_
Writer: Terry Cowling

Concept topic

This build: July 31, 2007 21:23:50

Message model objects: attributes

An attribute describes an XML attribute, or any simple element within a message.

Attributes are provided to simplify the modeling of XML messages - if none of your messages use the XML physical format, you should consider using simple elements instead.

Attributes and XML

The most common use for an attribute is to model an XML attribute within an XML message. In this scenario, each attribute which can appear in the XML message has a corresponding attribute in the logical message definition.

Attributes in other physical formats

Sometimes a message needs to be parsed as XML but written in another physical format (Custom Wire Format or Tagged Delimited String Format). In this case, any attributes in the message will be treated exactly like simple elements with the same properties.

Global and local attributes

Attributes can be global or local.

A global attribute can be used in more than one place in the message model. It must be given a unique name by which it can be referenced.

A local attribute is defined in one position within one complex type, and is not available for reuse elsewhere in the message model.

Optional and repeating elements

Attributes can be defined as optional, required or prohibited. Attributes are not allowed to repeat. For further information, see Cardinality: optional, repeating and mandatory elements.

Default and fixed values

An attribute can be given a default value, so that if the attribute is missing from the input message, the default will be used. Alternatively, a fixed value can be defined, and the attribute will always take that value.

Value constraints

An attribute's value can be constrained by using value constraints which define the range of legal values for the attribute. The value constraints are actually associated with the simple type on which the attribute is based. For further details, see Message model objects: simple types.

XML Schema Model

In the message definition file, an attribute is modeled as an XML schema attribute declaration. Fixed and default values are modeled using a value constraint on the attribute. Value constraints are modeled as facets on the attribute's simple type.

Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:23:50

ad10420_ This topic's URL is: