Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: template driven development? Re: Rebol Server Pages

From: al:bri:xtra at: 9-Oct-2002 21:33

YS wrote:
> This also reminds me of Enhydra's XMLC ( ). XMLC is
one of the thing that solves the problem with embedding other languages within the HTML codes.
> The clean separation between "UI" and "logic" allows for different teams
(UI and logic) to work in parallel once they have agreed on the use of certain naming conventions.
> Perhaps we can learn from XMLC to see how we can incorporate some of the
features in one of the frameworks. Here's some HTML copied from the draw poker demo: <HEAD> <TITLE>Welcome to Larry and Daryl's EnhyDraw! poker</TITLE> </HEAD> <html> <head> <title>Welcome to Larry and Daryl's Enhydra Poker!</title> </head> Two head sections in the same page? With two different titles? Here's some more HTML copied from the FormUpload page: <FORM name="myForm" enctype="multipart/form-data" method=POST action=FormUpload.po> <INPUT type=hidden name=theFileName> <H2>Input1: </H2><INPUT type=text name=input1 size=30> <H2>Upload: </H2><INPUT type=file name=upload size=30> <P><H2>Submit: </H2><INPUT type=submit name=submit size=30 onClick="setFileName()"> </FORM> They're using presentation markup (H2 tags) for input labels? There's no closing tags for the page; the "</FORM>" isn't followed by closing tags for the "<body>" and "<html>" tags. Also, they're using uppercase for tag names which isn't XML compatible, and not all attribute values are quoted. But the above is probably because they're using visual web page design tools to create/maintain the pages, and because they've not got all the content from the program (content like title tag content is expressed outside the program). Presumably these problems would be fixed by using a XML-compatible visual web page design tool? pekr might be interested in this page: iew.html and looking for: Q: How does the BTemplate work? The concept of using id attributes to tell the parsing program where to get the data from can be easily implemented in Rebol, once one has a adequate HTML parser. :) Except that in the examples, it's changed to using the class attribute instead. :-\ Here's an example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ""> <html id="HelloWorld"> <head><title class="Dir::Get_Data.HelloWorld.Title">[Title]</title></head> <body style="font-family: Georgia, Arial, Times New Roman" bgcolor="#FFFFFF"> <h2 class="Dir::Get_Data.HelloWorld.Title">[Title]</h2> <p class="Dir::Get_Data.HelloWorld.Descr">[Descr]</p> <p class="Dir::Get_Data.HelloWorld.Header">[Nav Header goes here]</p> <p>Here's our third shopping list:<br></p> <table summary="foo"> <tr class="Dir::Iterate_Start.Groceries Dir::Iterate_Next.Groceries"> <td bgcolor="#8080FF"> <font color="#FFFFFF"> <span class="Dir::Get_Data.Groceries.RowCntr">1</span>. <strong><span class="Dir::Get_Data.Groceries.Item">Corn</span></strong> (<span class="Dir::Get_Data.Groceries.Qty">3 cans</span>) </font> </td> </tr> <tr class="Dir::Iterate_Next.Groceries"> <td> <em> <span class="Dir::Get_Data.Groceries.RowCntr">2</span>. <strong><span class="Dir::Get_Data.Groceries.Item">Peas</span></strong> (<span class="Dir::Get_Data.Groceries.Qty">4 bags</span>) </em> </td> </tr> <tr class="Dir::Iterate_End.Groceries Dir::Discard" bgcolor="#8080FF"> <td><font color="#FFFFFF">3. <strong>Bannanas</strong> (1 bunch)</font></td> </tr> <tr class="Dir::Discard"> <td><strong>...</strong></td> </tr> </table> <p class="Dir::Get_Data.HelloWorld.Footer" align="center">[Footer goes here]</p> </body> </html> I wonder is pekr would be happier with this? :) The equivalent in Rebol would replace "::" with "/", and "." with "/". Except that I think the example above is faulty. I'm under the impression that the presentation stuff will vanish, as it's replaced? :-\ I could well be wrong. But that's enough rambling from me. Andrew Martin ICQ: 26227169