[plt-scheme] X-expressions, HTML and a nonbreaking space ( )

From: Arend P. van der Veen (apvanderveen at att.net)
Date: Thu Oct 21 09:31:56 EDT 2004

Hi All,

I have been writing servlets using a response containing an X-expression 
representing HTML.  I am trying to include a nonbreaking space ( ) 
and it is getting escape sequenced ( ).  Does anybody have any 
suggestions on how to correct this ?

To illustrate the problem please consider the following test program:

(require (lib "unitsig.ss")
          (lib "servlet-sig.ss" "web-server"))

(unit/sig () (import servlet^)

   (define lhtml
     `(html
       (head
        (title "Flight Information"))
       (body
        (h2 "Item 1")(br)" "(h2 "Item 2"))))

   lhtml
   )

The servlet generates the following HTML:

<html><head><title>Flight Information</title></head><body><h2>Item 
1</h2><br />&amp;nbsp;<h2>Item 2</h2></body></html>

I wanted it to generate the following:

<html><head><title>Flight Information</title></head><body><h2>Item 
1</h2><br />&nbsp;<h2>Item 2</h2></body></html>

The problem is that &nbsp; is getting escape sequenced.

Thanks for any help in advance,
Arend


Posted on the users mailing list.