#| -*-Scheme-*-
-$Id: xhtml.scm,v 1.8 2004/07/24 02:12:14 cph Exp $
+$Id: xhtml.scm,v 1.9 2004/07/24 02:26:19 cph Exp $
Copyright 2002,2003,2004 Massachusetts Institute of Technology
(declare (usual-integrations))
\f
+(define (html-1.0-document attrs . items)
+ (%make-document html-1.0-dtd attrs items))
+
(define html-1.0-external-dtd
(make-xml-external-id "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"))
(define html-1.0-dtd
(make-xml-dtd 'html html-1.0-external-dtd '()))
+(define (html-1.1-document attrs . items)
+ (%make-document html-1.1-dtd attrs items))
+
(define html-1.1-external-dtd
(make-xml-external-id "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"))
(define html-1.1-dtd
(make-xml-dtd 'html html-1.1-external-dtd '()))
+(define (%make-document dtd attrs items)
+ (make-xml-document (make-xml-declaration "1.0" "UTF-8" #f)
+ '("\n")
+ dtd
+ '("\n")
+ (html:html (if (there-exists? attrs
+ (lambda (attr)
+ (eq? (xml-attribute-name attr)
+ 'xmlns)))
+ attrs
+ (xml-attrs 'xmlns html-iri attrs))
+ items)
+ '()))
+
(define html-iri
(make-xml-namespace-iri "http://www.w3.org/1999/xhtml"))
(define (guarantee-html-element-name object caller)
(if (not (html-element-name? object))
(error:wrong-type-argument object "XHTML element name" caller)))
-
+\f
(define-syntax define-html-element
(sc-macro-transformer
(lambda (form environment)
(define element-context-map
(make-eq-hash-table))
-\f
+
(define-html-element a inline)
(define-html-element abbr inline)
(define-html-element acronym inline)
(define-html-element div block)
(define-html-element dl block)
(define-html-element dt dl)
+\f
(define-html-element em inline)
(define-html-element fieldset block)
(define-html-element form block)
#| -*-Scheme-*-
-$Id: xml.pkg,v 1.48 2004/07/24 02:12:20 cph Exp $
+$Id: xml.pkg,v 1.49 2004/07/24 02:26:24 cph Exp $
Copyright 2001,2002,2003,2004 Massachusetts Institute of Technology
(files "xhtml")
(parent (runtime xml))
(export ()
+ (html-document html-1.0-document)
(html-dtd html-1.0-dtd)
(html-external-dtd html-1.0-external-dtd)
guarantee-html-element
guarantee-html-element-name
+ html-1.0-document
html-1.0-dtd
html-1.0-external-dtd
+ html-1.1-document
html-1.1-dtd
html-1.1-external-dtd
html-element-context