(let ((document
(read/expand-xml-file pathname
(make-expansion-environment pathname))))
- (if (not (xml-document-dtd document))
- (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!
(define (html-dtd? object)
(and (xml-dtd? object)
- (eq? (xml-dtd-root object) 'html)
- (html-external-id? (xml-dtd-external object))
- (null? (xml-dtd-internal object))))
+ (eq? (xml-dtd-root object) 'html)))
\f
(define (html-1.0-document attrs . items)
(%make-document html-1.0-dtd attrs items))
(lambda (string ctx)
(write-escaped-string string
'((#\< . "<")
- (#\& . "&"))
+ (#\> . ">")
+ (#\& . "&")
+ (#\' . "'"))
ctx)))
(define-predicate-dispatch-handler %write-xml (list xml-entity-ref? ctx?)