From dlichteblau at common-lisp.net Wed Oct 3 15:17:08 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Wed, 3 Oct 2007 11:17:08 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/dom
Message-ID: <20071003151708.C31AB3706A@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/dom
In directory clnet:/tmp/cvs-serv23055
Modified Files:
dom-builder.lisp dom-impl.lisp
Log Message:
Grow a buffer for string normalization exponentially.
* dom/dom-builder.lisp (DOM-BUILDER): New slot `text-buffer'.
(SAX:START-ELEMENT, SAX:END-ELEMENT, SAX:START-CDATA,
SAX:END-CDATA, SAX:PROCESSING-INSTRUCTION, SAX:COMMENT): Call
flush-characters. (SAX:CHARACTERS): Rewritten.
(FLUSH-CHARACTERS): New, based on the old sax:characters.
* dom/dom-impl.lisp ((initialize-instance :after entity-reference)):
Call flush-characters.
--- /project/cxml/cvsroot/cxml/dom/dom-builder.lisp 2007/07/22 19:59:26 1.13
+++ /project/cxml/cvsroot/cxml/dom/dom-builder.lisp 2007/10/03 15:17:08 1.14
@@ -18,7 +18,8 @@
(defclass dom-builder ()
((document :initform nil :accessor document)
(element-stack :initform '() :accessor element-stack)
- (internal-subset :accessor internal-subset)))
+ (internal-subset :accessor internal-subset)
+ (text-buffer :initform nil :accessor text-buffer)))
(defun make-dom-builder ()
(make-instance 'dom-builder))
@@ -87,6 +88,7 @@
(defmethod sax:start-element
((handler dom-builder) namespace-uri local-name qname attributes)
(check-type qname rod) ;catch recoder/builder mismatch
+ (flush-characters handler)
(with-slots (document element-stack) handler
(let* ((nsp sax:*namespace-processing*)
(element (make-instance 'element
@@ -126,27 +128,45 @@
(defmethod sax:end-element ((handler dom-builder) namespace-uri local-name qname)
(declare (ignore namespace-uri local-name qname))
+ (flush-characters handler)
(pop (element-stack handler)))
(defmethod sax:characters ((handler dom-builder) data)
- (with-slots (document element-stack) handler
- (let* ((parent (car element-stack))
- (last-child (dom:last-child parent)))
- (cond
- ((eq (dom:node-type parent) :cdata-section)
- (setf (dom:data parent) data))
- ((and last-child (eq (dom:node-type last-child) :text))
- ;; um entities herum wird SAX:CHARACTERS mehrfach aufgerufen fuer
- ;; den gleichen Textknoten. Hier muessen wir den bestehenden Knoten
- ;; erweitern, sonst ist das Dokument nicht normalisiert.
- ;; (XXX Oder sollte man besser den Parser entsprechend aendern?)
- (dom:append-data last-child data))
- (t
- (let ((node (dom:create-text-node document data)))
- (setf (slot-value node 'parent) parent)
- (fast-push node (slot-value (car element-stack) 'children))))))))
+ (with-slots (text-buffer) handler
+ (cond
+ ((null text-buffer)
+ (setf text-buffer data))
+ (t
+ (unless (array-has-fill-pointer-p text-buffer)
+ (setf text-buffer (make-array (length text-buffer)
+ :element-type 'rune
+ :adjustable t
+ :fill-pointer t
+ :initial-contents text-buffer)))
+ (let ((n (length text-buffer))
+ (m (length data)))
+ (adjust-vector-exponentially text-buffer (+ n m) t)
+ (move data text-buffer 0 n m))))))
+
+(defun flush-characters (handler)
+ (with-slots (document element-stack text-buffer) handler
+ (let ((data text-buffer))
+ (when data
+ (when (array-has-fill-pointer-p data)
+ (setf data
+ (make-array (length data)
+ :element-type 'rune
+ :initial-contents data)))
+ (let ((parent (car element-stack)))
+ (if (eq (dom:node-type parent) :cdata-section)
+ (setf (dom:data parent) data)
+ (let ((node (dom:create-text-node document data)))
+ (setf (slot-value node 'parent) parent)
+ (fast-push node (slot-value (car element-stack) 'children)))))
+ (setf text-buffer nil)))))
(defmethod sax:start-cdata ((handler dom-builder))
+ (flush-characters handler)
(with-slots (document element-stack) handler
(let ((node (dom:create-cdata-section document #""))
(parent (car element-stack)))
@@ -155,10 +175,12 @@
(push node element-stack))))
(defmethod sax:end-cdata ((handler dom-builder))
+ (flush-characters handler)
(let ((node (pop (slot-value handler 'element-stack))))
(assert (eq (dom:node-type node) :cdata-section))))
(defmethod sax:processing-instruction ((handler dom-builder) target data)
+ (flush-characters handler)
(with-slots (document element-stack) handler
(let ((node (dom:create-processing-instruction document target data))
(parent (car element-stack)))
@@ -166,6 +188,7 @@
(fast-push node (slot-value (car element-stack) 'children)))))
(defmethod sax:comment ((handler dom-builder) data)
+ (flush-characters handler)
(with-slots (document element-stack) handler
(let ((node (dom:create-comment document data))
(parent (car element-stack)))
--- /project/cxml/cvsroot/cxml/dom/dom-impl.lisp 2006/09/10 14:52:44 1.42
+++ /project/cxml/cvsroot/cxml/dom/dom-impl.lisp 2007/10/03 15:17:08 1.43
@@ -1247,7 +1247,8 @@
(push instance (element-stack handler))
#+cxml-system::utf8dom-file
(setf handler (cxml:make-recoder handler #'cxml:rod-to-utf8-string))
- (funcall resolver (real-rod (dom:name instance)) handler)))
+ (funcall resolver (real-rod (dom:name instance)) handler)
+ (flush-characters handler)))
(labels ((walk (n)
(setf (slot-value n 'read-only-p) t)
(when (dom:element-p n)
From dlichteblau at common-lisp.net Wed Oct 3 15:21:57 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Wed, 3 Oct 2007 11:21:57 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/xml
Message-ID: <20071003152157.3FB9B3706A@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/xml
In directory clnet:/tmp/cvs-serv25157
Modified Files:
xml-parse.lisp
Log Message:
Fixed time and space usage in cases where entity references
follow each other (thanks to Ivan Shvedunov for the report).
* xml/xml-parse.lisp (P/CONTENT): Removed useless call to append.
Use loop instead of tail recursion.
--- /project/cxml/cvsroot/cxml/xml/xml-parse.lisp 2007/08/05 11:15:48 1.72
+++ /project/cxml/cvsroot/cxml/xml/xml-parse.lisp 2007/10/03 15:21:56 1.73
@@ -2800,45 +2800,39 @@
(defun p/content (input)
;; [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
- (multiple-value-bind (cat sem) (peek-token input)
- (case cat
- ((:stag :ztag)
- (p/element input)
- (p/content input))
- ((:CDATA)
- (process-characters input sem)
- (sax:characters (handler *ctx*) sem)
- (p/content input))
- ((:ENTITY-REF)
- (let ((name sem))
- (consume-token input)
- (append
- (recurse-on-entity input name :general
- (lambda (input)
- (prog1
- (etypecase (checked-get-entdef name :general)
- (internal-entdef (p/content input))
- (external-entdef (p/ext-parsed-ent input)))
- (unless (eq (peek-token input) :eof)
- (wf-error input "Trailing garbage. - ~S"
- (peek-token input))))))
- (p/content input))))
- ((:
Update of /project/cxml/cvsroot/cxml/klacks
In directory clnet:/tmp/cvs-serv25228
Modified Files:
klacks.lisp package.lisp
Log Message:
Minor klacks enhancements.
klacks/klacks.lisp (CONSUME-CHARACTERS): New function.
klacks/package.lisp (KLACKS): Export dribble-handler and
consume-characters.
--- /project/cxml/cvsroot/cxml/klacks/klacks.lisp 2007/05/01 18:21:41 1.8
+++ /project/cxml/cvsroot/cxml/klacks/klacks.lisp 2007/10/03 15:22:57 1.9
@@ -79,6 +79,12 @@
(check-type key (member :characters))
characters))
+(defun klacks:consume-characters (source)
+ (with-output-to-string (s)
+ (while (eq (klacks:peek source) :characters)
+ (write-string (klacks:current-characters source) s)
+ (klacks:consume source))))
+
(defun klacks:serialize-event (source handler &key (consume t))
(multiple-value-bind (key a b c) (klacks:peek source)
(let ((result nil))
--- /project/cxml/cvsroot/cxml/klacks/package.lisp 2007/05/01 18:21:41 1.6
+++ /project/cxml/cvsroot/cxml/klacks/package.lisp 2007/10/03 15:22:57 1.7
@@ -21,8 +21,10 @@
(:export #:source
#:close-source
#:with-open-source
+
#:tapping-source
#:make-tapping-source
+ #:dribble-handler
#:peek
#:peek-value
@@ -42,6 +44,7 @@
#:current-lname
#:current-qname
#:current-characters
+ #:consume-characters
#:current-cdata-section-p
#:map-current-namespace-declarations
From dlichteblau at common-lisp.net Wed Oct 3 15:23:40 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Wed, 3 Oct 2007 11:23:40 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/doc
Message-ID: <20071003152340.842514322A@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/doc
In directory clnet:/tmp/cvs-serv25288/doc
Modified Files:
index.xml
Log Message:
web page update
--- /project/cxml/cvsroot/cxml/doc/index.xml 2007/08/29 12:11:17 1.17
+++ /project/cxml/cvsroot/cxml/doc/index.xml 2007/10/03 15:23:40 1.18
@@ -53,8 +53,18 @@
Recent Changes
rel-2007-xx-yy
- - fixed make-source :buffering nil, thanks to Magnus Henoch for
- the report
+ -
+ fixed make-source :buffering nil, thanks to Magnus Henoch for
+ the report
+
+ -
+ fixed time and space usage in cases where entity references
+ follow each other (thanks to Ivan Shvedunov for the report)
+
+ -
+ In the DOM builder, grow a buffer for string normalization
+ exponentially, fixing a long-standing speed issue.
+
rel-2007-08-05
From dlichteblau at common-lisp.net Sun Oct 7 14:45:09 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 7 Oct 2007 10:45:09 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml
Message-ID: <20071007144509.19847554BA@common-lisp.net>
Update of /project/cxml/cvsroot/cxml
In directory clnet:/tmp/cvs-serv20169
Modified Files:
cxml.asd
Log Message:
Moved runes/ into its own cvs module under its new name, closure-common.
--- /project/cxml/cvsroot/cxml/cxml.asd 2007/07/05 20:58:15 1.20
+++ /project/cxml/cvsroot/cxml/cxml.asd 2007/10/07 14:45:07 1.21
@@ -2,8 +2,13 @@
(:use :asdf :cl))
(in-package :cxml-system)
-;; force loading of runes.asd, which installs *features* this file depends on
-(find-system :runes)
+;; force loading of closure-common.asd, which installs *FEATURES* this
+;; file depends on. Use MISSING-DEPENDENCY for asdf-install.
+(unless (find-system :closure-common nil)
+ (error 'missing-dependency
+ :required-by :cxml
+ :version nil
+ :requires :closure-common))
(defclass closure-source-file (cl-source-file) ())
@@ -36,7 +41,7 @@
(:file "space-normalizer" :depends-on ("xml-parse"))
(:file "catalog" :depends-on ("xml-parse"))
(:file "sax-proxy" :depends-on ("xml-parse")))
- :depends-on (:runes :puri #-scl :trivial-gray-streams))
+ :depends-on (:closure-common :puri #-scl :trivial-gray-streams))
(defclass utf8dom-file (closure-source-file) ((of)))
@@ -57,7 +62,8 @@
(defmethod perform ((operation compile-op) (c utf8dom-file))
(let ((*features* (cons 'utf8dom-file *features*))
(*readtable*
- (symbol-value (find-symbol "*UTF8-RUNES-READTABLE*" :runes-system))))
+ (symbol-value (find-symbol "*UTF8-RUNES-READTABLE*"
+ :closure-common-system))))
(call-next-method)))
(asdf:defsystem :cxml-dom
From dlichteblau at common-lisp.net Sun Oct 7 14:45:09 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 7 Oct 2007 10:45:09 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/runes
Message-ID: <20071007144509.10BDF5C000@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/runes
In directory clnet:/tmp/cvs-serv20169/runes
Removed Files:
characters.lisp definline.lisp encodings-data.lisp
encodings.lisp package.lisp runes.lisp stream-scl.lisp
syntax.lisp utf8.lisp xstream.lisp ystream.lisp
Log Message:
Moved runes/ into its own cvs module under its new name, closure-common.
From dlichteblau at common-lisp.net Sun Oct 7 14:58:26 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 7 Oct 2007 10:58:26 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/doc
Message-ID: <20071007145826.5EA7C70C0@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/doc
In directory clnet:/tmp/cvs-serv20897/doc
Modified Files:
index.xml installation.xml
Log Message:
updated documentation for the closure-common split
--- /project/cxml/cvsroot/cxml/doc/index.xml 2007/10/03 15:23:40 1.18
+++ /project/cxml/cvsroot/cxml/doc/index.xml 2007/10/07 14:58:26 1.19
@@ -51,6 +51,18 @@
Recent Changes
+
+ Runes have now been moved into
+ a
separate CVS module unter the
+ name
closure-common. Releases will be available
+ as
separate tarballs in the download directory. Please
+ refer to the
+ installation instructions for details.
+
rel-2007-xx-yy
-
--- /project/cxml/cvsroot/cxml/doc/installation.xml 2007/05/26 21:55:58 1.3
+++ /project/cxml/cvsroot/cxml/doc/installation.xml 2007/10/07 14:58:26 1.4
@@ -5,12 +5,14 @@
Download
-
-
+
Download
tarballs for both cxml itself and closure-common.
-
- Anoncvs (
browse):
-
cvs -d :pserver:anonymous:anonymous at common-lisp.net:/project/cxml/cvsroot co cxml
+ Or use anonymous CVS (
browse):
+
export CVSROOT=:pserver:anonymous:anonymous at common-lisp.net:/project/cxml/cvsroot
+cvs co cxml
+cvs co closure-common
@@ -39,16 +41,20 @@
Prerequisites.
- CXML needs the puri library
- as well as trivial-gray-streams.
+ CXML needs puri and
+ trivial-gray-streams.
+ In addition,
+ closure-common
+ is required, which is a separate module in cxml CVS (see above for
+ check-out instructions).
Compiling and loading CXML.
Register the .asd file, e.g. by symlinking it:
- $ ln -sf `pwd`/cxml.asd /path/to/your/registry/
-$ ln -sf `pwd`/runes.asd /path/to/your/registry/
+ $ ln -sf `pwd`/cxml/cxml.asd /path/to/your/registry/
+$ ln -sf `pwd`/closure-common/closure-common.asd /path/to/your/registry/
Then compile CXML using:
* (asdf:operate 'asdf:load-op :cxml)
From dlichteblau at common-lisp.net Sun Oct 7 15:13:55 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 7 Oct 2007 11:13:55 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml
Message-ID: <20071007151355.C5E2470C0@common-lisp.net>
Update of /project/cxml/cvsroot/cxml
In directory clnet:/tmp/cvs-serv26052
Removed Files:
runes.asd
Log Message:
removed runes.asd
From dlichteblau at common-lisp.net Tue Oct 9 13:08:49 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Tue, 9 Oct 2007 09:08:49 -0400 (EDT)
Subject: [cxml-cvs] CVS closure-common
Message-ID: <20071009130849.D7B583D00D@common-lisp.net>
Update of /project/cxml/cvsroot/closure-common
In directory clnet:/tmp/cvs-serv20249
Added Files:
closure-common.asd
Log Message:
added missing .asd file
--- /project/cxml/cvsroot/closure-common/closure-common.asd 2007/10/09 13:08:49 NONE
+++ /project/cxml/cvsroot/closure-common/closure-common.asd 2007/10/09 13:08:49 1.1
(defpackage :closure-common-system
(:use :asdf :cl)
(:export #:*utf8-runes-readtable*))
(in-package :closure-common-system)
(defvar *utf8-runes-readtable*)
(defclass closure-source-file (cl-source-file) ())
#+sbcl
(defmethod perform :around ((o compile-op) (s closure-source-file))
;; shut up already. Correctness first.
(handler-bind ((sb-ext:compiler-note #'muffle-warning))
(let (#+sbcl (*compile-print* nil))
(call-next-method))))
#-(or rune-is-character rune-is-integer)
(progn
(format t "~&;;; Checking for wide character support...")
(force-output)
(pushnew (dotimes (x 65536
(progn
(format t " ok, characters have at least 16 bits.~%")
:rune-is-character))
(unless (or (<= #xD800 x #xDFFF)
(and (< x char-code-limit) (code-char x)))
(print (code-char x))
(format t " no, reverting to octet strings.~%")
(return :rune-is-integer)))
*features*))
#-rune-is-character
(format t "~&;;; Building Closure with (UNSIGNED-BYTE 16) RUNES~%")
#+rune-is-character
(format t "~&;;; Building Closure with CHARACTER RUNES~%")
(defsystem :closure-common
:default-component-class closure-source-file
:serial t
:components
((:file "package")
(:file "definline")
(:file runes
:pathname
#-rune-is-character "runes"
#+rune-is-character "characters")
#+rune-is-integer (:file "utf8")
(:file "syntax")
#-x&y-streams-are-stream (:file "encodings")
#-x&y-streams-are-stream (:file "encodings-data")
#-x&y-streams-are-stream (:file "xstream")
#-x&y-streams-are-stream (:file "ystream")
#+x&y-streams-are-stream (:file #+scl "stream-scl")
)
:depends-on (#-scl :trivial-gray-streams))
From dlichteblau at common-lisp.net Sun Oct 14 17:29:43 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 14 Oct 2007 13:29:43 -0400 (EDT)
Subject: [cxml-cvs] CVS closure-common
Message-ID: <20071014172943.EF97932027@common-lisp.net>
Update of /project/cxml/cvsroot/closure-common
In directory clnet:/tmp/cvs-serv5860
Modified Files:
closure-common.asd
Added Files:
hax.lisp
Log Message:
New package HAX.
* closure-common.asd: Added hax.lisp
* hax.lisp: New.
--- /project/cxml/cvsroot/closure-common/closure-common.asd 2007/10/09 13:08:49 1.1
+++ /project/cxml/cvsroot/closure-common/closure-common.asd 2007/10/14 17:29:43 1.2
@@ -53,5 +53,5 @@
#-x&y-streams-are-stream (:file "xstream")
#-x&y-streams-are-stream (:file "ystream")
#+x&y-streams-are-stream (:file #+scl "stream-scl")
- )
+ (:file "hax"))
:depends-on (#-scl :trivial-gray-streams))
--- /project/cxml/cvsroot/closure-common/hax.lisp 2007/10/14 17:29:43 NONE
+++ /project/cxml/cvsroot/closure-common/hax.lisp 2007/10/14 17:29:43 1.1
;;; -*- show-trailing-whitespace: t; indent-tabs: nil -*-
;;; ---------------------------------------------------------------------------
;;; Title: An event API for the HTML parser, inspired by SAX
;;; Created: 2007-10-14
;;; Author: David Lichteblau
;;; License: BSD
;;; ---------------------------------------------------------------------------
;;; (c) copyright 2005,2007 David Lichteblau
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are
;;; met:
;;;
;;; 1. Redistributions of source code must retain the above copyright
;;; notice, this list of conditions and the following disclaimer.
;;;
;;; 2. Redistributions in binary form must reproduce the above copyright
;;; notice, this list of conditions and the following disclaimer in the
;;; documentation and/or other materials provided with the distribution
;;;
;;; THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
;;; WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
;;; IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
;;; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
;;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
;;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
;;; STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
;;; IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
;;; POSSIBILITY OF SUCH DAMAGE.
(defpackage :hax
(:use :common-lisp)
(:export #:abstract-handler
#:default-handler
#:make-attribute
#:standard-attribute
#:find-attribute
#:attribute-name
#:attribute-value
#:attribute-specified-p
#:start-document
#:start-element
#:characters
#:end-element
#:end-document
#:comment))
(in-package :hax)
;;;; ATTRIBUTE
(defgeneric attribute-name (attribute))
(defgeneric attribute-value (attribute))
(defgeneric attribute-specified-p (attribute))
(defclass standard-attribute ()
((name :initarg :name :accessor attribute-name)
(value :initarg :value :accessor attribute-value)
(specified-p :initarg :specified-p :accessor attribute-specified-p)))
(defun make-attribute (name value &optional (specified-p t))
(make-instance 'standard-attribute
:name name
:value value
:specified-p specified-p))
(defun %rod= (x y)
;; allow rods *and* strings *and* null
(cond
((zerop (length x)) (zerop (length y)))
((zerop (length y)) nil)
((stringp x) (string= x y))
(t (runes:rod= x y))))
(defun find-attribute (name attrs)
(find name attrs :key #'attribute-name :test #'%rod=))
;;;; ABSTRACT-HANDLER and DEFAULT-HANDLER
(defclass abstract-handler () ())
(defclass default-handler (abstract-handler) ())
(defgeneric start-document (handler name public-id system-id)
(:method ((handler null) name public-id system-id)
(declare (ignore name public-id system-id))
nil)
(:method ((handler default-handler) name public-id system-id)
(declare (ignore name public-id system-id))
nil))
(defgeneric start-element (handler name attributes)
(:method ((handler null) name attributes)
(declare (ignore name attributes))
nil)
(:method ((handler default-handler) name attributes)
(declare (ignore name attributes))
nil))
(defgeneric characters (handler data)
(:method ((handler null) data)
(declare (ignore data))
nil)
(:method ((handler default-handler) data)
(declare (ignore data))
nil))
(defgeneric end-element (handler name)
(:method ((handler null) name)
(declare (ignore name))
nil)
(:method ((handler default-handler) name)
(declare (ignore name))
nil))
(defgeneric end-document (handler)
(:method ((handler null)) nil)
(:method ((handler default-handler)) nil))
(defgeneric comment (handler data)
(:method ((handler null) data)
(declare (ignore data))
nil)
(:method ((handler default-handler) data)
(declare (ignore data))
nil))
From dlichteblau at common-lisp.net Sun Oct 14 17:50:11 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 14 Oct 2007 13:50:11 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/dom
Message-ID: <20071014175011.70A0A1E0B9@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/dom
In directory clnet:/tmp/cvs-serv8803/dom
Modified Files:
dom-builder.lisp
Log Message:
SAX overhaul for HAX integration.
* dom/dom-builder.lisp (DOM-BUILDER): Inherit from
sax:content-handler.
* klacks/klacks-impl.lisp (KLACKS-DTD-HANDLER): Inherit from
sax:default-handler.
* klacks/klacks.lisp (KLACKS:SERIALIZE-EVENT): Bugfix -- call
start-cdata and end-cdata on the handler, not the source.
* xml/package.lisp: New export WITH-OUTPUT-SINK.
* xml/sax-handler.lisp (SAX): New exports abstract-handler,
content-handler, default-handler. (STANDARD-ATTRIBUTE): Renamed
from attribute. (ATTRIBUTE-NAMESPACE-URI, ATTRIBUTE-LOCAL-NAME,
ATTRIBUTE-QNAME, ATTRIBUTE-VALUE, ATTRIBUTE-SPECIFIED-P): Wrapper
methods for standard-attribute. Wrapper methods for
hax:standard-attribute. (all events): pulled into a common
define-event form. New dummy method on null. Added a warning to
the default method. New error method on abstract-handler. New
dummy method on the respective default handler classes.
* xml/sax-proxy.lisp (BROADCAST-HANDLER): Inherit from
abstract-handler, not sax-parser-mixin.
* xml/unparse.lisp (sink): Inherit from sax:content-handler.
(WITH-OUTPUT-SINK): New macro. (INVOKE-WITH-OUTPUT-SINK): New
function.
--- /project/cxml/cvsroot/cxml/dom/dom-builder.lisp 2007/10/03 15:17:08 1.14
+++ /project/cxml/cvsroot/cxml/dom/dom-builder.lisp 2007/10/14 17:50:11 1.15
@@ -15,7 +15,7 @@
(in-package :utf8-dom)
-(defclass dom-builder ()
+(defclass dom-builder (sax:content-handler)
((document :initform nil :accessor document)
(element-stack :initform '() :accessor element-stack)
(internal-subset :accessor internal-subset)
From dlichteblau at common-lisp.net Sun Oct 14 17:50:11 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 14 Oct 2007 13:50:11 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/klacks
Message-ID: <20071014175011.A710025002@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/klacks
In directory clnet:/tmp/cvs-serv8803/klacks
Modified Files:
klacks-impl.lisp klacks.lisp
Log Message:
SAX overhaul for HAX integration.
* dom/dom-builder.lisp (DOM-BUILDER): Inherit from
sax:content-handler.
* klacks/klacks-impl.lisp (KLACKS-DTD-HANDLER): Inherit from
sax:default-handler.
* klacks/klacks.lisp (KLACKS:SERIALIZE-EVENT): Bugfix -- call
start-cdata and end-cdata on the handler, not the source.
* xml/package.lisp: New export WITH-OUTPUT-SINK.
* xml/sax-handler.lisp (SAX): New exports abstract-handler,
content-handler, default-handler. (STANDARD-ATTRIBUTE): Renamed
from attribute. (ATTRIBUTE-NAMESPACE-URI, ATTRIBUTE-LOCAL-NAME,
ATTRIBUTE-QNAME, ATTRIBUTE-VALUE, ATTRIBUTE-SPECIFIED-P): Wrapper
methods for standard-attribute. Wrapper methods for
hax:standard-attribute. (all events): pulled into a common
define-event form. New dummy method on null. Added a warning to
the default method. New error method on abstract-handler. New
dummy method on the respective default handler classes.
* xml/sax-proxy.lisp (BROADCAST-HANDLER): Inherit from
abstract-handler, not sax-parser-mixin.
* xml/unparse.lisp (sink): Inherit from sax:content-handler.
(WITH-OUTPUT-SINK): New macro. (INVOKE-WITH-OUTPUT-SINK): New
function.
--- /project/cxml/cvsroot/cxml/klacks/klacks-impl.lisp 2007/08/23 23:16:00 1.12
+++ /project/cxml/cvsroot/cxml/klacks/klacks-impl.lisp 2007/10/14 17:50:11 1.13
@@ -413,7 +413,7 @@
;;;; terrible kludges
-(defclass klacks-dtd-handler ()
+(defclass klacks-dtd-handler (sax:default-handler)
((handler-source :initarg :source :reader handler-source)
(internal-subset-p :initform nil :accessor handler-internal-subset-p)))
--- /project/cxml/cvsroot/cxml/klacks/klacks.lisp 2007/10/03 15:22:57 1.9
+++ /project/cxml/cvsroot/cxml/klacks/klacks.lisp 2007/10/14 17:50:11 1.10
@@ -96,9 +96,9 @@
(:characters
(cond
((klacks:current-cdata-section-p source)
- (sax:start-cdata source)
+ (sax:start-cdata handler)
(sax:characters handler a)
- (sax:end-cdata source))
+ (sax:end-cdata handler))
(T
(sax:characters handler a))))
(:processing-instruction
From dlichteblau at common-lisp.net Sun Oct 14 17:50:13 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 14 Oct 2007 13:50:13 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/xml
Message-ID: <20071014175013.D22EA49112@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/xml
In directory clnet:/tmp/cvs-serv8803/xml
Modified Files:
package.lisp sax-handler.lisp sax-proxy.lisp unparse.lisp
Log Message:
SAX overhaul for HAX integration.
* dom/dom-builder.lisp (DOM-BUILDER): Inherit from
sax:content-handler.
* klacks/klacks-impl.lisp (KLACKS-DTD-HANDLER): Inherit from
sax:default-handler.
* klacks/klacks.lisp (KLACKS:SERIALIZE-EVENT): Bugfix -- call
start-cdata and end-cdata on the handler, not the source.
* xml/package.lisp: New export WITH-OUTPUT-SINK.
* xml/sax-handler.lisp (SAX): New exports abstract-handler,
content-handler, default-handler. (STANDARD-ATTRIBUTE): Renamed
from attribute. (ATTRIBUTE-NAMESPACE-URI, ATTRIBUTE-LOCAL-NAME,
ATTRIBUTE-QNAME, ATTRIBUTE-VALUE, ATTRIBUTE-SPECIFIED-P): Wrapper
methods for standard-attribute. Wrapper methods for
hax:standard-attribute. (all events): pulled into a common
define-event form. New dummy method on null. Added a warning to
the default method. New error method on abstract-handler. New
dummy method on the respective default handler classes.
* xml/sax-proxy.lisp (BROADCAST-HANDLER): Inherit from
abstract-handler, not sax-parser-mixin.
* xml/unparse.lisp (sink): Inherit from sax:content-handler.
(WITH-OUTPUT-SINK): New macro. (INVOKE-WITH-OUTPUT-SINK): New
function.
--- /project/cxml/cvsroot/cxml/xml/package.lisp 2007/07/07 20:47:39 1.19
+++ /project/cxml/cvsroot/cxml/xml/package.lisp 2007/10/14 17:50:11 1.20
@@ -51,6 +51,7 @@
#:make-character-stream-sink/utf8
#:with-xml-output
+ #:with-output-sink
#:with-namespace
#:with-element
#:with-element*
--- /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/07/01 17:25:45 1.8
+++ /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/10/14 17:50:11 1.9
@@ -3,11 +3,12 @@
;;; Title: A SAX2-like API for the xml parser
;;; Created: 2003-06-30
;;; Author: Henrik Motakef
-;;; Author: David Lichteblau (DTD-related changes)
+;;; Author: David Lichteblau
;;; License: BSD
;;; ---------------------------------------------------------------------------
;;; (c) copyright 2003 by Henrik Motakef
;;; (c) copyright 2004 knowledgeTools Int. GmbH
+;;; (c) copyright 2005-2007 David Lichteblau
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are
@@ -34,15 +35,11 @@
;;; TODO/ Open Questions:
-;; o Should there be a predefined "handler" class, or even several
-;; (like Java SAX' ContentHandler, DTDHandler, LexicalHandler etc? I
-;; don't really see why.
;; o Missing stuff from Java SAX2:
;; * ignorable-whitespace
;; * skipped-entity
;; * The whole ErrorHandler class, this is better handled using
;; conditions (but isn't yet)
-;; * The LexicalHandler (start-cdata etc) would be nice [-- partly done]
(defpackage :sax
(:use :common-lisp)
@@ -50,6 +47,10 @@
#:*include-xmlns-attributes*
#:*use-xmlns-namespace*
+ #:abstract-handler
+ #:content-handler
+ #:default-handler
+
#:make-attribute
#:find-attribute
#:find-attribute-ns
@@ -98,7 +99,7 @@
(defclass sax-parser () ())
-(defclass sax-parser-mixin ()
+(defclass sax-parser-mixin () ;deprecated
((sax-parser :initform nil :reader sax-parser)))
(defgeneric line-number (sax-parser)
@@ -185,13 +186,75 @@
Setting this variable has no effect unless both
`*namespace-processing*' and `*include-xmlns-attributes*' are non-nil.")
-(defstruct attribute
+
+;;;; ATTRIBUTE
+
+(defstruct (standard-attribute (:constructor make-attribute))
namespace-uri
local-name
qname
value
specified-p)
+(defmethod (setf attribute-namespace-uri)
+ (newval (attribute standard-attribute))
+ (setf (standard-attribute-namespace-uri attribute) newval))
+
+(defmethod (setf attribute-local-name)
+ (newval (attribute standard-attribute))
+ (setf (standard-attribute-local-name attribute) newval))
+
+(defmethod (setf attribute-qname)
+ (newval (attribute standard-attribute))
+ (setf (standard-attribute-qname attribute) newval))
+
+(defmethod (setf attribute-value)
+ (newval (attribute standard-attribute))
+ (setf (standard-attribute-value attribute) newval))
+
+(defmethod (setf attribute-specified-p)
+ (newval (attribute standard-attribute))
+ (setf (standard-attribute-specified-p attribute) newval))
+
+(defgeneric attribute-namespace-uri (attribute)
+ (:method ((attribute standard-attribute))
+ (standard-attribute-namespace-uri attribute))
+ (:method ((attribute hax:standard-attribute))
+ ""))
+
+(defgeneric attribute-local-name (attribute)
+ (:method ((attribute standard-attribute))
+ (standard-attribute-local-name attribute))
+ (:method ((attribute hax:standard-attribute))
+ (runes:rod-downcase (hax:attribute-name attribute))))
+
+(defgeneric attribute-qname (attribute)
+ (:method ((attribute standard-attribute))
+ (standard-attribute-qname attribute))
+ (:method ((attribute hax:standard-attribute))
+ (runes:rod-downcase (hax:attribute-name attribute))))
+
+(defgeneric attribute-value (attribute)
+ (:method ((attribute standard-attribute))
+ (standard-attribute-value attribute))
+ (:method ((attribute hax:standard-attribute))
+ (hax:attribute-value attribute)))
+
+(defgeneric attribute-specified-p (attribute)
+ (:method ((attribute standard-attribute))
+ (standard-attribute-specified-p attribute))
+ (:method ((attribute hax:standard-attribute))
+ (hax:attribute-specified-p attribute)))
+
+(defmethod hax:attribute-name ((attribute standard-attribute))
+ (attribute-local-name attribute))
+
+(defmethod hax:attribute-value ((attribute standard-attribute))
+ (attribute-value attribute))
+
+(defmethod hax:attribute-specified-p ((attribute standard-attribute))
+ (attribute-specified-p attribute))
+
(defun %rod= (x y)
;; allow rods *and* strings *and* null
(cond
@@ -209,16 +272,197 @@
(%rod= lname (sax:attribute-local-name attr))))
attrs))
-(defgeneric start-document (handler)
- (:documentation "Called at the beginning of the parsing process,
+
+;;;; ABSTRACT-HANDLER and DEFAULT-HANDLER
+
+(defclass abstract-handler (sax-parser-mixin) ())
+(defclass content-handler (abstract-handler) ())
+(defclass default-handler (content-handler) ())
+
+
+;;;; EVENTS
+
+(macrolet ((define-event ((name default-handler-class)
+ (&rest args)
+ &body hax-body)
+ `(defgeneric ,name (handler , at args)
+ (:method ((handler null) , at args)
+ (declare (ignore , at args))
+ nil)
+ (:method ((handler t) , at args)
+ (declare (ignore , at args))
+ (error "deprecated SAX default method used by a handler ~
+ that is not a subclass of SAX:ABSTRACT-HANDLER ~
+ or HAX:ABSTRACT-HANDLER")
+ nil)
+ (:method ((handler abstract-handler) , at args)
+ (declare (ignore , at args))
+ (error "SAX event ~A not implemented by this handler"
+ ',name))
+ (:method ((handler ,default-handler-class) , at args)
+ (declare (ignore , at args))
+ nil)
+ (:method ((handler hax:abstract-handler) , at args)
+ (declare (ignorable , at args))
+ , at hax-body))))
+ (define-event (start-document default-handler)
+ ()
+ nil)
+
+ (define-event (start-element default-handler)
+ (namespace-uri local-name qname attributes)
+ (hax:start-element handler local-name attributes))
+
+ (define-event (start-prefix-mapping content-handler)
+ (prefix uri)
+ nil)
+
+ (define-event (characters default-handler)
+ (data)
+ (hax:characters handler data))
+
+ (define-event (processing-instruction default-handler)
+ (target data)
+ nil)
+
+ (define-event (end-prefix-mapping content-handler)
+ (prefix)
+ nil)
+
+ (define-event (end-element default-handler)
+ (namespace-uri local-name qname)
+ (hax:end-element handler local-name))
+
+ (define-event (end-document default-handler)
+ ()
+ (hax:end-document handler))
+
+ (define-event (comment content-handler)
+ (data)
+ (hax:comment handler data))
+
+ (define-event (start-cdata content-handler)
+ ()
+ nil)
+
+ (define-event (end-cdata content-handler)
+ ()
+ nil)
+
+ (define-event (start-dtd content-handler)
+ (name public-id system-id)
+ (hax:start-document handler name public-id system-id))
+
+ (define-event (end-dtd content-handler)
+ ()
+ nil)
+
+ (define-event (start-internal-subset content-handler)
+ ()
+ nil)
+
+ (define-event (end-internal-subset content-handler)
+ ()
+ nil)
+
+ (define-event (unparsed-internal-subset content-handler)
+ (str)
+ nil)
+
+ (define-event (unparsed-entity-declaration content-handler)
+ (name public-id system-id notation-name)
+ nil)
+
+ (define-event (external-entity-declaration content-handler)
+ (kind name public-id system-id)
+ nil)
+
+ (define-event (internal-entity-declaration content-handler)
+ (kind name value)
+ nil)
+
+ (define-event (notation-declaration content-handler)
+ (name public-id system-id)
+ nil)
+
+ (define-event (element-declaration content-handler)
+ (name model)
+ nil)
+
+ (define-event (attribute-declaration content-handler)
+ (element-name attribute-name type default)
+ nil)
+
+ (define-event (entity-resolver content-handler)
+ (resolver)
+ nil)
+
+ (define-event (dtd content-handler)
+ (dtd)
+ nil))
+
+;;; special case: this method is defined on abstract-handler through
+;;; sax-parser-mixin
+(defgeneric register-sax-parser (handler sax-parser)
+ (:method ((handler null) sax-parser)
+ (declare (ignore sax-parser))
+ nil)
+ (:method ((handler sax-parser-mixin) sax-parser)
+ (setf (slot-value handler 'sax-parser) sax-parser))
+ (:method ((handler t) sax-parser)
+ (declare (ignore sax-parser))
+ (error "deprecated sax default method used by a handler ~
+ that is not a subclass of sax:abstract-handler ~
+ or hax:abstract-handler")
+ nil)
+ (:method ((handler hax:abstract-handler) sax-parser)
+ (declare (ignorable sax-parser)) nil))
+
+
+;;;; HAX to SAX
+
+(defmethod hax:start-document ((handler abstract-handler) name pubid sysid)
+ (sax:start-document handler)
+ (sax:start-dtd handler name pubid sysid)
+ (sax:end-dtd handler name pubid sysid))
+
+(defmethod hax:start-element ((handler abstract-handler) name attributes)
+ (setf name (runes:rod-downcase name))
+ (sax:start-element handler
+ "http://www.w3.org/1999/xhtml"
+ name
+ name
+ attributes))
+
+(defmethod hax:end-element ((handler abstract-handler) name)
+ (setf name (runes:rod-downcase name))
+ (sax:end-element handler
+ "http://www.w3.org/1999/xhtml"
+ name
+ name))
+
+(defmethod hax:characters ((handler abstract-handler) data)
+ (sax:characters handler data))
+
+(defmethod hax:comment ((handler abstract-handler) str)
+ (sax:comment handler str))
+
+(defmethod hax:end-document ((handler abstract-handler))
+ (sax:end-document handler))
+
+
+
+;;;; Documentation
+
+(setf (documentation 'start-document 'function)
+ "Called at the beginning of the parsing process,
before any element, processing instruction or comment is reported.
Handlers that need to maintain internal state may use this to perform
any neccessary initializations.")
- (:method ((handler t)) nil))
-(defgeneric start-element (handler namespace-uri local-name qname attributes)
- (:documentation "Called to report the beginning of an element.
+(setf (documentation 'start-element 'function)
+ "Called to report the beginning of an element.
There will always be a corresponding call to end-element, even in the
case of an empty element (i.e. ).
@@ -235,12 +479,9 @@
apply. Additionally, namespace-declaring attributes (those whose name
is \"xmlns\" or starts with \"xmlns:\") are only included if
*include-xmlns-attributes* is non-nil.")
- (:method ((handler t) namespace-uri local-name qname attributes)
- (declare (ignore namespace-uri local-name qname attributes))
- nil))
-(defgeneric start-prefix-mapping (handler prefix uri)
- (:documentation "Called when the scope of a new prefix -> namespace-uri mapping begins.
+(setf (documentation 'start-prefix-mapping 'function)
+ "Called when the scope of a new prefix -> namespace-uri mapping begins.
This will always be called immediatly before the `start-element' event
for the element on which the namespaces are declared.
@@ -249,24 +490,21 @@
circumstances, for example when they have to deal with qualified names
in textual content. The parser will handle namespaces of elements and
attributes on its own.")
- (:method ((handler t) prefix uri) (declare (ignore prefix uri)) nil))
-(defgeneric characters (handler data)
- (:documentation "Called for textual element content.
+(setf (documentation 'characters 'function)
+ "Called for textual element content.
The data is passed as a rod, with all entity references resolved.
It is possible that the character content of an element is reported
via multiple subsequent calls to this generic function.")
- (:method ((handler t) data) (declare (ignore data)) nil))
-(defgeneric processing-instruction (handler target data)
- (:documentation "Called when a processing instruction is read.
+(setf (documentation 'processing-instruction 'function)
+ "Called when a processing instruction is read.
Both target and data are rods.")
- (:method ((handler t) target data) (declare (ignore target data)) nil))
-(defgeneric end-prefix-mapping (handler prefix)
- (:documentation "Called when a prefix -> namespace-uri mapping goes out of scope.
+(setf (documentation 'end-prefix-mapping 'function)
+ "Called when a prefix -> namespace-uri mapping goes out of scope.
This will always be called immediatly after the `end-element' event
for the element on which the namespace is declared. The order of the
@@ -276,147 +514,83 @@
circumstances, for example when they have to deal with qualified names
in textual content. The parser will handle namespaces of elements and
attributes on its own.")
- (:method ((handler t) prefix) prefix nil))
-(defgeneric end-element (handler namespace-uri local-name qname)
- (:documentation "Called to report the end of an element.
+(setf (documentation 'end-element 'function)
+ "Called to report the end of an element.
See the documentation for `start-element' for a description of the
parameters.")
- (:method ((handler t) namespace-uri local-name qname)
- (declare (ignore namespace-uri local-name qname))
- nil))
-(defgeneric end-document (handler)
- (:documentation "Called at the end of parsing a document.
+(setf (documentation 'end-document 'function)
+ "Called at the end of parsing a document.
This is always the last function called in the parsing process.
[160 lines skipped]
--- /project/cxml/cvsroot/cxml/xml/sax-proxy.lisp 2007/05/20 09:38:35 1.6
+++ /project/cxml/cvsroot/cxml/xml/sax-proxy.lisp 2007/10/14 17:50:11 1.7
@@ -8,7 +8,7 @@
(in-package :cxml)
-(defclass broadcast-handler (sax:sax-parser-mixin)
+(defclass broadcast-handler (sax:abstract-handler)
((handlers :initform nil
:initarg :handlers
:accessor broadcast-handler-handlers)))
--- /project/cxml/cvsroot/cxml/xml/unparse.lisp 2007/08/05 11:16:15 1.20
+++ /project/cxml/cvsroot/cxml/xml/unparse.lisp 2007/10/14 17:50:12 1.21
@@ -69,7 +69,7 @@
;;;; SINK: an xml output sink
-(defclass sink ()
+(defclass sink (sax:content-handler)
((ystream :initarg :ystream :accessor sink-ystream)
(width :initform 79 :initarg :width :accessor width)
(canonical :initform nil :initarg :canonical :accessor canonical)
@@ -561,6 +561,9 @@
(defmacro with-xml-output (sink &body body)
`(invoke-with-xml-output (lambda () , at body) ,sink))
+(defmacro with-output-sink ((var) &body body)
+ `(invoke-with-output-sink (lambda (,var) , at body)))
+
(defun invoke-with-xml-output (fn sink)
(let ((*sink* sink)
(*current-element* nil)
@@ -570,6 +573,10 @@
(funcall fn)
(sax:end-document *sink*)))
+(defun invoke-with-output-sink (fn)
+ (maybe-emit-start-tag)
+ (funcall fn *sink*))
+
(defmacro with-element (qname &body body)
`(invoke-with-element (lambda () , at body) ,qname))
From dlichteblau at common-lisp.net Sun Oct 14 18:40:27 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 14 Oct 2007 14:40:27 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/xml
Message-ID: <20071014184027.0867F49092@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/xml
In directory clnet:/tmp/cvs-serv17325
Modified Files:
xml-parse.lisp
Log Message:
Fixed (parse xstream ...).
* xml/xml-parse.lisp (PARSE): Call parse-xstream, not
make-xstream.
--- /project/cxml/cvsroot/cxml/xml/xml-parse.lisp 2007/10/03 15:21:56 1.73
+++ /project/cxml/cvsroot/cxml/xml/xml-parse.lisp 2007/10/14 18:40:26 1.74
@@ -3102,7 +3102,7 @@
unless (eq name :pathname)
append (list name value))))
(etypecase input
- (xstream (apply #'make-xstream input handler args))
+ (xstream (apply #'parse-xstream input handler args))
(pathname (apply #'parse-file input handler args))
(rod (apply #'parse-rod input handler args))
(array (apply #'parse-octets input handler args))
From dlichteblau at common-lisp.net Sun Oct 14 19:04:36 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 14 Oct 2007 15:04:36 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/xml
Message-ID: <20071014190436.CCB0270D4@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/xml
In directory clnet:/tmp/cvs-serv20681/xml
Modified Files:
sax-handler.lisp
Log Message:
HAX integration buglet
* xml/sax-handler.lisp (HAX:START-DOCUMENT): Write a doctype only
if a system ID was given.
--- /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/10/14 17:50:11 1.9
+++ /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/10/14 19:04:36 1.10
@@ -423,8 +423,9 @@
(defmethod hax:start-document ((handler abstract-handler) name pubid sysid)
(sax:start-document handler)
- (sax:start-dtd handler name pubid sysid)
- (sax:end-dtd handler name pubid sysid))
+ (when sysid
+ (sax:start-dtd handler name pubid sysid)
+ (sax:end-dtd handler)))
(defmethod hax:start-element ((handler abstract-handler) name attributes)
(setf name (runes:rod-downcase name))
From dlichteblau at common-lisp.net Sun Oct 14 20:19:35 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 14 Oct 2007 16:19:35 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/xml
Message-ID: <20071014201935.7B65932044@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/xml
In directory clnet:/tmp/cvs-serv30396/xml
Modified Files:
sax-handler.lisp
Log Message:
HAX namespace stuff
* xml/sax-handler.lisp (HAX:START-ELEMENT, HAX:END-ELEMENT):
Declare and undeclare the xhtml namespace on elements called
"HTML".
--- /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/10/14 19:04:36 1.10
+++ /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/10/14 20:19:35 1.11
@@ -429,6 +429,15 @@
(defmethod hax:start-element ((handler abstract-handler) name attributes)
(setf name (runes:rod-downcase name))
+ (when (equal name "html")
+ (sax:start-prefix-mapping handler "" "http://www.w3.org/1999/xhtml")
+ (when *include-xmlns-attributes*
+ (push (make-attribute :namespace-uri "http://www.w3.org/2000/xmlns/"
+ :local-name nil
+ :qname "xmlns"
+ :value "http://www.w3.org/1999/xhtml"
+ :specified-p t)
+ attributes)))
(sax:start-element handler
"http://www.w3.org/1999/xhtml"
name
@@ -440,7 +449,9 @@
(sax:end-element handler
"http://www.w3.org/1999/xhtml"
name
- name))
+ name)
+ (when (equal name "html")
+ (sax:end-prefix-mapping handler "")))
(defmethod hax:characters ((handler abstract-handler) data)
(sax:characters handler data))
From dlichteblau at common-lisp.net Sun Oct 14 21:14:08 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 14 Oct 2007 17:14:08 -0400 (EDT)
Subject: [cxml-cvs] CVS closure-common
Message-ID: <20071014211408.4856155354@common-lisp.net>
Update of /project/cxml/cvsroot/closure-common
In directory clnet:/tmp/cvs-serv5820
Modified Files:
xstream.lisp
Log Message:
Allow non-simple strings in MAKE-ROD-XSTREAM, for the benefit of Drakma.
* xstream.lisp (MAKE-ROD-XSTREAM): Coerce non-simple arrays to
simple-string.
--- /project/cxml/cvsroot/closure-common/xstream.lisp 2007/08/29 12:11:17 1.7
+++ /project/cxml/cvsroot/closure-common/xstream.lisp 2007/10/14 21:14:08 1.8
@@ -337,6 +337,8 @@
:name name))))
(defun make-rod-xstream (string &key name)
+ (unless (typep string 'simple-array)
+ (setf string (coerce string 'simple-string)))
;; XXX encoding is mis-handled by this kind of stream
(let ((n (length string)))
(let ((buffer (make-array (1+ n) :element-type 'buffer-byte)))
From dlichteblau at common-lisp.net Sun Oct 21 14:11:28 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 10:11:28 -0400 (EDT)
Subject: [cxml-cvs] CVS closure-common
Message-ID: <20071021141128.BDFE31B01A@common-lisp.net>
Update of /project/cxml/cvsroot/closure-common
In directory clnet:/tmp/cvs-serv30482
Modified Files:
hax.lisp
Log Message:
HAX documentation
--- /project/cxml/cvsroot/closure-common/hax.lisp 2007/10/14 17:29:43 1.1
+++ /project/cxml/cvsroot/closure-common/hax.lisp 2007/10/21 14:11:28 1.2
@@ -129,3 +129,268 @@
(:method ((handler default-handler) data)
(declare (ignore data))
nil))
+
+
+;;;; documentation
+
+(setf (documentation (find-package :hax) t)
+ "An event protocol for HTML serialization, this package is similar
+ to the HAX protocol defined by cxml for XML serialization.
+
+ (Technically, this package should have been spelled SAH, but HAX
+ sounds better.)
+
+ Note that Closure HTML is not a streaming parser yet. Documents
+ are always parsed in full before the first HAX event is emitted.
+ In spite of this restriction, the HAX API is useful for HTML
+ serialization and transformation purposes, and for integration
+ with SAX.
+
+ @begin[HAX handlers]{section}
+ @aboutclass{abstract-handler}
+ @aboutclass{default-handler}
+ @end{section}
+ @begin[The attribute protocol]{section}
+ @aboutclass{standard-attribute}
+ @aboutfun{make-attribute}
+ @aboutfun{attribute-name}
+ @aboutfun{attribute-value}
+ @aboutfun{attribute-specified-p}
+ @end{section}
+ @begin[HAX events]{section}
+ @aboutfun{start-document}
+ @aboutfun{start-element}
+ @aboutfun{end-element}
+ @aboutfun{characters}
+ @aboutfun{comment}
+ @aboutfun{end-document}
+ @end{section}")
+
+(setf (documentation 'abstract-handler 'type)
+ "@short{The superclass of all HAX handlers.}
+
+ Direct subclasses have to implement all event methods, since
+ no default methods are defined on this class.
+
+ Note that it is permissible to use handlers that are not
+ instances of this class in some circumstances.
+
+ In particular,
+ @code{nil} is a valid HAX handler and ignores all events.
+
+ In addition,
+ @a[http://common-lisp.net/project/cxml/sax.html#sax]{SAX handlers}
+ are valid HAX handlers (and vice versa), even though
+ hax:abstract-handler and sax:abstract-handler do not
+ share a specific superclass. HAX events sent to SAX handlers are
+ automatically re-signalled as XHTML SAX events, and SAX events sent
+ to HAX handlers are re-signalled as namespace-less HAX events.
+
+ However, user code should define subclasses of the documented
+ superclasses to enable the HAX/SAX bridging described above.
+
+ @see{chtml:parse}
+ @see{chtml:serialize-lhtml}
+ @see{chtml:serialize-pt}
+ @see{start-document}
+ @see{end-document}
+ @see{start-element}
+ @see{end-element}
+ @see{characters}
+ @see{comment}")
+
+(setf (documentation 'default-handler 'type)
+ "@short{A no-op HAX handler.}
+
+ This class defines methods for all HAX events that do nothing.
+ It is useful as a superclass when implementing a HAX handler that
+ is interested in only some events and not others.
+
+ @see{chtml:parse}
+ @see{chtml:serialize-lhtml}
+ @see{chtml:serialize-pt}
+ @see{start-document}
+ @see{end-document}
+ @see{start-element}
+ @see{end-element}
+ @see{characters}
+ @see{comment}")
+
+(setf (documentation 'standard-attribute 'type)
+ "@short{An implementation of the HAX attribute protocol.}
+
+ A standard class implementing the generic functions for HAX
+ attributes. Instances of this class can be passed to
+ @fun{hax:start-element} in the list of attributes.
+
+ @see-slot{attribute-name}
+ @see-slot{attribute-value}
+ @see-slot{attribute-specified-p}
+ @see-constructor{make-instance}")
+
+(setf (documentation 'make-attribute 'function)
+ "@arg[name]{a string/rod}
+ @arg[value]{a string/rod}
+ @arg[specified-p]{a boolean, default is @code{t}}
+ @return{an instance of @class{standard-attribute}.}
+ @short{Creates a HAX attribute.}
+
+ Creates an instance that can be used with the generic functions
+ for HAX attributes. The result can be passed to
+ @fun{hax:start-element} in the list of attributes.
+
+ @see{attribute-name}
+ @see{attribute-value}
+ @see{attribute-specified-p}")
+
+(setf (documentation 'find-attribute 'function)
+ "@arg[name]{a string/rod}
+ @arg[attrs]{a list of attributes}
+ @return{an attribute, or nil}
+ @short{Searches for an attribute by name.}
+
+ Returns the first attribute in @var{attrs} with the specified name,
+ or @code{nil} if no such attribute was found.
+
+ @see{attribute-name}")
+
+(setf (documentation 'attribute-name 'function)
+ "@arg[instance]{any class implementing this function}
+ @return{a string/rod}
+ @short{Return an attribute's name.}
+
+ Instances of this classes implementing this function can be passed to
+ @fun{hax:start-element} in the list of attributes.
+
+ @see{attribute-value}
+ @see{attribute-specified-p}")
+
+(setf (documentation 'attribute-value 'function)
+ "@arg[instance]{any class implementing this function}
+ @return{a string/rod}
+ @short{Return an attribute's value.}
+
+ Instances of this classes implementing this function can be passed to
+ @fun{hax:start-element} in the list of attributes.
+
+ @see{attribute-name}
+ @see{attribute-specified-p}")
+
+(setf (documentation 'attribute-specified-p 'function)
+ "@arg[instance]{any class implementing this function}
+ @return{a string/rod}
+ @short{Return whether the attribute was contained the parsed document.}
+
+ Attributes return @code{nil} here if they resulted from a default
+ value declaration in a DTD.
+
+ Instances of this classes implementing this function can be passed to
+ @fun{hax:start-element} in the list of attributes.
+
+ @see{attribute-name}
+ @see{attribute-value}")
+
+(setf (documentation 'start-document 'function)
+ "@arg[handler]{a HAX/SAX handler
+ (see @class{abstract-handler} for details)}
+ @arg[name]{root element name, a rod/string}
+ @arg[public-id]{nil or the Public ID, a rod/string}
+ @arg[system-id]{nil or the System ID/URI, a rod/string}
+ @return{unspecified}
+ @short{Signals the beginning on an HTML document.}
+
+ This is the first event sent to any handler.
+
+ If @var{system-id} is non-nil, the document includes a doctype
+ declaration.
+
+ @see{start-element}
+ @see{end-element}
+ @see{characters}
+ @see{comment}
+ @see{end-document}")
+
+(setf (documentation 'start-element 'function)
+ "@arg[handler]{a HAX/SAX handler
+ (see @class{abstract-handler} for details)}
+ @arg[name]{root element name, a rod/string}
+ @arg[attributes]{a list of attributes}
+ @return{unspecified}
+ @short{Signals the beginning of an HTML element.}
+
+ This event corresponds to the opening tag of an element.
+
+ Elements of the attribute list can have any class, but must implement
+ the generic functions for attributes. See @class{standard-attribute}
+ for the built-in attribute implementation.
+
+ @see{find-attribute}
+ @see{start-document}
+ @see{end-element}
+ @see{characters}
+ @see{comment}
+ @see{end-document}")
+
+(setf (documentation 'end-element 'function)
+ "@arg[handler]{a HAX/SAX handler
+ (see @class{abstract-handler} for details)}
+ @arg[name]{root element name, a rod/string}
+ @return{unspecified}
+ @short{Signals the end of an HTML element.}
+
+ This event corresponds to the closing tag of an element.
+
+ @see{start-document}
+ @see{start-element}
+ @see{characters}
+ @see{comment}
+ @see{end-document}")
+
+(setf (documentation 'characters 'function)
+ "@arg[handler]{a HAX/SAX handler
+ (see @class{abstract-handler} for details)}
+ @arg[data]{rod/string}
+ @return{unspecified}
+ @short{Signals character data.}
+
+ This event represents character data in a document.
+
+ @see{start-document}
+ @see{start-element}
+ @see{end-element}
+ @see{comment}
+ @see{end-document}")
+
+(setf (documentation 'comment 'function)
+ "@arg[handler]{a HAX/SAX handler
+ (see @class{abstract-handler} for details)}
+ @arg[data]{rod/string}
+ @return{unspecified}
+ @short{Signals a comment.}
+
+ This event represents a comment.
+
+ @see{start-document}
+ @see{start-element}
+ @see{end-element}
+ @see{characters}
+ @see{end-document}")
+
+(setf (documentation 'end-document 'function)
+ "@arg[handler]{a HAX/SAX handler
+ (see @class{abstract-handler} for details)}
+ @return{The return value of this function depends on the handler class.}
+ @short{Signals the end on an HTML document.}
+
+ This is the last event sent to any handler, and signals the end of
+ serialization.
+
+ The return value of this function is usually returned to user code
+ by higher-level serialization functions and can be considered the
+ result of serialization and \"return value\" of the handler.
+
+ @see{start-document}
+ @see{start-element}
+ @see{end-element}
+ @see{characters}
+ @see{comment}")
From dlichteblau at common-lisp.net Sun Oct 21 14:16:24 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 10:16:24 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/doc
Message-ID: <20071021141624.B96151F00B@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/doc
In directory clnet:/tmp/cvs-serv30820/doc
Modified Files:
index.xml sax.xml
Log Message:
More documentation bits and HAX fixes:
* xml/sax-handler.lisp: Remove namespace attributes in
HAX-to-SAX conversion. Signal a warning in deprecates methods,
not an error.
--- /project/cxml/cvsroot/cxml/doc/index.xml 2007/10/07 14:58:26 1.19
+++ /project/cxml/cvsroot/cxml/doc/index.xml 2007/10/21 14:16:24 1.20
@@ -47,6 +47,12 @@
STP, an alternative to DOM
+
+ ⬗
+ Closure
+ HTML: cxml can be used together with its sister project
+ Closure HTML to convert between HTML and XHTML.
+
@@ -66,6 +72,15 @@
rel-2007-xx-yy
-
+ Moved runes into a separate project.
+
+ -
+ Incompatible SAX changes: Added new classes
+ sax:abstract-handler, sax:content-handler, sax:default-handler.
+ Implementations of SAX handlers should now subclass one of
+ these classes.
+
+ -
fixed make-source :buffering nil, thanks to Magnus Henoch for
the report
--- /project/cxml/cvsroot/cxml/doc/sax.xml 2007/07/07 20:47:38 1.6
+++ /project/cxml/cvsroot/cxml/doc/sax.xml 2007/10/21 14:16:24 1.7
@@ -79,13 +79,11 @@
-
pathname -- a Common Lisp pathname.
- Open the file specified by the pathname and create a source for
- the resulting stream. See below for information on how to
- close the stream.
+ Open the file specified by the pathname and parse its
+ contents as an XML document.
- stream -- a Common Lisp stream with element-type
- (unsigned-byte 8). See below for information on how to
- close the stream.
+ (unsigned-byte 8).
-
octets -- an (unsigned-byte 8) array.
From dlichteblau at common-lisp.net Sun Oct 21 14:16:24 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 10:16:24 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/xml
Message-ID: <20071021141624.EFD241F009@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/xml
In directory clnet:/tmp/cvs-serv30820/xml
Modified Files:
sax-handler.lisp
Log Message:
More documentation bits and HAX fixes:
* xml/sax-handler.lisp: Remove namespace attributes in
HAX-to-SAX conversion. Signal a warning in deprecates methods,
not an error.
--- /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/10/14 20:19:35 1.11
+++ /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/10/21 14:16:24 1.12
@@ -291,9 +291,9 @@
nil)
(:method ((handler t) , at args)
(declare (ignore , at args))
- (error "deprecated SAX default method used by a handler ~
- that is not a subclass of SAX:ABSTRACT-HANDLER ~
- or HAX:ABSTRACT-HANDLER")
+ (warn "deprecated SAX default method used by a handler ~
+ that is not a subclass of SAX:ABSTRACT-HANDLER ~
+ or HAX:ABSTRACT-HANDLER")
nil)
(:method ((handler abstract-handler) , at args)
(declare (ignore , at args))
@@ -311,6 +311,11 @@
(define-event (start-element default-handler)
(namespace-uri local-name qname attributes)
+ (setf attributes
+ (remove "http://www.w3.org/2000/xmlns/"
+ attributes
+ :key #'attribute-namespace-uri
+ :test #'equal))
(hax:start-element handler local-name attributes))
(define-event (start-prefix-mapping content-handler)
From dlichteblau at common-lisp.net Sun Oct 21 14:43:20 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 10:43:20 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/xml
Message-ID: <20071021144320.EDACB2D171@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/xml
In directory clnet:/tmp/cvs-serv3696
Modified Files:
sax-handler.lisp
Log Message:
Another HAX fix:
* xml/sax-handler.lisp: Signal a warning in deprecated method,y
not an error.
--- /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/10/21 14:16:24 1.12
+++ /project/cxml/cvsroot/cxml/xml/sax-handler.lisp 2007/10/21 14:43:20 1.13
@@ -416,7 +416,7 @@
(setf (slot-value handler 'sax-parser) sax-parser))
(:method ((handler t) sax-parser)
(declare (ignore sax-parser))
- (error "deprecated sax default method used by a handler ~
+ (warn "deprecated sax default method used by a handler ~
that is not a subclass of sax:abstract-handler ~
or hax:abstract-handler")
nil)
From dlichteblau at common-lisp.net Sun Oct 21 17:07:23 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 13:07:23 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/dom
Message-ID: <20071021170723.DE6B249087@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/dom
In directory clnet:/tmp/cvs-serv27264/dom
Modified Files:
dom-builder.lisp
Log Message:
hax:%want-strings-p
--- /project/cxml/cvsroot/cxml/dom/dom-builder.lisp 2007/10/14 17:50:11 1.15
+++ /project/cxml/cvsroot/cxml/dom/dom-builder.lisp 2007/10/21 17:07:23 1.16
@@ -21,6 +21,10 @@
(internal-subset :accessor internal-subset)
(text-buffer :initform nil :accessor text-buffer)))
+#+(and rune-is-integer (not cxml-system::utf8dom-file))
+(defmethod hax:%want-strings-p ((handler dom-builder))
+ nil)
+
(defun make-dom-builder ()
(make-instance 'dom-builder))
From dlichteblau at common-lisp.net Sun Oct 21 17:07:24 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 13:07:24 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/xml
Message-ID: <20071021170724.226215411F@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/xml
In directory clnet:/tmp/cvs-serv27264/xml
Modified Files:
sax-proxy.lisp unparse.lisp
Log Message:
hax:%want-strings-p
--- /project/cxml/cvsroot/cxml/xml/sax-proxy.lisp 2007/10/14 17:50:11 1.7
+++ /project/cxml/cvsroot/cxml/xml/sax-proxy.lisp 2007/10/21 17:07:23 1.8
@@ -29,6 +29,10 @@
(defmethod (setf proxy-chained-handler) (newval (instance sax-proxy))
(setf (broadcast-handler-handlers instance) (list newval)))
+#-rune-is-character
+(defmethod hax:%want-strings-p ((handler broadcast-handler))
+ (hax:%want-strings-p (car (broadcast-handler-handlers instance))))
+
(macrolet ((define-proxy-method (name (&rest args))
`(defmethod ,name ((handler broadcast-handler) , at args)
(let (result)
--- /project/cxml/cvsroot/cxml/xml/unparse.lisp 2007/10/14 17:50:12 1.21
+++ /project/cxml/cvsroot/cxml/xml/unparse.lisp 2007/10/21 17:07:23 1.22
@@ -82,6 +82,10 @@
(have-internal-subset :initform nil :accessor have-internal-subset)
(stack :initform nil :accessor stack)))
+#-rune-is-character
+(defmethod hax:%want-strings-p ((handler sink))
+ nil)
+
(defmethod initialize-instance :after ((instance sink) &key)
(when (eq (canonical instance) t)
(setf (canonical instance) 1))
From dlichteblau at common-lisp.net Sun Oct 21 17:07:38 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 13:07:38 -0400 (EDT)
Subject: [cxml-cvs] CVS closure-common
Message-ID: <20071021170738.D3F6B54162@common-lisp.net>
Update of /project/cxml/cvsroot/closure-common
In directory clnet:/tmp/cvs-serv27317
Modified Files:
closure-common.asd hax.lisp utf8.lisp
Log Message:
hax:%want-strings-p
--- /project/cxml/cvsroot/closure-common/closure-common.asd 2007/10/14 17:29:43 1.2
+++ /project/cxml/cvsroot/closure-common/closure-common.asd 2007/10/21 17:07:38 1.3
@@ -25,7 +25,6 @@
:rune-is-character))
(unless (or (<= #xD800 x #xDFFF)
(and (< x char-code-limit) (code-char x)))
- (print (code-char x))
(format t " no, reverting to octet strings.~%")
(return :rune-is-integer)))
*features*))
--- /project/cxml/cvsroot/closure-common/hax.lisp 2007/10/21 14:11:28 1.2
+++ /project/cxml/cvsroot/closure-common/hax.lisp 2007/10/21 17:07:38 1.3
@@ -9,15 +9,15 @@
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are
-;;; met:
-;;;
+;;; met:
+;;;
;;; 1. Redistributions of source code must retain the above copyright
-;;; notice, this list of conditions and the following disclaimer.
-;;;
+;;; notice, this list of conditions and the following disclaimer.
+;;;
;;; 2. Redistributions in binary form must reproduce the above copyright
;;; notice, this list of conditions and the following disclaimer in the
;;; documentation and/or other materials provided with the distribution
-;;;
+;;;
;;; THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
;;; WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -34,20 +34,23 @@
(:use :common-lisp)
(:export #:abstract-handler
#:default-handler
-
+
#:make-attribute
#:standard-attribute
#:find-attribute
#:attribute-name
#:attribute-value
#:attribute-specified-p
-
+
#:start-document
#:start-element
#:characters
#:end-element
#:end-document
- #:comment))
+ #:comment
+
+ #+rune-is-integer
+ #:%want-strings-p))
(in-package :hax)
@@ -86,6 +89,11 @@
(defclass abstract-handler () ())
(defclass default-handler (abstract-handler) ())
+#+rune-is-integer
+(defgeneric %want-strings-p (handler)
+ (:method ((handler null)) nil)
+ (:method ((handler abstract-handler)) t))
+
(defgeneric start-document (handler name public-id system-id)
(:method ((handler null) name public-id system-id)
(declare (ignore name public-id system-id))
--- /project/cxml/cvsroot/closure-common/utf8.lisp 2007/05/26 21:55:58 1.3
+++ /project/cxml/cvsroot/closure-common/utf8.lisp 2007/10/21 17:07:38 1.4
@@ -29,7 +29,7 @@
(defun rod-reader (stream subchar arg)
(runes::rod-string (runes::rod-reader stream subchar arg)))
-(setf runes-system:*utf8-runes-readtable*
+(setf closure-common-system:*utf8-runes-readtable*
(let ((rt (copy-readtable)))
(set-dispatch-macro-character #\# #\/ 'rune-reader rt)
(set-dispatch-macro-character #\# #\" 'rod-reader rt)
From dlichteblau at common-lisp.net Sun Oct 21 17:49:24 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 13:49:24 -0400 (EDT)
Subject: [cxml-cvs] CVS closure-common
Message-ID: <20071021174924.0C7CE79144@common-lisp.net>
Update of /project/cxml/cvsroot/closure-common
In directory clnet:/tmp/cvs-serv1473
Modified Files:
hax.lisp
Log Message:
typos
--- /project/cxml/cvsroot/closure-common/hax.lisp 2007/10/21 17:07:38 1.3
+++ /project/cxml/cvsroot/closure-common/hax.lisp 2007/10/21 17:49:23 1.4
@@ -143,7 +143,7 @@
(setf (documentation (find-package :hax) t)
"An event protocol for HTML serialization, this package is similar
- to the HAX protocol defined by cxml for XML serialization.
+ to the SAX protocol defined by cxml for XML serialization.
(Technically, this package should have been spelled SAH, but HAX
sounds better.)
@@ -305,7 +305,7 @@
@arg[public-id]{nil or the Public ID, a rod/string}
@arg[system-id]{nil or the System ID/URI, a rod/string}
@return{unspecified}
- @short{Signals the beginning on an HTML document.}
+ @short{Signals the beginning of an HTML document.}
This is the first event sent to any handler.
@@ -326,7 +326,7 @@
@return{unspecified}
@short{Signals the beginning of an HTML element.}
- This event corresponds to the opening tag of an element.
+ This event corresponds to the opening tag of an element.
Elements of the attribute list can have any class, but must implement
the generic functions for attributes. See @class{standard-attribute}
@@ -346,7 +346,7 @@
@return{unspecified}
@short{Signals the end of an HTML element.}
- This event corresponds to the closing tag of an element.
+ This event corresponds to the closing tag of an element.
@see{start-document}
@see{start-element}
@@ -388,7 +388,7 @@
"@arg[handler]{a HAX/SAX handler
(see @class{abstract-handler} for details)}
@return{The return value of this function depends on the handler class.}
- @short{Signals the end on an HTML document.}
+ @short{Signals the end of an HTML document.}
This is the last event sent to any handler, and signals the end of
serialization.
From dlichteblau at common-lisp.net Sun Oct 21 18:31:53 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 14:31:53 -0400 (EDT)
Subject: [cxml-cvs] CVS closure-common
Message-ID: <20071021183153.17193601A8@common-lisp.net>
Update of /project/cxml/cvsroot/closure-common
In directory clnet:/tmp/cvs-serv8224
Added Files:
dist.sh
Log Message:
dist.sh script for release preparation
--- /project/cxml/cvsroot/closure-common/dist.sh 2007/10/21 18:31:53 NONE
+++ /project/cxml/cvsroot/closure-common/dist.sh 2007/10/21 18:31:53 1.1
#!/bin/sh
cd $(dirname $0)
home=$(pwd)
name=$(basename $home)
dir=${name}-$(date --iso)
TMPDIR=`mktemp -d /tmp/dist.XXXXXXXXXX`
cleanup() {
cd
rm -rf $TMPDIR
}
trap cleanup exit
cd $TMPDIR
cvs -d "`cat $home/CVS/Root`" export -r HEAD -d "$dir" "$name"
tgz=$TMPDIR/${dir}.tgz
tar czf $tgz $dir
gpg -b -a $tgz
mv $tgz $tgz.asc $home/
From dlichteblau at common-lisp.net Sun Oct 21 18:39:40 2007
From: dlichteblau at common-lisp.net (dlichteblau)
Date: Sun, 21 Oct 2007 14:39:40 -0400 (EDT)
Subject: [cxml-cvs] CVS cxml/doc
Message-ID: <20071021183940.1E58A601A8@common-lisp.net>
Update of /project/cxml/cvsroot/cxml/doc
In directory clnet:/tmp/cvs-serv8649
Modified Files:
index.xml
Log Message:
release
--- /project/cxml/cvsroot/cxml/doc/index.xml 2007/10/21 14:16:24 1.20
+++ /project/cxml/cvsroot/cxml/doc/index.xml 2007/10/21 18:39:40 1.21
@@ -69,7 +69,7 @@
refer to the
installation instructions for details.
-
rel-2007-xx-yy
+ rel-2007-10-21
-
Moved runes into a separate project.