#current-dtd

built-in shelf

Purpose

The built-in #current-dtd shelf of type dtd refers to the DTD that gets compiled during an SGML or XML parse and subsequently used for the validation of the document instance.

Whenever a new parse is started, the shelf #current-dtd is saved and assigned a new dtd instance. In case of an SGML parse, the instance will have the sgml-dtd type, and in case of a validating XML parse it will be an xml-dtd. This newly created instance does not become usable until the dtd-end point.

If #current-dtd is assigned another dtd value during a validating parse, but no later than the dtd-end point, this value will be used for the instance validation. The shelf is writable only within the lexical scope of the following rules: