[plt-scheme] html in servlets

From: ifconfig (nslookupifconfig at hotmail.com)
Date: Sun May 16 05:21:38 EDT 2004

> When devloping some servlets, it seems to me that arbitrary HTML codes can
> be
> put in XML box and they will be send directly to HTTP clients. But after a

Note, that this is an XML box and not an HTML box.

> few
> tries, I find that these HTML codes will first be converted to S-exps and
> then
> converted back to HTML, which causes a big problem: many HTML codes just
> can't
> be converted to S-exps. For example the followings are all HTML code of a
> table:

These are valid HTML codes. But not valid XML codes - except the second one.

> <table<
> <tr><th>Food</th><th>Drink</th><th>Sweet</th<
> <tr><td>A</td><td>B</td><td>C</td<
> </table<
> <table>
> <tr><th>Food</th><th>Drink</th><th>Sweet</th></tr<
> <tr><td>A</td><td>B</td><td>C</td></tr<
> </table<
> <table border<
> <tr><th>Food</th><th>Drink</th><th>Sweet</th></tr<
> >tr><td>A</td><td>B</td><td>C</td></tr<
> </table<
> But only the second one can be accepted by DrScheme. (This is only a
> simple
> example. Some HTML is so complicated that I can't even write them as S-
> exps
> by hand(.
> I know that under some situations DrScheme need to convert XML-box into
> S-exps, but just for servlets, is it possible to give out arbitrary HTML
> codes?

The correct syntax for XML requires that all tags be closed, and that all
attributes have ="something". (e.g. border="1")

Posted on the users mailing list.