From b48fa996e6a2f2d69d25abf847fa1251409de865 Mon Sep 17 00:00:00 2001 From: David Lichteblau Date: Sun, 16 Dec 2007 18:49:28 +0100 Subject: [PATCH] New argument documentp to serialize-pt. --- src/parse/html-parser.lisp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/parse/html-parser.lisp b/src/parse/html-parser.lisp index a366e50..578a910 100644 --- a/src/parse/html-parser.lisp +++ b/src/parse/html-parser.lisp @@ -110,7 +110,8 @@ (string (coerce value 'rod))))) (hax:make-attribute n v t)))) -(defun serialize-pt (document handler &key (name "HTML") public-id system-id) +(defun serialize-pt (document handler + &key (name "HTML") public-id system-id (documentp t)) (let* ((recodep (or #+rune-is-integer (hax:%want-strings-p handler))) (recode (if recodep @@ -119,7 +120,8 @@ (rod-to-utf8-string rod) rod)) #'identity))) - (hax:start-document handler name public-id system-id) + (when documentp + (hax:start-document handler name public-id system-id)) (labels ((recurse (pt) (cond ((eq (gi pt) :pcdata) @@ -136,7 +138,8 @@ (mapc #'recurse (pt-children pt)) (hax:end-element handler name)))))) (recurse document)) - (hax:end-document handler))) + (when documentp + (hax:end-document handler)))) (defclass pt-builder (hax:abstract-handler) ((current :initform nil :accessor current) -- 2.11.4.GIT