swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax    
operator  

content is

 
 

Return type: Switch
Returns:       True if the content is of the specified type; false otherwise. Using isnt rather than is reverses the results

Syntax

content element-qualifier* (is | isnt) (content-type | content-type-list)


Purpose

Tests an element's declared content type or content model type. It can also be used to determine if an element has a conref attribute, in which case the element is effectively EMPTY, no matter what its declared type is.

The content type can be:

A content-type-list is a list of content types separated by or or "|", or by and or "&".

If element qualifiers are specified, the test applies to the qualified element. Otherwise, the current element is tested.

The following down-translate program illustrates how content is tests can be used to provide an analysis of every element in a document:

  down-translate
  
  element #implied
     output "%n<%q>: "
     do when content is element
       output "element"
     else when content is any
       output "any"
     else when content is mixed
       output "mixed"
     else when content is cdata
       output  "cdata"
     else when content is rcdata
       output "rcdata"
     else when content is empty
       output "empty"
     done
     output " (conref)" when content is conref
     output "%n"
  
     ; Finally, process the content:
     output "%c"

    Related Syntax
   any
   cdata
   is conref
   element
 
 
 

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

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

Copyright © Stilo International plc, 1988-2008.