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

From: Jacob Matthews (jacobm at cs.uchicago.edu)
Date: Thu Oct 21 09:36:44 EDT 2004

Just use the bare symbol nbsp rather than   --

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

-jacob

Arend P. van der Veen wrote:

>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> 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.