| Syntax 
   #doctype
 
 Purpose
 
 A pre-defined stream shelf that provides the name of the document element. #doctypeis especially useful when the
name of the document is required outside of the instance; in particular, when processing the external identifier at the start of the DTD. #doctypeis "attached" as soon as OmniMark encounters the document element name at the start of the DTD, following the doctype keyword. Prior to this,#doctypeis "unattached". Specifically, it is never attached in the following:
 The stream #doctype is attachedtest can be used to determine whether the document element name is available. #doctypemust not be accessed inprocess,process-start, orprocess-endrules.
 As a read-only stream, #doctypemay be passed only as a read-only argument; it cannot be modified, added to, or cleared. The following example shows how to use the name of the document element to find an external entity when the external identifier at the head of the DTD has no public or system identifier (for example, !DOCTYPE doc SYSTEM [). For example, say the file "doc.dtd" is intended to be used. The name of the document element would be available to the OmniMark program in the#doctypestream.
   external-text-entity #dtd when entity isnt (system | public)
     output file "%lg(#doctype).dtd"
 |