swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  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 ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:33:48 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.