swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     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.

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 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.