[plt-scheme] Escaping in X-expression attributes
Hi All
I have a hard time figuring out how to get the web-server
to produce a " or a ' in the output when feeded an X-expression.
I simply can't figure out how to escape properly in the attributes
of X-expressions.
Example:
(a ([href ""] [onClick "return mysubmit('google');"]) "Web")
is turned into
<a href="" onclick="return minsubmit('google');">Web</a>
What I want is:
<a href="" onclick="return mysubmit('google');">Web</a>
or
<a href="" onclick="return mysubmit("google");">Web</a>
Transcript:
> (require (lib "xml.ss" "xml"))
> (xexpr->string '(a ([href ""] [onClick "return mysubmit('google');"])
"Web"))
"<a href=\"\" onclick=\"return mysubmit('google');\">Web</a>"
> (xexpr->string '(a ([href ""] [onClick "return mysubmit(\"google\");"])
"Web"))
"<a href=\"\" onclick=\"return mysubmit("google");\">Web</a>"
Any ideas?
--
Jens Axel Søgaard