contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
rule type   sgml-error    
  Related Syntax   Related Concepts  

Syntax

  sgml-error condition?
     log?
     local-declaration*
     action*


Purpose

A rule triggered when an SGML parsing error is found by the SGML parser. The OmniMark program can do several things in an sgml-error rule.

sgml-error is a deprecated form of the markup-error rule.

This rule is used as follows:

If the log keyword is specified at the beginning of the rule body, conventional error reporting is done in addition to the actions that follow.

If there is more than one sgml-error rule in an OmniMark program, the first sgml-error rule with no condition or a condition of "true" is performed. If there are no sgml-error rules that can be performed, conventional error reporting is done.

When the document instance has SGML errors, the programmer can still obtain control in the document-end rule or in the do sgml-parse action to determine how to complete the processing. This allows the program to "clean up properly" while still reporting as many errors as possible before terminating the parsing of the current document.

This SGML error rule instructs OmniMark to report an error in the usual fashion. It also outputs the fixed and variable parts of the error message, as well as its line number, in a form that can be accessed by other software. If the variable part of the message is not available, it is not provided.

  sgml-error
    log
    output "\message{%g(#message) on line %d(#line-number)"
    output "%n%g(#additional-info)"
           when #additional-info is attached
    output "}"

#class = 0 reports are always passed to sgml-error rules, even if the -warnings command-line option has not been used. This sample shows how to modify OmniMark to ignore these warnings.

Note that specifying log in an sgml-error rule has no effect on warning reports unless the command-line option "-warning" is included.

  sgml-error unless #class = 0

    Related Syntax
   #error
   document-end
   do sgml-parse
   #sgml
   markup-error
 
Related Concepts
   XML/SGML error message: retrieving parts of
   XML/SGML error rules: predefined pattern variables
   XML/SGML errors: processing
 
----

Top [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:01:16 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.