swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

relaxng.validator

 
 

Library: RELAX NG (OMRELAXNG)
Import: omrelaxng.xmd
Return type: markup sink

Returns: A markup sink ready to receive parsed markup for validation.


Declaration

export dynamic markup sink function
   validator          against value schema-type schema-instance
             case-insensitive value switch      is-case-insensitive optional initial { false }
             report-errors-to value markup sink errors              optional
    


Purpose

Use validator to validate an SGML or XML instance against a RELAX NG schema.

Example

This program validates sgml input against a RELAX NG schema, reports any errors and keeps going:

  import "omrelaxng.xmd" prefixed by relaxng.
  
  
  define markup sink function
     error-reporter (value string sink s)
  as
     using output as s
     do markup-parse #current-input
        output "%c"
     done
  
  
  process
     local relaxng.relaxng-schema-type example-schema
  
     set example-schema to relaxng.compile-schema file "example-schema.rng"
  
     using output as relaxng.validator against example-schema report-errors-to error-reporter (#error)
     do xml-parse scan file "example-input.xml"
        output #content
     done 
            

    Related Syntax
 
  Other Library Functions
 
 

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

OmniMark 9.0β Documentation Generated: September 16, 2008 at 1:39:16 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.