CarthageThe Carthage software is at https://github.com/TEIC/Carthage. It
consists of a yacc/lex-based parser for SGML DTDs
which can delete references to undeclared elements.
It can also do a few other things, depending on the
run-time flags you give it, basically keeping or
dropping certain classes of component.
Carthage was a product
of the TEI Consortium, originally
written by Michael Sperberg-McQueen but
now unmaintained. The name appears to derive from a
pun on Cato’s exhortation in ancient times that
‘Carthage must be destroyed’ (thank you
to Syd Bauman).
Carthage is unsupported software; it may be used
freely without further permission or royalty, but
users who improve it or fix errors are requested to
notify the author so he can also fix them.
NormDTDThis was a public domain DOS program written by
Richard Light to handle
those occasions where an SGML
system cannot accept the complexity of large
DTDs with deeply nested marked
sections and parameter entity references to external
files.
It flattens the DTD to a single
file, duplicating where necessary all the references
that were previously handled by parameter entities.
The element content models in this normalized
DTD will not contain any references
to elements that are not declared, and so it can be
used by highly-strung packages that refuse to process
such applications (the TEI in
particular) for this reason.
The editor retains a copy of the
DOS binary which was on the
CD accompanying Understanding SGML and XML Tools (Flynn, 1998).
spam(Nothing whatever to do with the more recent use
of the word to describe unwanted advertising.)
spam (SP Add Markup) is
a command-line stream editor for DTDs by James Clark. There are options to obey IGNORE and
INCLUDE Marked Sections; to output the Prolog (SGML
Declaration and DTD), and to expands any entity
references between declarations.
spam is included in the
SP package. The
ospam binary is still
shipped in the (now) OpenSP
package, part of the
OpenJade distribution from
https://openjade.sourceforge.net.
Near&FarFamous for its world-beating graphical interface
to DTD design, N&F can flatten the complexity
in importing a DTD, but cannot retain that structure
on export. DOS only, and no longer
available, although it is still in use in some places.
For more details, see the topic ‘Near&Far
(MicroStar)’ in question E.4 on ‘Lost XML software’;
dtd2xmlAndrew Sales added
that the dtd2xml
utility can be used in conjunction with
XSLT (provided) to write code to
flatten an XML instance conforming
to that DTD.