#lang scheme/base
(require scheme/contract
web-server/servlet
(file "syntax.ss")
(file "struct.ss")
(only-in (file "struct-internal.ss") quotable-value?))
(define xhtml-1.0-strict-doctype
(xml (!raw #<<ENDDOCTYPE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
ENDDOCTYPE
)))
(define xhtml-1.0-transitional-doctype
(xml (!raw #<<ENDDOCTYPE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
ENDDOCTYPE
)))
(define xhtml-1.0-frameset-doctype
(xml (!raw #<<ENDDOCTYPE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
ENDDOCTYPE
)))
(define no-cache-http-headers
(list (make-header #"Cache-Control" #"no-cache, no-store")
(make-header #"Pragma" #"no-cache")
(make-header #"Expires" #"Mon, 26 Jul 1997 05:00:00 GMT")))
(define (alist->attributes alist)
(map (lambda (kvp)
(make-attribute (car kvp) (cdr kvp)))
alist))
(provide/contract
[xhtml-1.0-strict-doctype xml?]
[xhtml-1.0-transitional-doctype xml?]
[xhtml-1.0-frameset-doctype xml?]
[no-cache-http-headers (listof header?)]
[alist->attributes (-> (listof (cons/c symbol? quotable-value?)) (listof attribute?))])