Skip to content

Commit

Permalink
Added xml-1.0-header.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Gurnell committed Sep 17, 2009
1 parent 35eb163 commit e885fc7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scribblings/xml-util.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ Returns @scheme[#t] if @scheme[val] is an XML fragment that will produce no rend

The following XML expressions are defined for convenience:

@defthing[xml-1.0-header xml]{
An XML 1.0 header that specifies the character encoding as UTF-8:

@interaction[
#:eval xml-eval
(display (xml->string xml-1.0-header))]}

@defthing[xhtml-1.0-strict-doctype xml]{
The HTML 1.0 transitional DOCTYPE, complete with newline character:

Expand Down
7 changes: 7 additions & 0 deletions xml/util.ss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"struct.ss"
(only-in "struct-internal.ss" quotable-value?))

(define xml-1.0-header
(xml (!raw #<<ENDHEADER
<?xml version="1.0" encoding="utf-8"?>
ENDHEADER
)))

; xml
(define xhtml-1.0-strict-doctype
(xml (!raw #<<ENDDOCTYPE
Expand Down Expand Up @@ -39,6 +45,7 @@ ENDDOCTYPE
; Provide statements -----------------------------

(provide/contract
[xml-1.0-header xml?]
[xhtml-1.0-strict-doctype xml?]
[xhtml-1.0-transitional-doctype xml?]
[xhtml-1.0-frameset-doctype xml?]
Expand Down

0 comments on commit e885fc7

Please sign in to comment.