[plt-scheme] HTML escaping questions

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Feb 23 17:47:10 EST 2004

Look at my home page. You will see two pictures that flip back and 
forth. I
just read XML code like this from a file (a macro that Matthew started 
and
I adapted) as if it were in an XML box in DrScheme:

  <SCRIPT language="JavaScript">
    overimage=new Image
    outimage=new Image
    overimage.src="Images/felleisen1.jpg"
    outimage.src="Images/donq.gif"
  </SCRIPT>

<a href="#"
   onmouseover="image.src=overimage.src"
   onmouseout="image.src=outimage.src">
   <img name="image" alt="MF" src="Images/donq.gif" width="180" 
border="0" />
</a>

-- Matthias


On Feb 23, 2004, at 5:34 PM, ifconfig wrote:

> For your javascript problem, with XML, you would have to use <![CDATA[ 
> - unescaped string - ]]> for it to be correct. I wonder if there is a 
> scheme equivalent (cdata str) or some such.
>
> ifconfig
> BAGOS
> http://bagos.sourceforge.net
>  
>  
> ----- Original Message -----
>  From: Terrence Brannon
> To: PLT Scheme
> Sent: Monday, February 23, 2004 11:26 PM
> Subject: [plt-scheme] HTML escaping questions
>
> Thanks to Dougo, I got the XML library loaded. I have a coupla 
> questions:
>
> 1/ Given these two values for text and banner:
>
> (define text "pretty & red")
> (define banner "\"here is the banner\"")
>
> (empty-tag-shorthand html-empty-tags)
> (write-xml/content (xexpr->xml `(html (head (title ,banner))
>                       (body ((bgcolor "white"))
>                         ,text)))
>
> The ampersand is converted to an XML entity but the quotation marks 
> are not
>
>
> 2/ I have some files of javascript that I need to place in a website. 
> How do I create an X-expr that does not atttempt any HTML escaping on 
> its input string?
>
>
>



Posted on the users mailing list.