swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
Prerequisite Concepts     Related Topics  

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
 
  Related Topics
 
 

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

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:35:14 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.