#| -*-Scheme-*-
-$Id: xhtml-expander.scm,v 1.8 2006/02/02 20:49:54 cph Exp $
+$Id: xhtml-expander.scm,v 1.9 2006/02/02 20:53:23 cph Exp $
Copyright 2002,2003,2004,2006 Massachusetts Institute of Technology
(read/expand-xml-file pathname
(make-expansion-environment pathname))))
(if (not (xml-document-declaration document))
- (set-xml-document-declaration! document
- (make-xml-declaration "1.0" #f #f)))
+ (begin
+ (set-xml-document-declaration! document
+ (make-xml-declaration "1.0" #f #f))
+ (set-xml-document-misc-1! document
+ (cons "\n"
+ (xml-document-misc-1 document)))))
(if (not (xml-document-dtd document))
- (set-xml-document-dtd! document html-1.0-dtd))
+ (begin
+ (set-xml-document-dtd! document html-1.0-dtd)
+ (set-xml-document-misc-2! document
+ (cons "\n"
+ (xml-document-misc-2 document)))))
(let ((root (xml-document-root document)))
(if (not (find-xml-attr 'xmlns root))
(set-xml-element-attributes!
`((scheme ,(pi-expander environment))
(svar ,svar-expander)
(sabbr ,sabbr-expander)))))))
-
+\f
(define (make-expansion-environment pathname)
(let ((pathname (merge-pathnames pathname))
(environment (extend-top-level-environment expander-environment)))
(expander-eval expression environment)
(loop))))))
(car *outputs*)))
-\f
+
(define expander-eval eval)
(define (svar-expander text)