swirl
Guide to OmniMark 9   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
 
 
 

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

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

Copyright © Stilo International plc, 1988-2010.