Package: cxml-rng

Function parse-schema

Lambda List

parse-schema (input &key entity-resolver (process-dtd-compatibility t))

Arguments

  • input -- a string, pathname, stream, or xstream
  • entity-resolver -- a function of two arguments, or NIL
  • process-dtd-compatibility -- a boolean

Return Value

a parsed schema

Details

This function parses a Relax NG schema file in XML syntax and returns a parsed representation of that schema.

input can be any stream designator as understood by cxml:make-source.

Note that namestrings are not valid arguments, because they would be interpreted as XML source code. Use pathnames instead.

entity-resolver can be passed as a function of two arguments. It is invoked for every entity referenced by the document with the entity's Public ID (a rod) and System ID (an URI object) as arguments. The function may either return nil, CXML will then try to resolve the entity as usual. Alternatively it may return a Common Lisp stream specialized on (unsigned-byte 8) which will be used instead.

If process-dtd-compatibility is true, the schema will be checked for compatibility with Relax NG DTD Compatibility, and default values will be recorded. (Without process-dtd-compatibility, the schema will not be checked compatibility, and annotations for DTD Compatibility will be ignored like any other foreign element.)

 

See also