Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] dynamic HTML pages
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-09 (17:04)
From: Fred Yankowski <fred@o...>
Subject: Re: mixing different languages (was: RE: [Caml-list] dynamic HTML pages)
On Tue, Apr 08, 2003 at 02:28:50PM +0200, David Monniaux wrote:
> Are there any text editors that are aware of such mixed programs?

Emacs has an available MMM package -- Multiple Major Modes -- that
applies different modes to different sections of any given file based
on patterns that define the different language regions.  It works
fairly well with, for example, PHP code embedded in HTML, presenting
the PHP code with php-mode and the HTML code with an html mode, using
the font-coloring and other mode-specific view and behavior specific
to each mode in the particular regions.

That said, I now try for a strict separation of imperative code and
HTML code, so that my HTML template files have no language specific
code and contain only formal parameters and markings of optional and
repeated blocks of HTML content.  I haven't used OCaml to generate
HTML pages, but that's the approach I would want there too.

The "Zope Page Templates" used in the Zope/python webserver framework
are particularly elegant implementation of this approach, doing all
templating in a slightly enhanced version of XHTML.  But they are slow
(absent caching) because of the XML parsing required.

Fred Yankowski           tel: +1.630.879.1312
OntoSys, Inc	    PGP keyID: 7B449345        fax: +1.630.879.1370     38W242 Deerpath Rd, Batavia, IL 60510-9461, USA

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: