[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] News from the Barnyard
From: |
Felix Winkelmann |
Subject: |
Re: [Chicken-users] News from the Barnyard |
Date: |
Fri, 13 Jun 2003 09:16:26 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530 |
Kirill Lisovsky wrote:
IMHO, SXML and quasiquote provide an elegant and Schemish solution:
`(html
(head
(title "Hello"))
(body
(h1 "I'm running on: " (i ,(get-host-name)))
)))
It may be XSLT/SXSLT transformed, SXPath queried or just
serialized as HTML.
This very simple example, implemented on top of example web server
from Chicken distro, is available at:
http://pair.com/lisovsky/download/barnyard/
csi -case-sensitive web.scm
Wow!
BTW: what's this spiffy current-request?
Thats a parameter that holds the current HTTP request record
in the web-server. It's not available in the HTTP extension
(but can of course be easily implemented).
An HTML (or better yet XHTML) page with <?scheme ... ?>
can be parsed from HTML above to SXML above using SSAX, but for some
(code extensive) pages SXML sources may be more reasonable than (X)HTML.
I've experienced this with XSLT stylesheets extended with Scheme.
And vice versa, for markup-extensive pages with a few code
(X)HTML is often preferable.
Yes, you need one translation phase less.
If anybody is interested, I can put it on the web-site.
I'd like to look at it.
Yup. Stay tuned.
cheers,
felix