SGML errors

This is a very crude attempt to interpret some SGML errors for you. Many of the messages only make sense if you know quite a lot about SGML (e.g. minimization, entities, etc.). Also, if you make even one error, it often cascades hundreds more because the parser gets out of phase. So only start worrying when you can't understand the first error! (There are over 230 error messages in SGMLS and I haven't a clue what some of them mean!).

No DOCTYPE declaration; document type is unknown
All SGML document instances must start with a DOCTYPE statement looking something like:
<!DOCTYPE PLAY PUBLIC "-//BOSAK//DTD SHAKESPEARE//EN">
If you got your document from somewhere else, it could be part of a larger SGML document (and be included with the ENTITY mechanism) so that the DOCTYPE was in another file. In that case you may need to add a DOCTYPE to the file or to write a little file something like:
<!DOCTYPE PLAY PUBLIC "-//BOSAK//DTD SHAKESPEARE//EN"> [
<!ENTITY julius SYSTEM "caesar.sgm">
]>
&julius;

DOCTYPE markup declaration not permitted here; declaration ended
A DOCTYPE declaration must come at the start of the file. This error could also be because the DOCTYPE was missing.
(.*) markup declaration not permitted here; declaration ended
The markup (which is probably <!something>) is either misspelt or in the wrong place. If this is in a DTD, the DTD may be corrupt and needs mending, or it may have not included the right components
Undefined (.*) start-tag GI ignored; not used in DTD
A start-tag cannot be found in the DTD. Check that the tag is not mistyped and that you are using the right DTD (and the right version).
No element declaration for (.*) end-tag GI; end-tag ignored
And end-tag was found without a corresponding start-tag. This might be because the end-tag (or the start-tag) were misspelt or because the document was corrupted or part of a larger document.
(.*) start-tag implied by data; not minimizable
The parser is expecting a specific start-tag (explicitly named) here and has probably found some ASCII text instead. Apart from mistypes, this may mean that your document is badly constructed, or that you are using the wrong (version of the) DTD.
(.*) end-tag implied by data; not minimizable
The parser is expecting a specific end-tag (explicitly named) here and has probably found some ASCII text instead. Apart from mistypes, this may mean that your document is badly constructed, or that you are using the wrong (version of the) DTD.
(.*) end-tag implied by (.*) start-tag; not minimizable
The parser found a start tag whilst it was still expecting an end-tag. Perhaps the end-tag is essential, or maybe you have the document structure wrong (or an incompatible DTD). (Alternatively you may have used an SGML declaration with OMITTAG NO for a minimised document.)
(.*) end-tag ignored: doesn't end any open element (current is (.*))
The parser found an end-tag (first GI) when it was expecting another one (second GI). Maybe it's spurious, or the start-tag got omitted?
(.*) start-tag implied by (.*) start-tag; not minimizable
The parser is expecting a specific start-tag (explicitly named) here and has found another one (also named). Apart from mistypes, this may mean that your document is badly constructed, or that you are using the wrong (version of the) DTD. (Alternatively you may have used an SGML declaration with OMITTAG NO for a minimised document.)
Start-tag omitted from (.*) with empty content
I think something's gone rather wrong here. Have a close look at the file.
Possible attributes treated as data because none were defined
This is an error inside a tag and may be due to a missed = or an unknown attribute or to missing qoutes round the attribute value.
(.*) element not allowed at this point in (.*) element
A (start-)tag was found inside another element ("tag") where it was not allowed by the DTD. Check the structure of your document and then you will have to check the content model of the second element (perhaps with the dtd2html system) - sorry!
(.*) end-tag implied by (.*) end-tag; not minimizable
The (first) end-tag was not found where it was required.
Data not allowed at this point in (.*) element
This might mean an ASCII text string where none was allowed (#PCDATA), or that a tag hadn't been recognised.
(.*) element ended prematurely; required subelement omitted
The (named) element was closed by an end-tag without containing all the subelements required in the DTD. Check the document structure against the DTD if there are no other errors.
Out-of-context (.*) start-tag ended (.*) document element (and parse)
A start-tag has been found in a completely unexpected place and the poor parser cannot continue. If no previous error, check the document structure against the DTD
End of file in comment
A comment has not been closed. Note that comments are precise pairs of -- and something like <!-- this is a comment> is not closed, nor is <!-- this is a comment---->. Many current browsers get comments badly wrong.
(.*) IDREF attribute ignored; referenced ID does not exist
An attribute of type IDREF points to a non-existent ID. (Example:
Click for Smith
...
name is Smyth
...
]]>
would give an error if (a) TARGET was of type IDREF and there was no ID with value "smith". (Attributes are also case-sensitive). Look at the attribute name given , and its value and see why there is no ID with the same value.
Undelimited attribute value requires "SHORTTAG YES"
This probably means that you have not enclosed an attribute value in quotes. Unlike HTML (where you can get away with a lot) strict SGML can require this. Alternatively the author may have used "SHORTTAG YES" minimisation and you have an inappropraite SGML declaration.
Out-of-context data ended (.*) document element (and parse)
A data item (e.g. ASCII text) has been found in a completely unexpected place and the poor parser cannot continue. If no previous error, check the document structure against the DTD
Document element end tag can only occur in document element because entity end not allowed in other prolog
You may be using entities (&&...;) and you have a foul-up somewhere which has meant that the end-of-file has got out of step. Or something like that.
Incorrect character in markup; markup terminated
Maybe you got the syntax wrong (e.g. a missed = inside a tag), or you used a character in a GI or attribute that isn't allowed (stick to alphanumerics if possible). Or you may have to enclose the attribute value in quotes (HTML browsers are a bad example here!)
Unclosed start or end tag requires "SHORTTAG YES"
You may have forgotten a closing > before starting the data or another start/end tag.
Attribute name omission requires "SHORTTAG YES"
You may have concatenated two attributes or got a quote in the wrong place or missed out an = or otherwise have got the attribute syntax wrong
(.*) IDREF attribute ignored: referenced ID does not exist
In strict SGML (unlike 'HTML') a pointer (IDREF) must have a declared target (ID) expressed as an attribute. (It is common, but not required, to use the attribute name 'ID' (e.g. <TAG ID='one'>). The only way you can fgind which attributes are IDs is by looking at the DTD. If you have created the document, check where the ID should be and that something isn't misspelt. If you haven't created the doc, a possible cause is that part of the doc fell off.
"PUBLIC" or "SYSTEM" required; declaration terminated
The DOCTYPE declaration resolves the document type either through a PUBLIC identifier or a SYSTEM identifier. See the debugging hints for more detail.
Could not find external document type "(.*)"
The PUBLIC or SYSTEM identifiers could not be resolved (either the right catalog has not been used (PUBLIC)) or the file pointed to does not exist (or is not in the SGML_PATH). See the debugging hints for more detail.
No definition for (.*) document type; "(.*) O O ANY" assumed
The first start-tag had a GI which could not be found in the DTD supplied in the DOCTYPE statement. Check that you haven't misspelt something and that you have used the right DTD.
Invalid character(s) ignored; attempting to resume DOCTYPE subset in (.*) (l.(.*))
You have probably got something drastically wrong. sgmls is trying to read the DOCTYPE and what comes after it and has found something it wasn't expecting.
No such file or directory
The file mentioned does not exist or the path does not point to the directory it is in.
Entity (.*) terminated: could not read file
Probably an inaccesible or missing file.
Document ended invalidly within prolog; parsing ended
Probably a result of other errors, but otherwise some problem before the parsing of the document instance itself.
Parameter entity name longer than (NAMELEN-1); truncated
Almost certainly you have omitted the SGML declaration or included the wrong one. Choose an SGML declaration with a large value of NAMELEN (at least 32) and LITLEN (1024).
Length of name, number, or token exceeded NAMELEN or LITLEN limit
Almost certainly you have omitted the SGML declaration or included the wrong one. Choose an SGML declaration with a large value of NAMELEN (at least 32) and LITLEN (1024).
Could not find external general entity .(.*).
A general entity (&something;) referenced a non-existent file (or the path does not include its directory)
(.*) = .(.*). attribute ignored: not defined for this element
The attribute name (the first field) has not been defined for this element. Maybe you are using an incorrect version of the DTD or the document instance is wrong (?misspelt). Also, check if there are unbalanced quotes or other obvious syntactic errors.
(.*) = .(.*). attribute value defaulted: invalid character
If this isn't a cascading error, it implies the attribute value (the second filed) conatins an unacceptable character. If the attribute type is ID or NUMBER there are strict limitations or characters. If the type is CDATA, make sure you have balanced quotes and that there isn't a character with ASCII value < 32 or > 127.
Could not open file for entity .(.*).; entity reference ignored
A file corresponding to a general entity (&foobar;) cannot be found. Unfortunately filenames in entities are NOT relative to the document (unlike catalogs) but are relative to where sgmls (i.e. cw) is run from. If this is your problem - i.e. the file exists, but sgmls isn't finding it, you may have to set SGML_PATH to point to the directory :-(. Alternatively, run cw from the directory where the *document* is. Sorry - I find it hairy as well :-(
(.*) element ended prematurely; required (.*) omitted
An element did not conatin a required subelement. This could arise from other errors, but otherwise you have to check what the DTD requires!
Net-enabling start tag requires "SHORTTAG YES"
I do not understand this, except that probably the author has used SHORTTAG YES and you have an SGML declaration which forbids this :-(.

Peter Murray-Rust
April 1996