SV: [DOC-SIG] Comparing SGML DTDs

Paul Prescod papresco@technologist.com
Wed, 12 Nov 1997 12:14:32 -0500


Fredrik Lundh wrote:
> Maybe anyone could post some small examples of DocBook and whatever
> the other DTD's are called.  The SGML and XML material I've seen tend to
> spend very little time dealing with how real documents and stylesheets
> look like...

Good question. I can find examples, but they are all "normalized" (tag
expanded). Normalized SGML is often distributed to support a few broken
tools that don't know about minimization (primarily Panorama). I could
perhaps encode a few pages in a DocBook subset over the weekend as an
example.
 
> And I assume there tools around that makes conversion to/from (la)tex
> nearly automatic?

To TeX, yes, no problem.

>From (La)TeX? Not really. Parsing LaTeX is not only difficult, but
relatively undefined. There is no one language called "LaTeX" it is
really a family of languages more or less defined by the Lamport book.
And lots of LaTeX documents mix generic structures and formatting
interchangably. Finally, there is no easy way to figure out how to
handle macros. Should they be expanded to their TeX primitives (uck)? If
not, how do we know how to represent user defined macros in the target
DTD? If you make a "foobar" macro, what do I do with it in SGML?

Now you see why I really hate to see documents trapped in LaTeX -- it
mixes so many concepts -- markup and formatting, structure and macros,
etc. I think you almost have to write a converter specific to a specific
LaTeX subset, defined a) in prose text or b) by a specific set of
documents. We could analyze the LaTeX conventions used by the Python
documents and write a converter, but I wouldn't advise that as a long
term solution. There is no way to force people to stick to our LaTeX
conventions.

 Paul Prescod

_______________
DOC-SIG  - SIG for the Python Documentation Project

send messages to: doc-sig@python.org
administrivia to: doc-sig-request@python.org
_______________