From d9fe9dfd51c56789a74225b5b714cfe6ca418166 Mon Sep 17 00:00:00 2001 From: dlichteblau Date: Sun, 1 Jul 2007 18:52:26 +0000 Subject: [PATCH] new function cxml:doctype --- doc/sax.xml | 1 + xml/package.lisp | 1 + xml/unparse.lisp | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/doc/sax.xml b/doc/sax.xml index 93124f3..b32cd7e 100644 --- a/doc/sax.xml +++ b/doc/sax.xml @@ -299,6 +299,7 @@
Function CXML:ATTRIBUTE* (prefix lname value) => value
Function CXML:TEXT (data) => data
Function CXML:CDATA (data) => data
+
Function CXML:doctype (name public-id system-id &optional internal-subset)
Convenience syntax for event-based serialization.

diff --git a/xml/package.lisp b/xml/package.lisp index c0d1550..580af19 100644 --- a/xml/package.lisp +++ b/xml/package.lisp @@ -58,6 +58,7 @@ #:unparse-attribute #:cdata #:text + #:doctype #:xml-parse-error #:well-formedness-violation diff --git a/xml/unparse.lisp b/xml/unparse.lisp index abf8796..a9a2482 100644 --- a/xml/unparse.lisp +++ b/xml/unparse.lisp @@ -564,6 +564,12 @@ (defmacro with-namespace ((prefix uri) &body body) `(invoke-with-namespace (lambda () ,@body) ,prefix ,uri)) +(defun doctype (name public-id system-id &optional internal-subset) + (sax:start-dtd *sink* name public-id system-id) + (when internal-subset + (sax:unparsed-internal-subset *sink* internal-subset)) + (sax:end-dtd *sink*)) + (defun maybe-emit-start-tag () (when *current-element* ;; starting child node, need to emit opening tag of parent first: