#schema

built-in entity

Syntax
external-text-entity #schema
or
entity is #schema


Purpose

You can use #schema to retrieve a schema for an XML document or to test if an external text entity represents an XML Schema.

To retrieve an XML schema that is referenced by an XML document, you can use #schema as an argument to an external-text-entity rule:

  external-text-entity #schema 
     output file "%eq"

The code above will retrieve the URI of the schema (as "%eq") and attempt to open a file with that name. The contents of the file is then sent to the parser. (The parser is the default output scope in an external-text-entity rule.) If the URI is not a local file name, then you must take the approriate steps to interpret the URI and locate the schema.

To test if an external text entity is a schema, you can use the entity is schema test:

  external-text-entity #implied
     do when entity is #schema
        output file "%eq"
  
     else
        ; ... 
     done