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

relaxng.compile-schema

 
 

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

Returns: compiled RELAX NG schema


Declaration

export relaxng-schema-type function
   compile-schema value string source schema-input
    


Purpose

Use compile-schema to compile a RELAX NG schema specified in XML format, so that you may validate XML input against it. Compiling the schema also serves to validate the schema itself.

If the schema is invalid and cannot be compiled, compile-schema throws the compile-error exception.

Example

In this example we compile the schema "my-schema" and validate XML input against it, reporting any errors along the way:

  import "omrelaxng.xmd" prefixed by relaxng.
  
  process
     local relaxng.relaxng-schema-type example-schema
  
     set example-schema to relaxng.compile-schema file "example-schema.rng"
  
     do xml-parse scan file "example-input.xml"
        do markup-parse relaxng.validated #content against example-schema
           output "%c"
        done
     done
  
  element #implied
     output "%c"
            

    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.