Document Types > Creating a Document Type Definition (DTD) > Wrapped and Unwrapped DTDs
  
Wrapped and Unwrapped DTDs
Make sure your DTD file follows applicable conventions. Conventions for DTD files vary. A DTD file convention can be either wrapped or unwrapped and may or may not include an SGML Declaration.
If no SGML Declaration is stated, Arbortext Editor assumes one. To include an SGML Declaration for SGML documents, you can amend the SGML Declaration to the DTD specification, or indicate a separate declaration file for the DTD in the catalog file.
* 
You do not have to specify an SGML Declaration for XML document types. In Arbortext Editor, XML documents are compiled using predefined SGML Declaration values for XML.
DTD files that include an SGML Declaration must be wrapped to be valid. Wrapped DTDs begin with a <!DOCTYPE... line, while unwrapped DTDs do not. Most of the distributed document type .dtd files in the doctypes subdirectory are examples of DTDs that are wrapped. The structure of wrapped DTDs looks like the following:
<!DOCTYPE docname [
<!-- COMMON PUBLIC DECLARATIONS -- >
<!ENTITY % entname PUBLIC "public id string">
<!-- DOCUMENT STRUCTURE -- >
<!ELEMENT entname - - ( content model ) >
......
<!-- END ELEMENTS -->
]>
Unwrapped DTDs cause the compilation process to prompt the user to enter a top level tag so that the parser knows where to begin.
<!-- DOCUMENT STRUCTURE -->
<!ELEMENT section - - ( content model ) >
<!ELEMENT topic - - ( content model ) >
<!ELEMENT chapter - - ( content model ) >
<!ELEMENT subsection - - ( content model ) >
<!-- END ELEMENTS -- >
* 
You can use Arbortext Editor to edit your DTD file as an ASCII file by typing edit -untagged dtd_filename at the command line.