[racket] read-xml: lex-error when reading Javascript

From: Alegria Baquero (abaquero at uci.edu)
Date: Fri Apr 25 12:01:42 EDT 2014

Hello,

I am using the web-server/servlet library to deploy an html:

(let ((start (lambda (req)
                 (response/xexpr
                  (string->xexpr (include-template "ui/page.html"))))))


Page.html includes Javascript code and everything works well until I try to
use a comparison operator.  So for example, when read-xml tries to read the
javascript for loop

for (var i=0;i<nodeList.length;i++) {
                    alert("hello");
                }

It gives the following error:

read-xml: lex-error: at position 42.59/1747: expected / or > to close tag
`nodeList.length'

It turns out it believes the operator '<' is an opening xml tag.

Has anyone found a way to fix/circumvent this problem?

Thanks a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140425/d3f5af52/attachment-0001.html>

Posted on the users mailing list.