6.5. Attribute list

When an element is selected in the Insert, Rename, or All tabs of the element manager, you can display information about the defined attributes for elements of this type by clicking on the Attribute list button. A new dialog will open that contains a description of all available attributes for the selected element type.

Figure 6-3. The attribute list dialog

The Name column in this dialog contains the names of all attributes that were defined for the element type by the DTD. In well-formed XML documents, this column contains the names of all attributes that you have declared for the element type.

The Declared Value column describes the allowed attribute values for each attribute. It uses the following keywords from XML/SGML terminology:

cdata

The attribute value is a free-form string of character data. The string can contain entity references.

entity

The attribute value is the name of an entity. When providing the attribute value, do not supply the entity reference delimiters & and ;.

entities

The attribute value is a list of one or more entity names, separated by spaces.When providing the attribute value, do not supply the entity reference delimiters & and ;.

id

The attribute value is a symbolic identifier to be associated with the element. Each value must be unique in the document and it must adhere to the naming conventions of XML/SGML.

idref

The attribute value is a reference to a symbolic identifier for an element in the document.

idrefs

The attribute value is a series of one or more references to symbolic identifiers for elements in the document, separated by spaces.

name

The attribute value is a name that adheres to the SGML naming conventions.

Attributes of this type are not allowed to occur in XML documents.

names

The attribute value is a sequence of names that adhere to the SGML naming conventions, separated by spaces

Attributes of this type are not allowed to occur in XML documents.

nmtoken

The attribute value is a name with relaxed requirements for the first name character.

nmtokens

The attribute value is a list of names with relaxed requirements for the first character in each name.

number

The attribute value is a whole-number string.

Attributes of this type are not allowed to occur in XML documents.

numbers

The attribute value is a sequence of whole-number strings, separates by spaces.

Attributes of this type are not allowed to occur in XML documents.

nutoken

The attribute value is a number string with relaxed subsequent-character rules.

Attributes of this type are not allowed to occur in XML documents.

nutokens

The attribute value is a sequence of number string with relaxed subsequent-character rules, separated by spaces.

Attributes of this type are not allowed to occur in XML documents.

notation

The attribute value is a reference to a notation name declared in the document, indicating the data content notation of the current element.

nametokengroup

There exists a list of possible values for the attribute from which the value must be chosen, if it is supplied at all.

The column labeled Treatment describes how the attribute will be treated by an XML/SGML application if no value has been specified. This column can contain the following keywords:

required

The attribute value must be specified for every occurrence of the element in your document.

current

The value most recently supplied for this attribute on an element of the same type will be used as the default for the current element if no value is supplied. The first occurrence of the element must specify a value for this attribute.

Current attributes are not allowed in XML documents.

implied

It is optional to supply a value for this attribute. If the attribute values is not specified, an XML/SGML application should imply a suitable value if one is needed for processing.

conref

It is optional to supply a value for this attribute. If it is supplied, the element cannot have any content. The attribute value is usually assumed to provide information that enables retrieval of the element content.

Conref attributes can not occur in XML documents.

defaulted

It is optional to supply a value for this attribute and a default value has been declared for the attribute. This default value will be used if no other attribute value was specified.

fixed

This attribute has a fixed value that cannot be changed. The default value is the only possible value for the attribute.

The Default column provides the default value for the attribute if one is available.

In DTDless, well-formed XML documents only: It is possible to declare a new attribute for an element by clicking on the Add button in the attribute list dialog.

Note: New attributes can only be declared for DTDless XML documents. For XML and SGML documents, the attribute declarations are part of the DTD and cannot be altered.