X-Git-Url: http://git.kpe.io/?p=lml2.git;a=blobdiff_plain;f=base.lisp;h=ecfd2792acf2cae51df83376542d717e0ceb7ebb;hp=91319c26527e25a01f88c1ebd3925c74215f77f3;hb=1c71d374606cbbc92dbffdea09292c2acf0755af;hpb=e0405e6089892e5d88082bf12838b73e63440125 diff --git a/base.lisp b/base.lisp index 91319c2..ecfd279 100644 --- a/base.lisp +++ b/base.lisp @@ -38,20 +38,39 @@ (defun lml-print-date (date) (lml-write-string (date-string date))) -(defun dtd-prologue (&optional (format :xhtml11)) +(defun xml-header-stream (stream &key (version "1.0") (standalone :unspecified) + (encoding :unspecified)) + (format stream "" + version + (if (eq standalone :unspecified) + "" + (format nil " standalone=\"~A\"" standalone)) + (if (eq encoding :unspecified) + "" + (format nil " encoding=\"~A\"" encoding)))) + +(defun dtd-prologue (&optional (format :xhtml11) &key entities) (case format ((:xhtml :xhtml11 :xhtml10-strict :xhtml10-transitional :xhtml10-frameset :xml) (lml-write-string +xml-prologue-string+) - (lml-write-char #\newline))) - (case format - ((:xhtml11 :xhtml) - (lml-write-string +xhtml11-dtd-string+)) - (:xhtml10-strict - (lml-write-string +xhtml10-strict-dtd-string+)) - (:xhtml10-transitional - (lml-write-string +xhtml10-transitional-dtd-string+)) - (:xhtml10-frameset - (lml-write-string +xhtml10-frameset-dtd-string+)) + (lml-write-char #\newline) + (case format + ((:xhtml11 :xhtml) + (lml-write-string +xhtml11-dtd-string+)) + (:xhtml10-strict + (lml-write-string +xhtml10-strict-dtd-string+)) + (:xhtml10-transitional + (lml-write-string +xhtml10-transitional-dtd-string+)) + (:xhtml10-frameset + (lml-write-string +xhtml10-frameset-dtd-string+))) + (when entities + (lml-write-char #\space) + (lml-write-char #\[) + (lml-write-char #\Newline) + (lml-write-string entities) + (lml-write-char #\Newline) + (lml-write-char #\])) + (lml-write-char #\>)) (:html (lml-write-string +html4-dtd-string+))) (lml-write-char #\newline))