From "Jahn Tue Aug 27 16:13:49 1996
Article: 90557 of comp.infosystems.www.authoring.html
From: "Jahn Rentmeister" 
Subject: Preprocessors for HTML
Date: 23 Aug 1996 15:30:09 +0200
Organization: Westfaelische Wilhelms-Universitaet Muenster, Germany

Many HTML documents contain redundant information that is supposed to
be consistent over a set of documents. Common examples are:
Navigation bars, common background colours/images, footers, headers (w/ logos)

The natural approach for managing this redundancy was to use a preprocessor.
In fact, I wrote my first HTML preprocessor _before_ I wrote my first
HTML document. This preprocessor was, well, not at all perfect. By now,
I have looked at a lot of other preprocessors for HTML. I am interested
in the experiences of other people who have uses preprocessors, or who have
deliberately decided against using one (after considering it).

To begin with, I'll share some of my experiences:

Basically, there are 3 different classes of preprocessors:

1) Preprocessors that uses a syntax that clashes with HTML.
   (e.g. sheep, htmlpp, htm4l, GTML) You can not simply take a HTML document
   and convert it with "nearly no" effort to a preprocessed document.

2) Preprocessors that use a syntax compatible with SGML. 
   (e.g. hmml, htmlscript, spml, SGML-normalizers)
   You can verify your syntax with SGML-parsers, if you provide your own
   SGML. This can have benefits.

3) Preprocessors that use a syntax orthogonal to SGML/HTML.
   (e.g. HTML++, PHP/FI if used as a preprocessor)
   These use syntax such as <> or  to embed things
   in HTML documents.

There are also different functionalities provided by different preprocessors:

1) Simple macros, no parameters (HTML++, SGML-normalizers (entities), GTML)
2) Macros with parameters (most)
3) Special features: Document classes and inheritance (HTML++), on-the-fly
   definition of new tags (hmml), variable manipulation (PHP/FI, hmml,
   htmlscript, spml), conditional code (PHP/FI, hmml, htmlscript, 

I have hardly any knowledge on SGML, therefore I do not know how fine 
preprocessing can be using sgmls/SP etc. I am very impressed by 
HTML++ and hmml. HTML++ is missing macros with parameters, but all 
preprocessors except HTML++ are lacking the OO-like design facilities
that HTML++ provides: 

   E.g. assume you have common navigation bars everywhere. Using a
   normal preprocessor, changing that navigation bar in all of your 
   documents is easy: Change the definition, type make, done.
   But with HTML++, you could also change the _position_ of that
   navigation bar on all of your pages: Move it from below the logo
   to the top of the page etc. You just change your definition of
   what a page should look like, type make, done.
I am looking forward to the knowledge, experiences and proposals that others
might have on this topic. I myself use sheep (for solely historical reasons)
and HTML++ (for better reasons). And I expect interesting things to come
from both HTML++ and hmml.


   GTML: This is a perl-script for preprocessing HTML, similar to the
         C preprocessor, but without parameters for macros
      Contact:,, (Gihan Perera)

   HTML++: This is a perl-script, it uses lots of memory, allows
           OOP-like object hierarchy for pages

   spml: part of the spinner HTTP-Server, I don't know whether stand-alone
         implementations are available.

   htmlscript: commercial preprocessor

   hmml: C++-implementation, GPL, allows on-the-fly tag definition.
      Contact: (James Carter).

   PHP/FI: Intended as a CGI-wrapper, but abuse for preprocessing is possible

   sgmls/SP: SGML-parser/normalizer. I have no experience with them

   htm4l: m4-utilization for HTML
      Contact: (Terry Jones).

   Orb: a shareware tool for DOS, OS/2
      Contact: (Craig Berry)

   sheep: a rather un-released, basic, ill-coded preprocessor I coded 
          myself. Use if you dare running my code. (source comments in 
          german - the language I use when I talk to myself)



References updated and email contacts added: MS, CERN 24 July 1997