Package: cxml-rng

Function make-dtd-compatibility-handler

Lambda List

make-dtd-compatibility-handler (schema handler)


  • schema -- the parsed Relax NG schema object
  • handler -- an additional SAX handler to broadcast events to

Return Value

a SAX handler


This function creates a handler for DTD Compatibility processing according to schema.

The validation handler processes SAX events and can be used with any function generating such events, in particular with cxml:parse-file.

Compatibility processing consists of two steps: Infoset modification for default values, and soundness checking for attributes with an ID-type.

In sax:start-element, infoset modification will be performed as specified for DTD compatibility. This entails addition of attributes according to their defaultValue, and addition (and, when the element ends, removal) of suitable namespace declarations if no prefix has been declared for the defaulted attribute yet.

Also in sax:start-element, the handler checks that no ID is declared more than once. Before the end of the document, the handler checks that all IDs referred to by attributes with ID-types IDREF or IDREFS have been declared.


See also