文書型 > Compiling Document Types > Compiling Document Types
  
Compiling Document Types
Once you have created or made changes to an SGML document type, you must compile it. Compiling a document type generates the associated document type and template files.
* 
Be careful when making changes to a document type that is already in use, as the changes could cause invalid markup in documents using the document type. For example, if you remove an element from an installed document type that is referenced in an existing document, you will get context errors the next time you open the document in Arbortext Editor.
Compiling a document type generates the following files, which Arbortext Editor uses to quickly load a selected document type:
Files Generated During Document Type Compile
File
Description
.pro
Compiled version of the DTD.
.dec
Compiled version of the SGML declaration.
.ptd
A binary file that combines element and attribute information in a format that optimizes data access.
You can compile your document type using Arbortext Editor or Arbortext Architect.
To compile document types in Arbortext Editor:
1. Open Arbortext Editor.
2. Choose File > New to create a new document or choose File > Open to open an existing document.
The Compile Document Type dialog box will open if you select a document type that must be compiled.
* 
If the Compile Document Type dialog box does not display, and you want to force a compile of a document type, choose Tools > Compile Document Type or type compile_doctype on the command line.
3. In the Document Type Path field, browse to select or type the path and file name of the DTD you want to compile.
4. Top Level DTD Tag — Specifies the top level element for a DTD. If this DTD is unwrapped (no <!DOCTYPE wrapper), you must type the element name in this field. If the DTD is wrapped, you do not have to specify this element; Arbortext Editor will automatically detect it.
5. In the SGML Declaration Path field, browse to select or type the path to the SGML Declaration for SGML document types. If Arbortext Editor locates an SGML Declaration in the directory in which the DTD is located, it will fill in the appropriate path. If Arbortext Editor does not find an SGML Declaration in this directory and you do not specify a path, Arbortext Editor will use the appropriate default.
Leave this field empty if you are compiling an XML document type. In Arbortext Editor, XML documents are compiled using predefined SGML Declaration values for XML.
6. The Catalog Path field indicates the current catalog path. You may specify additional catalog paths if you like. Use semicolons to separate multiple paths.
7. Indicate whether the application is SGML or XML.
8. Choose to Report or Ignore warnings.
Warnings indicate problems that in many cases will not cause the compile to fail, but could cause problems when you use the document type. For example, a missing entity in the DTD would generate a warning, but, in many cases, the compile would succeed.
9. Click OK.
To compile a document type in Arbortext Architect:
1. Open Arbortext Architect.
2. In the Select DTD dialog box, choose File > Open and select the directory in which the DTD you want to compile is located.
3. Choose Compile > Force Compiles.
4. Choose Compile > Display Warnings to show or hide format warnings.
Warnings indicate problems that in many cases will not cause the compile to fail, but could cause problems when you use the document type. For example, a missing entity in the DTD would generate a warning, but, in many cases, the compile would succeed.
5. Choose Compile > Compile Document Type.
If any errors or warnings occur during the compile, they will be stored in a log file. They will also be displayed in a Compilation Error/Warning Log window.