Microsoft KB Archive/125887

{|
 * width="100%"|

WD6: SGML: Parser Errors Importing .sgm File

 * }

Q125887

-

The information in this article applies to:


 * Microsoft SGML Author for Word, version 1.0
 * Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c

-

SYMPTOMS
During the import of an .sgm file, the converter produces parser errors similar to the following:

SGML Parser: Error at C:\...\FILENAME.sgm, line 1 in declaration parameter 4: Could not find external document type "DOC"

SGML Parser: SGML error at C:\...\FILENAME.sgm, line 2 at record start: No definition for DOC document type; "DOC O O ANY" assumed

CAUSE
Word cannot find the .dtd file. By design, Word looks at the declaration (.dcl) file to determine the location of the .dtd file. The location of the .dtd file is specified using the following syntax:

  <!DOCTYPE doc SYSTEM "example.dtd"> Word expects to find the .map file in the same directory as the .dtd file. When it does not, the parser errors occur.

RESOLUTION
Use one of the following methods to specify the location of your files:

Method 1
Modify the DOCTYPE identifier so that the SYSTEM path points to the correct drive and directory:

  <!DOCTYPE doc SYSTEM "n:\dtd\example.dtd">

Method 2: Use a Public Identifier to Locate the .dtd File
To do this, use the following steps:

  Change the doctype statement in the declaration (.dcl) file. For example, the DOCTYPE statement might look like this:      <!DOCTYPE DOC PUBLIC "-//Microsoft Corp//DTD Sample DTD for SGML   Author//EN" >   Add the path for the directory containing your .dtd file to the beginning of the entity catalog (Entm.cat), and then add an entry to the entity catalog that specifies the public identifier and the system identifier of your .dtd file. The entry in the Entm.cat might look like this:      PUBLIC "-//Microsoft Corp//DTD Sample DTD for SGML Author//EN" "sample\sample.dtd" 