<div dir="ltr"><div>Great. Thanks for your help. I will try first using the CDATA tags.<br></div>Thanks again.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 2, 2014 at 5:46 PM, Matthew Butterick <span dir="ltr"><<a href="mailto:mb@mbtype.com" target="_blank">mb@mbtype.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The handling of <script> and <style> tags is a notable difference between XML & HTML. If you want your HTML to be usable as XML, then you have to enclose the contents of any <script> or <style> tag in a CDATA tag. (Whereas HTML parsers assume this is true by default — in that case, CDATA tags aren't wrong, they're just unnecessary.)<br>
<br>
If your HTML template is a static file, you can just put the CDATA tags in manually.<br>
<br>
If you're using x-expressions to generate the HTML, the xexpr->html function in my txexpr library is a replacement for xexpr->string that will add the CDATA tags.<br>
<br>
raco pkg install txexpr<br>
<div><div class="h5"><br>
<br>
<br>
On Apr 25, 2014, at 1:01 PM, Alegria Baquero <<a href="mailto:alegriabaquero@gmail.com">alegriabaquero@gmail.com</a>> wrote:<br>
<br>
> Hello,<br>
><br>
> I am using the web-server/servlet library to deploy an html:<br>
><br>
> (let ((start (lambda (req)<br>
> (response/xexpr<br>
> (string->xexpr (include-template "ui/page.html"))))))<br>
><br>
><br>
> 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<br>
><br>
> for (var i=0;i<nodeList.length;i++) {<br>
> alert("hello");<br>
> }<br>
><br>
> It gives the following error:<br>
><br>
> read-xml: lex-error: at position 42.59/1747: expected / or > to close tag `nodeList.length'<br>
><br>
> It turns out it believes the operator '<' is an opening xml tag.<br>
><br>
> Has anyone found a way to fix/circumvent this problem?<br>
><br>
> Thanks a lot.<br>
><br>
><br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">---------------------------------------------------------------------------------------</span><div>
<span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">PhD candidate<br><span style="background-color:rgb(255,255,255)">Department of Informatics<br><span style="color:rgb(34,34,34)">Donald</span> <span style="color:rgb(34,34,34)">Bren</span> School of Information and Computer Sciences<br>
University of Cal</span>ifornia, Irvine</span></div>
</div>