[plt-scheme] Embedding scheme in web pages

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Fri Jan 19 02:55:18 EST 2007

Maarten Koopmans skrev:
> Hi,
> 
> I am looking into DrScheme and its web server and I noticed that the
> content is servlet based or static. Is there a way to embed scheme code
> in XML documents?
> 
> I suspect it should be possible (XML boxes?) but being new to DrScheme
> some help would be highly appreciated!
> 
> E.g. I'd like to write something like this:
> 
> <html><head></head><body> (+ 1 2) </body></html>
> 
> which should be served as:
> 
> <html><head></head><body> 3 </body></html>

Search for "xexpr" in the HelpDesk.

Returning

   `(html (head (title "A title"))
          (body ,(+ 1 2)))

as the result of a servlet will generate the
wanted output.

-- 
Jens Axel Søgaard




Posted on the users mailing list.