comp.lang.ada
 help / color / mirror / Atom feed
From: Pascal Obry <p.obry@wanadoo.fr>
Subject: Re: Ada Advocacy - WPG (Web Page Generation) scheme
Date: 06 Oct 2003 18:31:36 +0200
Date: 2003-10-06T16:31:39+00:00	[thread overview]
Message-ID: <un0ce5nvb.fsf@wanadoo.fr> (raw)
In-Reply-To: blqbag$f1m8d$1@ID-25716.news.uni-berlin.de


"Nick Roberts" <nickroberts@blueyonder.co.uk> writes:

> I wholeheartedly agree with this notion.

Good to hear.

> 
> I have looked at the documentation for your templates parser, Pascal. For
> anyone interested, the URL is:
> 
>    http://perso.wanadoo.fr/pascal.obry/archive/templates_parser.html
> 
> Overall, I like it a lot. I particularly like the way it separates the HTML
> from the Ada.

Thanks.

> For example, with the template file 'demo1.txt':
> 
> <P>Name @_NAME_@
> 
> the following Ada program 'demo1.adb':
> 
> with Ada.Text_IO;
> with DAW;
> procedure Demo1 is
>    Translations : DAW.Interpreter_Set;
>    function My_Name (Parameters: in Parameter_List) return String is
>    begin return "Ada"; end;
> begin
>    Add_Macro( Translations, "NAME", My_Name'Access );
>    Parse_Template( "demo1.txt", Ada.Text_IO.Current_Output, Translations );
> end Demo;

This is equivalent to Templates_Parser:

   Assoc ("NAME", My_Name);

or in this simple case:

   Assoc ("NAME", "Ada");

It is just as easy to write. But here you have a Parameter_List, so it is
certainly more flexible.

> 
> Within a TABLE command, the table would be passed as a parameter of a macro
> to access a field of the table. Inside nested tables, the name of each table
> would be passed as a separate parameter. A table controller procedure would
> control iteration through the rows of the table, and indicate termination.
> 
> @@TABLE A
>    @@TABLE B
>       ... @_PROD_NAME(A,B,FULL)_@ ...
>    @@END_TABLE
> @@END_TABLE

I don't undertstand this one. How A and B are declared for example ?

> In general, I prefer more a bit more work to be done in the Ada program, and
> a little less in the template language.
> 
> What do you think, Pascal?

I think that all this is good. But I do not think that it will prove so
much easier to use. You said it, more work to be done in the Ada program, but
it can turns out to be lot more work if you have to declare a procedure for
each single tag to map on the HTML file.

I have already built pages with something like 50 tags in it.

I'd like to hear from AWS Templates users as I'm certainly biased :)

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



  parent reply	other threads:[~2003-10-06 16:31 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-04 20:29 Ada Advocacy - WPG (Web Page Generation) scheme Nick Roberts
2003-10-04 21:17 ` Larry Kilgallen
2003-10-05  3:32   ` Nick Roberts
2003-10-05  3:51     ` Larry Kilgallen
2003-10-05  9:19       ` Stephane Richard
2003-10-04 21:18 ` Stephane Richard
2003-10-05  3:21   ` Nick Roberts
2003-10-05  9:16     ` Preben Randhol
2003-10-05  9:26     ` Pascal Obry
2003-10-06  0:00       ` Nick Roberts
2003-10-06  0:06         ` Stephane Richard
2003-10-06  8:56         ` chris
2003-10-06 16:31         ` Pascal Obry [this message]
2003-10-06 18:30           ` Wiljan Derks
2003-10-06 19:45             ` Martin Dowie
2003-10-08 18:22               ` Wiljan Derks
2003-10-09 17:48                 ` Pascal Obry
2003-10-09 21:19                   ` Wiljan Derks
2003-10-10  7:42                     ` Preben Randhol
2003-10-10 18:26                       ` Wiljan Derks
2003-10-07 17:21             ` Pascal Obry
2003-10-08  7:18               ` Jean-Pierre Rosen
2003-10-08 19:09               ` Wiljan Derks
2003-10-06  1:07     ` Wes Groleau
2003-10-06  3:15       ` Nick Roberts
2003-10-05  9:14   ` Preben Randhol
2003-10-05  1:00 ` Wes Groleau
2003-10-05  3:05   ` Nick Roberts
2003-10-06  1:03     ` Wes Groleau
2003-10-08 18:14   ` Jacob Sparre Andersen
2003-10-05  9:17 ` Pascal Obry
2003-10-06  3:53   ` David Trudgett
2003-10-06  7:41   ` Dmitriy Anisimkov
2003-10-06 16:09     ` Pascal Obry
2003-10-06 20:28     ` Georg Bauhaus
2003-10-05  9:41 ` Preben Randhol
2003-10-05 11:30 ` Simon Wright
2003-10-05 14:59 ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox