XML attribute types

Understand the different types of element attributes.

An attribute’s type determines the kind of values that are allowed in the attribute. For example, the value version 1 is not valid for an attribute defined as an integer, but the value 1 is valid. Numeric types (such as integer or real number) can also be limited to a predefined range by their attribute definition.

Choice

An attribute with a list of predefined values.

ID Reference

An attribute with a value that is a Unique ID value from another element. It is typically used for element-based cross-references.

ID References

An attribute with a value of one or more Unique ID values from another element. Sometimes the developer specifies this attribute if you’re exporting to a Structured Application that uses multiple values for source information.

Integer

An attribute with a whole number value (no decimal parts). Examples of valid integers are 22, -22, and +322. An integer can be defined to fall within a range.

Integers

An attribute with a value of one or more integers. Enter each number on a separate line in the Attribute Value box.

Real

An attribute with a real number value, with or without a decimal part (the value can also be expressed in scientific notation). Examples of valid real numbers are 2, 22.4, -0.22, and 2.3e-1. A real number can be defined to fall within a range.

Reals

An attribute with a value of one or more real numbers. Enter each number on a separate line in the Attribute Value box.

String

An attribute with a value of a series of characters (text).

Strings

An attribute with a value of one or more strings. Enter each string on a separate line in the Attribute Value box.

Unique ID

An attribute with a value of a unique text string. An element can have only one ID attribute (which can be of type Unique ID or Unique IDs). All ID values must be unique in the document or book. An element with a Unique ID attribute can be the source for an element-based cross-reference.

Unique IDs

An attribute with a value of one or more unique text strings. Enter each string on a separate line in the Attribute Value box. Sometimes the developer specifies this attribute if you’re exporting to a Structured Application that uses multiple values for source information.