Thanks, my mistake was the lack of that xhtml declaration in the end of the require and now I understand it goes for the main.rkt in that case. <br><br>It would be useful if the documentation search would return something for "doctype" because I guess many people will want to return conformant responses from their servlets.<br>
<br>I got the module working after these updates:<br>- I made all strings byte-strings to comply with the new API. This included deciding the character set to be utf-8. I suppose this should be configurable. xhtml-mime-type and make-response/xhtml needed updating.<br>
- I changed response? in the contract to response/full?<br>- I added xml-declaration to the beginning of the generated response with the following definition:<br> (define xml-declaration<br> "<?xml version=\"1.0\" encoding=\"utf-8\"?>")<br>
- I made racket/base the module language.<br><br>Maybe these changes should be included in the package as new version?<br><br>-Markku<br><br><div class="gmail_quote">On Sun, Oct 3, 2010 at 12:43 AM, Robby Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Sat, Oct 2, 2010 at 4:20 PM, Markku Rontu <<a href="mailto:markku.rontu@iki.fi">markku.rontu@iki.fi</a>> wrote:<br>
> Hello everybody,<br>
><br>
> I was trying to make some servlets recently and ran into two problems. First<br>
> it was not clear in the documentation how the doctype should be declared for<br>
> random servlets? I didn't want to make a html template based servlet to<br>
> include the doctype. I'd rather create the main parts of the (x)html pages<br>
> with xexprs in Racket code. What do I need to do?<br>
><br>
> I did find in the Schematics cookbook the dherman/xhtml package that seems<br>
> to do what I want but it doesn't seem to work in Racket. Perhaps the library<br>
> isn't updated to Racket? The error I get after requiring it is:<br>
> "C:\...AppData\Roaming\Racket\planet\300\5.0.1\cache\dherman\xhtml.plt\1\2\main.rkt"<br>
> (The system cannot find the file specified.; errno=2)<br>
><br>
> Correct report since the directory does not contain main.rkt but only<br>
> info.ss and xhtml.ss.<br>
<br>
</div>The planet web page [1] suggests this require:<br>
<br>
(require (planet dherman/xhtml:1:2/xhtml))<br>
<br>
it looks like you tried a different one.<br>
<br>
hth,<br>
Robby<br>
<br>
[1]: <a href="http://planet.racket-lang.org/display.ss?package=xhtml.plt&owner=dherman" target="_blank">http://planet.racket-lang.org/display.ss?package=xhtml.plt&owner=dherman</a><br>
</blockquote></div><br>