swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax   Related Concepts  
built-in variable   #doctype    

Purpose

A pre-defined stream shelf that provides the name of the document element. #doctype is 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.

#doctype is "attached" as soon as OmniMark encounters the document element name at the start of the DTD, following the doctype keyword. Prior to this, #doctype is "unattached". Specifically, it is never attached in the following:

The stream #doctype is attached test can be used to determine whether the document element name is available.

#doctype must not be accessed in process, process-start, or process-end rules.

As a read-only stream, #doctype may 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 #doctype stream.

  external-text-entity #dtd when entity isnt (system | public)
     output file "%lg(#doctype).dtd"

  Related Syntax
   #appinfo
   dtd-end
 
Related Concepts
   XML/SGML parsing: built-in shelves
 
----  

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ OMX ] [ OMX ] [ ERRORS ]

Generated: August 11, 2000 at 3:06:50 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.