swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax    
rule  

processing-instruction

 
 

Syntax

processing-instruction pattern condition?
  action*

processing-instruction (named pattern)? (valued pattern)? condition?
  action*


Purpose

A rule selected when a processing instruction occurs whose entire text matches the specified pattern and the specified condition is satisfied. As with other rules, OmniMark performs processing-instruction rules in the order in which they occur in the program.

processing-instruction rules are not permitted in cross-translations.

Suppose an SGML document contained "<?newpage>" processing instructions. An OmniMark down-translation that processes these processing instructions could contain the following rule:

  processing-instruction "newpage"
     output "\newpage{}"

A corresponding XML document would contain "<?newpage?>" processing instructions. An OmniMark down-translation that processes these processing instructions could contain the same rule as the one we used for SGML, because OmniMark processes XML and SGML with the same syntax.

The following example illustrates recreating the original processing instruction entity reference if a processing instruction was entered with such a reference, and recreating the processing instruction itself in all other cases:

  processing-instruction named any* => pi-entity-name
     output "&%g(pi-entity-name);"
  processing-instruction valued any* => pi-text
     output "<?%g(pi-text)>"

The pattern following the keyword valued does not need to match the entire processing instruction text, only its prefix.

    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.