From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b1150caefb87348f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-06 09:31:40 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news2.telebyte.nl!peer1.news.newnet.co.uk!peer1.news.newnet.co.uk!proxad.net!wanadoo.fr!not-for-mail From: Pascal Obry Newsgroups: comp.lang.ada Subject: Re: Ada Advocacy - WPG (Web Page Generation) scheme Date: 06 Oct 2003 18:31:36 +0200 Organization: Home - http://perso.wanadoo.fr/pascal.obry Message-ID: References: NNTP-Posting-Host: avelizy-103-1-3-148.w217-128.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news-reader4.wanadoo.fr 1065457899 17161 217.128.47.148 (6 Oct 2003 16:31:39 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 6 Oct 2003 16:31:39 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.95 Xref: archiver1.google.com comp.lang.ada:317 Date: 2003-10-06T16:31:39+00:00 List-Id: "Nick Roberts" 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': > >

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