swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Topics   Other Library Functions  
catch name  

relaxng.compile-error

 
 

Library: RELAX NG (OMRELAXNG)
Import: omrelaxng.xmd

Declaration

export catch compile-error (value integer error-code,
                            value string  error-message, 
                            value string  error-detail)
    


Purpose

The compile-error exception is thrown by compile-schema if the schema is not a valid RELAX NG schema. The following example demonstrates how compile-error can be used to make processing more robust.

  import "omrelaxng.xmd" prefixed by relaxng.
  
  process
     local relaxng.relaxng-schema-type example-schema
  
  
     do xml-parse scan file "example-input.xml"
        set example-schema to relaxng.compile-schema file "example-schema.rng"
  
        do markup-parse relaxng.validated #content against example-schema
           output "%c"
        done
  
      catch relaxng.compile-error (code, message, detail)
        log-message "Input processing will proceeed without validation because of a schema compilation error:%n"
                 || message
        do markup-parse #content
           output "%c"
        done
     done
  
  element #implied
     output "%c"
            

The error-code and error-message arguments of the catch can contain the following error codes and descriptions:

    Related Topics
 
Other Library Functions
 
 

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

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

Copyright © Stilo International plc, 1988-2010.