[racket] doctype in an xexpr?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sun Nov 27 01:07:42 EST 2011

An Xexpr only encodes an XML element. The DOCTYPE is part of the document

The response/xexpr function therefore provides the #:preamble keyword that
gives you the ability to put some bytes up front.

Your wish...

(define (start req)
  "<!DOCTYPE html>"
  `(html (head (title "Hello world!"))
         (body (p "Hey out there!")))))

is almost my command...

(define (start req)
  #:preamble #"<!DOCTYPE html>"
  `(html (head (title "Hello world!"))
         (body (p "Hey out there!")))))

On Sat, Nov 26, 2011 at 9:44 PM, Jordan Schatz <jordan at noionlabs.com> wrote:

> I don't see any way to include a DOCTYPE declaration in an xexpr?
> (define (start req)
>  (response/xexpr
>   "<!DOCTYPE html>"
>   `(html (head (title "Hello world!"))
>          (body (p "Hey out there!")))))
> (except of course that doesn't work : )
> Shalom,
> Jordan
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111126/658ff894/attachment.html>

Posted on the users mailing list.