This script performs the minor convenience of invoking the SGML
parser nsgmls
with the right SGML declaration
and catalog; this is almost trivial but making sure you have the
right declaration is just fiddly enough that it's useful to not
have to think about it. It determines what declaration to use
by its inside knowledge about which DTDs use which declarations.
In fact, the default starsgml setup will allow use of
nsgmls
without explicitly specifying a declaration on Starlink documents,
but in this case the declaration is wrong for non-Starlink
documents, such as those in HTML. The main difference is that
the Starlink declaration is case-sensitive.
All flags are passed unchanged to the nsgmls
program.
The nsgmls
binary must be in the path, and the
STARLINK_SGML_DIR directory must be set correctly.
Example 1:
parse -s sun123.sgml
This runs nsgmls
on the named file, suppressing
normal output. Any parse errors will be written to standard
error. If there is no output then the document conforms to
the DTD.
The nsgmls
program and its
output format
are documented fully elsewhere. A representation
of the ESIS of the document (this is very verbose) is written to
standard output, unless suppressed with the -s
flag.
Any discrepancies with the DTD which the parser encounters
cause a message to be written to standard error (this may be
redirected using the -f
flag). This error message
consists of 5 colon-separated fields as follows: