data-attributes

built-in shelf

Purpose

Allows all declared attributes of entities named in an entity or entities attribute of an element to be treated as a shelf (to a certain extent), as follows:

  • The name of the attribute is named as key.
  • The value of the attribute is obtained from the value of the item.

The key value used to index data-attributes should always be uppercased when SGML parsing is involved and when the SGML declaration specifies NAMECASE GENERAL YES for the SGML document being processed. Unlike names in OmniMark programs, string values used as keys are not automatically uppercased - - doing so is the OmniMark programmer's responsibility. Uppercasing can be done by directly entering the appropriately uppercased values or by using the u format modifier.

The data-attributes shelf differs from other shelves in not having a current item. In addition, even though some of the items on the data-attributes shelf may be list-valued, "double-indexing" is not allowed. The using prefix can be used to accomplish double-indexing.

To reference the attributes of a specific entity named in an entity or entities attribute, the data-attributes shelf can be qualified in the same ways as data-attribute references.

The data-attributes shelf is indexed as follows:

  • data-attribute values are indexed in the order in which the attributes are declared when the specified qualifier is not given
  • data-attribute values are indexed in the order in which they occur in the external entity's declaration when the specified qualifier is given

The following illustrations how a repeat over can be used to iterate over the data-attributes shelf:

  repeat over specified data-attributes of (attribute ref) as this-one
     output key of data-attribute this-one
     output "='%v(this-one)'%n"
  again

Related Syntax