swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
Prerequisite Concepts     Related Syntax  

Attributes: type tests

It is possible to test for the type of an element attribute or data attribute. An attribute can be declared with one of the following types:

An attribute can also be declared as a name token group. (A name token group attribute can only have one of the values specified in the parenthesized list of names.)

If the specified attribute was not declared for the qualified element (or entity), or if the qualified element does not exist, then an error message is printed and OmniMark halts. The error message can be avoided by using the is specified, is defaulted, or is implied tests.

Attribute type tests can be combined by separating the types with or or | and parenthesizing them. Note that for a data attribute, a test of its type for ID, IDREF, IDREFS, NOTATION, ENTITY, or ENTITIES will always fail, because those types of attributes cannot be associated with a notation.

Entity and notation attribute tests can be applied directly to attribute values which are declared as ENTITY or NOTATION, or directly to an item of an attribute declared as ENTITIES. It is usually wise to test that the attribute value is an ENTITY, ENTITIES, or NOTATION attribute before applying the entity or notation test.

Attribute type tests can be combined by separating the types with the or keyword or its short form, the | symbol. For example:

  do when attribute id is (idref | idrefs)
  ...
  done

Prerequisite Concepts
   Data attributes associated with entity attributes
   Notations
 
  Related Syntax
   attribute
   data-attribute
   is specified
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:25:49 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.