An Xexpr only encodes an XML element. The DOCTYPE is part of the document meta-data.<div><br></div><div>The response/xexpr function therefore provides the #:preamble keyword that gives you the ability to put some bytes up front.</div>
<div><br></div><div>Your wish...</div><div><br></div><div><div>(define (start req)</div><div> (response/xexpr</div><div> "<!DOCTYPE html>"</div><div> `(html (head (title "Hello world!"))</div><div>
(body (p "Hey out there!")))))</div><div><br></div><div>is almost my command...</div><div><br></div><div><div>(define (start req)</div><div> (response/xexpr</div><div> #:preamble #"<!DOCTYPE html>"</div>
<div> `(html (head (title "Hello world!"))</div><div> (body (p "Hey out there!")))))</div></div><br><div class="gmail_quote">On Sat, Nov 26, 2011 at 9:44 PM, Jordan Schatz <span dir="ltr"><<a href="mailto:jordan@noionlabs.com">jordan@noionlabs.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I don't see any way to include a DOCTYPE declaration in an xexpr?<br>
<br>
(define (start req)<br>
(response/xexpr<br>
"<!DOCTYPE html>"<br>
`(html (head (title "Hello world!"))<br>
(body (p "Hey out there!")))))<br>
<br>
(except of course that doesn't work : )<br>
<br>
Shalom,<br>
Jordan<br>
<br>
_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Jay McCarthy <<a href="mailto:jay@cs.byu.edu" target="_blank">jay@cs.byu.edu</a>><br>Assistant Professor / Brigham Young University<br><a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
<br>"The glory of God is Intelligence" - D&C 93<br>
</div>