From: Giannandrea Castaldi
Subject: Problem with htmlgen
Date: 
Message-ID: <carhee$l6b$1@lacerta.tiscalinet.it>
Hi,
I'm using htmlgen with cmucl 18e and I wonder why the macro html doesn't 
put in the html the result of the prin1:

This is my code:

(html (:html (:title "My document")
	     (:body (:h1 "My document")
		    "Hello AllegroServe, my name is "
		    (:prin1 "Giannandrea"))))

This is the output:
<html><title>My document</title><body><h1>My document</h1>Hello 
AllegroServe, my name is </body></html>

In the tutorial 
(http://allegroserve.sourceforge.net/aserve-dist/doc/htmlgen.html) is 
explained that to insert generated html you should use :prin1 or :princ 
but they seems don't work.

Any help.

Giannandrea
From: Frank Buss
Subject: Re: Problem with htmlgen
Date: 
Message-ID: <cat0po$mgj$1@newsreader2.netcologne.de>
Giannandrea Castaldi <········@tiscali.it> wrote:

> This is my code:
> 
> (html (:html (:title "My document")
>           (:body (:h1 "My document")
>               "Hello AllegroServe, my name is "
>               (:prin1 "Giannandrea"))))
> 
> This is the output:
> <html><title>My document</title><body><h1>My document</h1>Hello 
> AllegroServe, my name is </body></html>
> 
> In the tutorial 
> (http://allegroserve.sourceforge.net/aserve-dist/doc/htmlgen.html) is 
> explained that to insert generated html you should use :prin1 or :princ 
> but they seems don't work.

The tutorial says:

| The html macro is designed to run inside AllegroServe's with-http-body 
| macro which binds *html-stream* to the correct stream.   Also the html-
| stream macro described below binds *html-stream* before calling html.

I don't know enough Lisp to say what's go�ng wrong, if you don't follow 
the documentation, by studying the htmlgen source, but this works:

(html-stream *standard-output* 
             (:html (:title "Test")
                    (:body "Lisp implementation: " 
                           (:princ (lisp-implementation-type)))))

The output on my system is (I've used princ instead of prin1 to avoid the 
double quotes) :

<html><title>Test</title><body>Lisp implementation: International Allegro 
CL Trial Edition</body></html>

-- 
Frank Bu�, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de