From scaekenberghe at common-lisp.net Wed Aug 17 08:06:02 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Wed, 17 Aug 2005 10:06:02 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/src/lxml-dom.lisp s-xml/src/sxml-dom.lisp Message-ID: <20050817080602.43FE28853E@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/src In directory common-lisp.net:/tmp/cvs-serv9479/src Modified Files: lxml-dom.lisp sxml-dom.lisp Log Message: removed some unused format arguments Date: Wed Aug 17 10:06:01 2005 Author: scaekenberghe Index: s-xml/src/lxml-dom.lisp diff -u s-xml/src/lxml-dom.lisp:1.1.1.1 s-xml/src/lxml-dom.lisp:1.2 --- s-xml/src/lxml-dom.lisp:1.1.1.1 Mon Jun 7 20:49:56 2004 +++ s-xml/src/lxml-dom.lisp Wed Aug 17 10:06:01 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: lxml-dom.lisp,v 1.1.1.1 2004/06/07 18:49:56 scaekenberghe Exp $ +;;;; $Id: lxml-dom.lisp,v 1.2 2005/08/17 08:06:01 scaekenberghe Exp $ ;;;; ;;;; LXML implementation of the generic DOM parser and printer. ;;;; @@ -77,7 +77,7 @@ (terpri stream) (dotimes (i (* 2 (1- level))) (write-char #\space stream))))) (format stream "" tag)) - (format stream "/>" tag)))) + (format stream "/>")))) (t (error "Input not recognized as LXML ~s" dom)))) ;;;; eof Index: s-xml/src/sxml-dom.lisp diff -u s-xml/src/sxml-dom.lisp:1.1.1.1 s-xml/src/sxml-dom.lisp:1.2 --- s-xml/src/sxml-dom.lisp:1.1.1.1 Mon Jun 7 20:49:57 2004 +++ s-xml/src/sxml-dom.lisp Wed Aug 17 10:06:01 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: sxml-dom.lisp,v 1.1.1.1 2004/06/07 18:49:57 scaekenberghe Exp $ +;;;; $Id: sxml-dom.lisp,v 1.2 2005/08/17 08:06:01 scaekenberghe Exp $ ;;;; ;;;; LXML implementation of the generic DOM parser and printer. ;;;; @@ -71,7 +71,7 @@ (terpri stream) (dotimes (i (* 2 (1- level))) (write-char #\space stream))))) (format stream "" tag)) - (format stream "/>" tag)))) + (format stream "/>")))) (t (error "Input not recognized as SXML ~s" dom)))) ;;;; eof From scaekenberghe at common-lisp.net Wed Aug 17 13:44:31 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Wed, 17 Aug 2005 15:44:31 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/src/xml.lisp Message-ID: <20050817134431.886768853E@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/src In directory common-lisp.net:/tmp/cvs-serv32224/src Modified Files: xml.lisp Log Message: moved echo code into its own file in test/ Date: Wed Aug 17 15:44:29 2005 Author: scaekenberghe Index: s-xml/src/xml.lisp diff -u s-xml/src/xml.lisp:1.6 s-xml/src/xml.lisp:1.7 --- s-xml/src/xml.lisp:1.6 Mon Jan 24 11:03:09 2005 +++ s-xml/src/xml.lisp Wed Aug 17 15:44:29 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: xml.lisp,v 1.6 2005/01/24 10:03:09 scaekenberghe Exp $ +;;;; $Id: xml.lisp,v 1.7 2005/08/17 13:44:29 scaekenberghe Exp $ ;;;; ;;;; This is a Common Lisp implementation of a very basic XML parser. ;;;; The parser is non-validating and not at all complete (no CDATA). @@ -111,11 +111,10 @@ entities)) (defun resolve-entity (stream extendable-string entities &optional (entity (make-extendable-string))) - "Read and resolve an XML entity from stream, positioned on the '&' - entity marker, accepting &name; , &DEC; and &#HEX; formats, + "Read and resolve an XML entity from stream, positioned after the '&' entity marker, + accepting &name; &#DEC; and &#xHEX; formats, destructively modifying string, which is also returned, - destructively modifying entity, incorrect entity formats result in - errors" + destructively modifying entity, incorrect entity formats result in errors" (loop (let ((char (read-char stream nil nil))) (cond ((null char) (error (parser-error "encountered eof before end of entity"))) @@ -123,14 +122,15 @@ (t (vector-push-extend char entity))))) (if (char= (char entity 0) #\#) (let ((code (if (char= (char entity 1) #\x) - (parse-integer entity :start 2 :radix 16) - (parse-integer entity :start 1 :radix 10)))) - (if (null code) (error (parser-error "encountered incorrect entity &~s;" (list entity) stream))) + (parse-integer entity :start 2 :radix 16 :junk-allowed t) + (parse-integer entity :start 1 :radix 10 :junk-allowed t)))) + (when (null code) + (error (parser-error "encountered incorrect entity &~s;" (list entity) stream))) (vector-push-extend (code-char code) extendable-string)) (let ((value (gethash entity entities))) (if value - (dotimes (i (length value)) - (vector-push-extend (char value i) extendable-string)) + (loop :for char :across value + :do (vector-push-extend char extendable-string)) (error (parser-error "encountered unknown entity &~s;" (list entity) stream))))) extendable-string) @@ -431,56 +431,5 @@ ;; read the main element (parse-xml-element stream state) (return-from start-parse-xml (get-seed state))))))) - -;;; A simple example as well as a useful tool: parse, echo and pretty print XML - -(defun indent (stream count) - (loop :repeat (* count 2) :do (write-char #\space stream))) - -(defclass echo-xml-seed () - ((stream :initarg :stream) - (level :initarg :level :initform 0))) - -#+NIL -(defmethod print-object ((seed echo-xml-seed) stream) - (with-slots (stream level) seed - (print-unreadable-object (seed stream :type t) - (format stream "level=~d" level)))) - -(defun echo-xml-new-element-hook (name attributes seed) - (with-slots (stream level) seed - (indent stream level) - (format stream "<~a" name) - (dolist (attribute (reverse attributes)) - (format stream " ~a=\'" (car attribute)) - (print-string-xml (cdr attribute) stream) - (write-char #\' stream)) - (format stream ">~%") - (incf level) - seed)) - -(defun echo-xml-finish-element-hook (name attributes parent-seed seed) - (declare (ignore attributes parent-seed)) - (with-slots (stream level) seed - (decf level) - (indent stream level) - (format stream "~%" name) - seed)) - -(defun echo-xml-text-hook (string seed) - (with-slots (stream level) seed - (indent stream level) - (print-string-xml string stream) - (terpri stream) - seed)) - -(defun echo-xml (in out) - "Parse a toplevel XML element from stream in, echoing and pretty printing the result to stream out" - (start-parse-xml in - (make-instance 'xml-parser-state - :seed (make-instance 'echo-xml-seed :stream out) - :new-element-hook #'echo-xml-new-element-hook - :finish-element-hook #'echo-xml-finish-element-hook - :text-hook #'echo-xml-text-hook))) ;;;; eof From scaekenberghe at common-lisp.net Wed Aug 17 13:44:31 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Wed, 17 Aug 2005 15:44:31 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/test/echo.lisp Message-ID: <20050817134431.8415B8854A@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/test In directory common-lisp.net:/tmp/cvs-serv32224/test Added Files: echo.lisp Log Message: moved echo code into its own file in test/ Date: Wed Aug 17 15:44:30 2005 Author: scaekenberghe From scaekenberghe at common-lisp.net Thu Aug 18 14:00:56 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Thu, 18 Aug 2005 16:00:56 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/src/xml.lisp Message-ID: <20050818140056.DCE6688544@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/src In directory common-lisp.net:/tmp/cvs-serv2384/src Modified Files: xml.lisp Log Message: first version with XML namespace parsing support Date: Thu Aug 18 16:00:50 2005 Author: scaekenberghe Index: s-xml/src/xml.lisp diff -u s-xml/src/xml.lisp:1.7 s-xml/src/xml.lisp:1.8 --- s-xml/src/xml.lisp:1.7 Wed Aug 17 15:44:29 2005 +++ s-xml/src/xml.lisp Thu Aug 18 16:00:48 2005 @@ -1,14 +1,15 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: xml.lisp,v 1.7 2005/08/17 13:44:29 scaekenberghe Exp $ +;;;; $Id: xml.lisp,v 1.8 2005/08/18 14:00:48 scaekenberghe Exp $ ;;;; -;;;; This is a Common Lisp implementation of a very basic XML parser. -;;;; The parser is non-validating and not at all complete (no CDATA). +;;;; This is a Common Lisp implementation of a basic but usable XML parser. +;;;; The parser is non-validating and not complete (no CDATA). +;;;; Namespace and entities are handled. ;;;; The API into the parser is a pure functional parser hook model that comes from SSAX, ;;;; see also http://pobox.com/~oleg/ftp/Scheme/xml.html or http://ssax.sourceforge.net ;;;; Different DOM models are provided, an XSML, an LXML and a xml-element struct based one. ;;;; -;;;; Copyright (C) 2002, 2004 Sven Van Caekenberghe, Beta Nine BVBA. +;;;; Copyright (C) 2002, 2003, 2004, 2005 Sven Van Caekenberghe, Beta Nine BVBA. ;;;; ;;;; You are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser General Public License @@ -134,6 +135,100 @@ (error (parser-error "encountered unknown entity &~s;" (list entity) stream))))) extendable-string) +;;; namespace support + +(defclass xml-namespace () + ((uri :documentation "The URI used to identify this namespace" + :accessor get-uri + :initarg :uri) + (prefix :documentation "The prefix assigned to this namespace" + :accessor get-prefix + :initarg :prefix + :initform nil) + (package :documentation "The Common Lisp package where this namespace's symbols are interned" + :accessor get-package + :initarg :package + :initform nil)) + (:documentation "Describes an XML namespace and how it is handled")) + +(defvar *local-namespace* (make-instance 'xml-namespace + :uri "local" + :prefix "" + :package (find-package :keyword)) + "The local (global default) XML namespace") + +(defvar *namespaces* (list *local-namespace*) + "Ordered list of XML namespaces currently in effect") + +(defun split-identifier (identifier) + "Split an identifier 'prefix:name' and return (values prefix identifier)" + (let ((colon-position (position #\: identifier :test #'char=))) + (if colon-position + (values (subseq identifier 0 colon-position) + (subseq identifier (1+ colon-position))) + (values nil identifier)))) + +(defvar *require-existing-symbols* nil + "If t, each XML identifier must exist as symbol already") + +(defvar *auto-export-symbols* t + "If t, export newly interned symbols form their packages") + +(defun resolve-identifier (identifier namespaces &optional as-attribute) + "Resolve the string identifier in the list of namespaces" + (flet ((intern-symbol (string package) + (if *require-existing-symbols* + (let ((symbol (find-symbol string package))) + (or symbol + (error "Symbol ~s does not exist in ~s" string package))) + (let ((symbol (intern string package))) + (when (and *auto-export-symbols* + (not (eql package (find-package :keyword)))) + (export symbol package)) + symbol)))) + (multiple-value-bind (prefix name) + (split-identifier identifier) + (if (or (null prefix) (string= prefix "xmlns")) + (if as-attribute + (intern (if (string= prefix "xmlns") identifier name) (get-package *local-namespace*)) + (let ((default-namespace (find "" namespaces :key #'get-prefix :test #'string-equal))) + (intern-symbol name (get-package default-namespace)))) + (let ((namespace (find prefix namespaces :key #'get-prefix :test #'string-equal))) + (if namespace + (intern-symbol name (get-package namespace)) + (error "namespace not found for prefix ~s" prefix))))))) + +(defvar *auto-create-namespace-packages* t + "If t, new packages will be created for namespaces, if needed, named by the prefix") + +(defun extend-namespaces (attributes namespaces) + "Given possible 'xmlns[:prefix]' attributes, extend namespaces" + (let (default-namespace-uri) + (loop :for (key . value) :in attributes + :do (if (string= key "xmlns") + (setf default-namespace-uri value) + (multiple-value-bind (prefix name) + (split-identifier key) + (when (string= prefix "xmlns") + (push (make-instance 'xml-namespace + :uri value + :prefix name + :package (or (find-package name) + (if *auto-create-namespace-packages* + (make-package name :nicknames (list (string-upcase name))) + (error "Cannot find or create package ~s" name)))) + namespaces))))) + (when default-namespace-uri + (let ((namespace (find default-namespace-uri namespaces :key #'get-uri :test #'string-equal))) + (if namespace + (push (make-instance 'xml-namespace + :uri (get-uri namespace) + :prefix "" + :package (get-package namespace)) + namespaces) + (error "No prefix found for default namespace ~s" default-namespace-uri))))) + namespaces) + ;;; the parser state (defclass xml-parser-state () @@ -326,6 +421,7 @@ "Parse XML element attributes from stream positioned after the tag identifier, returning the attributes as an assoc list, ending at either a '>' or a '/' which is peeked and also returned" + (declare (special *namespaces*)) (let (char attributes) (loop ;; skip whitespace separating items @@ -333,7 +429,7 @@ ;; start tag attributes ends with > or /> (when (and char (or (char= char #\>) (char= char #\/))) (return)) ;; read the attribute key - (let ((key (intern (parse-identifier stream (get-mini-buffer state)) :keyword))) + (let ((key (copy-seq (parse-identifier stream (get-mini-buffer state))))) ;; skip separating whitespace (setf char (skip-whitespace stream)) ;; require = sign (and consume it if present) @@ -350,6 +446,7 @@ (defun parse-xml-element (stream state) "Parse and return an XML element from stream, positioned after the opening '<'" + (declare (special *namespaces*)) ;; opening < has been read (when (char= (peek-char nil stream nil nil) #\!) (skip-special-tag stream) @@ -357,62 +454,67 @@ (let (char buffer open-tag parent-seed has-children) (setf parent-seed (get-seed state)) ;; read tag name (no whitespace between < and name ?) - (setf open-tag (intern (parse-identifier stream (get-mini-buffer state)) :keyword)) + (setf open-tag (copy-seq (parse-identifier stream (get-mini-buffer state)))) ;; tag has been read, read attributes if any (multiple-value-bind (attributes peeked-char) (parse-xml-element-attributes stream state) - (setf (get-seed state) (funcall (get-new-element-hook state) - open-tag attributes (get-seed state))) - (setf char peeked-char) - (when (char= char #\/) - ;; handle solitary tag of the form - (read-char stream) - (setf char (read-char stream nil nil)) - (if (char= #\> char) - (progn - (setf (get-seed state) (funcall (get-finish-element-hook state) - open-tag attributes parent-seed (get-seed state))) - (return-from parse-xml-element)) - (error (parser-error "expected >" nil stream)))) - ;; consume > - (read-char stream) - (loop - (setf buffer (get-buffer state)) - ;; read whitespace into buffer - (setf char (parse-whitespace stream buffer)) - ;; see what ended the whitespace scan - (cond ((null char) (error (parser-error "encountered unexpected eof handling ~a" (list open-tag)))) - ((char= char #\<) - ;; consume the < - (read-char stream) - (if (char= (peek-char nil stream nil nil) #\/) - (progn - ;; handle the matching closing tag and done - ;; if we read whitespace as this (leaf) element's contents, it is significant - (when (and (not has-children) (plusp (length buffer))) - (setf (get-seed state) (funcall (get-text-hook state) - (copy-seq buffer) (get-seed state)))) - (read-char stream) - (let ((close-tag (intern (parse-identifier stream (get-mini-buffer state)) :keyword))) - (unless (eq open-tag close-tag) - (error (parser-error "found <~a> not matched by but by <~a>" - (list open-tag open-tag close-tag) stream))) - (unless (char= (read-char stream nil nil) #\>) - (error (parser-error "expected >" nil stream))) - (setf (get-seed state) (funcall (get-finish-element-hook state) - open-tag attributes parent-seed (get-seed state)))) - (return)) - ;; handle child tag and loop, no hooks to call here - ;; whitespace between child elements is skipped - (progn - (setf has-children t) - (parse-xml-element stream state)))) - (t - ;; no child tag, concatenate text to whitespace in buffer - ;; handle text content and loop - (setf char (parse-text stream state buffer)) - (setf (get-seed state) (funcall (get-text-hook state) - (copy-seq buffer) (get-seed state))))))))) + (let ((*namespaces* (extend-namespaces attributes *namespaces*))) + (setf open-tag (resolve-identifier open-tag *namespaces*) + attributes (loop :for (key . value) :in attributes + :collect (cons (resolve-identifier key *namespaces* t) value))) + (setf (get-seed state) (funcall (get-new-element-hook state) + open-tag attributes (get-seed state))) + (setf char peeked-char) + (when (char= char #\/) + ;; handle solitary tag of the form + (read-char stream) + (setf char (read-char stream nil nil)) + (if (char= #\> char) + (progn + (setf (get-seed state) (funcall (get-finish-element-hook state) + open-tag attributes parent-seed (get-seed state))) + (return-from parse-xml-element)) + (error (parser-error "expected >" nil stream)))) + ;; consume > + (read-char stream) + (loop + (setf buffer (get-buffer state)) + ;; read whitespace into buffer + (setf char (parse-whitespace stream buffer)) + ;; see what ended the whitespace scan + (cond ((null char) (error (parser-error "encountered unexpected eof handling ~a" (list open-tag)))) + ((char= char #\<) + ;; consume the < + (read-char stream) + (if (char= (peek-char nil stream nil nil) #\/) + (progn + ;; handle the matching closing tag and done + ;; if we read whitespace as this (leaf) element's contents, it is significant + (when (and (not has-children) (plusp (length buffer))) + (setf (get-seed state) (funcall (get-text-hook state) + (copy-seq buffer) (get-seed state)))) + (read-char stream) + (let ((close-tag (resolve-identifier (parse-identifier stream (get-mini-buffer state)) + *namespaces*))) + (unless (eq open-tag close-tag) + (error (parser-error "found <~a> not matched by but by <~a>" + (list open-tag open-tag close-tag) stream))) + (unless (char= (read-char stream nil nil) #\>) + (error (parser-error "expected >" nil stream))) + (setf (get-seed state) (funcall (get-finish-element-hook state) + open-tag attributes parent-seed (get-seed state)))) + (return)) + ;; handle child tag and loop, no hooks to call here + ;; whitespace between child elements is skipped + (progn + (setf has-children t) + (parse-xml-element stream state)))) + (t + ;; no child tag, concatenate text to whitespace in buffer + ;; handle text content and loop + (setf char (parse-text stream state buffer)) + (setf (get-seed state) (funcall (get-text-hook state) + (copy-seq buffer) (get-seed state)))))))))) (defun start-parse-xml (stream &optional (state (make-instance 'xml-parser-state))) "Parse and return a toplevel XML element from stream, using parser state" From scaekenberghe at common-lisp.net Thu Aug 18 14:00:58 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Thu, 18 Aug 2005 16:00:58 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/test/simple.xml Message-ID: <20050818140058.4940288544@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/test In directory common-lisp.net:/tmp/cvs-serv2384/test Added Files: simple.xml Log Message: first version with XML namespace parsing support Date: Thu Aug 18 16:00:57 2005 Author: scaekenberghe From scaekenberghe at common-lisp.net Mon Aug 29 08:54:44 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Mon, 29 Aug 2005 10:54:44 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/src/lxml-dom.lisp s-xml/src/xml.lisp Message-ID: <20050829085444.3622B88545@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/src In directory common-lisp.net:/tmp/cvs-serv22222/src Modified Files: lxml-dom.lisp xml.lisp Log Message: added some minimal code to print namespace qualified xml identifiers Date: Mon Aug 29 10:54:43 2005 Author: scaekenberghe Index: s-xml/src/lxml-dom.lisp diff -u s-xml/src/lxml-dom.lisp:1.2 s-xml/src/lxml-dom.lisp:1.3 --- s-xml/src/lxml-dom.lisp:1.2 Wed Aug 17 10:06:01 2005 +++ s-xml/src/lxml-dom.lisp Mon Aug 29 10:54:41 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: lxml-dom.lisp,v 1.2 2005/08/17 08:06:01 scaekenberghe Exp $ +;;;; $Id: lxml-dom.lisp,v 1.3 2005/08/29 08:54:41 scaekenberghe Exp $ ;;;; ;;;; LXML implementation of the generic DOM parser and printer. ;;;; @@ -45,17 +45,17 @@ :text-hook #'lxml-text-hook)))) (defmethod print-xml-dom (dom (input-type (eql :lxml)) stream pretty level) - (cond ((symbolp dom) (format stream "<~a/>" dom)) + (cond ((symbolp dom) (format stream "<~a/>" (print-identifier dom nil))) ((stringp dom) (print-string-xml dom stream)) ((consp dom) (let (tag attributes) (cond ((symbolp (car dom)) (setf tag (car dom))) ((consp (car dom)) (setf tag (caar dom) attributes (cdar dom))) (t (error "Input not recognized as LXML ~s" dom))) - (format stream "<~a" tag) + (format stream "<~a" (print-identifier tag nil)) (labels ((print-attributes (attributes) (unless (null attributes) - (format stream " ~a=\"" (car attributes)) + (format stream " ~a=\"" (print-identifier (car attributes) nil t)) (print-string-xml (cadr attributes) stream) (format stream "\"") (print-attributes (cddr attributes))))) @@ -76,7 +76,7 @@ (when pretty (terpri stream) (dotimes (i (* 2 (1- level))) (write-char #\space stream))))) - (format stream "" tag)) + (format stream "" (print-identifier tag nil))) (format stream "/>")))) (t (error "Input not recognized as LXML ~s" dom)))) Index: s-xml/src/xml.lisp diff -u s-xml/src/xml.lisp:1.8 s-xml/src/xml.lisp:1.9 --- s-xml/src/xml.lisp:1.8 Thu Aug 18 16:00:48 2005 +++ s-xml/src/xml.lisp Mon Aug 29 10:54:42 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: xml.lisp,v 1.8 2005/08/18 14:00:48 scaekenberghe Exp $ +;;;; $Id: xml.lisp,v 1.9 2005/08/29 08:54:42 scaekenberghe Exp $ ;;;; ;;;; This is a Common Lisp implementation of a basic but usable XML parser. ;;;; The parser is non-validating and not complete (no CDATA). @@ -161,7 +161,7 @@ "Ordered list of XML namespaces currently in effect") (defun split-identifier (identifier) - "Split an identifier 'prefix:name' and return (values prefix identifier)" + "Split an identifier 'prefix:name' and return (values prefix name)" (let ((colon-position (position #\: identifier :test #'char=))) (if colon-position (values (subseq identifier 0 colon-position) @@ -228,6 +228,18 @@ namespaces) (error "No prefix found for default namespace ~s" default-namespace-uri))))) namespaces) + +(defun print-identifier (identifier stream &optional as-attribute) + "Print identifier on stream using namespace conventions" + (declare (ignore as-attribute)) + (let (prefix name) + (if (symbolp identifier) + (setf prefix (package-name (symbol-package identifier)) + name (symbol-name identifier)) + (setf (values prefix name) (split-identifier identifier))) + (if (equal prefix "KEYWORD") + (format stream "~a" name) + (format stream "~a:~a" prefix name)))) ;;; the parser state From scaekenberghe at common-lisp.net Mon Aug 29 15:01:50 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Mon, 29 Aug 2005 17:01:50 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/test/test-xml-struct-dom.lisp Message-ID: <20050829150150.D1D368854A@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/test In directory common-lisp.net:/tmp/cvs-serv14302/test Modified Files: test-xml-struct-dom.lisp Log Message: redesigned the namespaces implementation separated namespace definition (incl package mapping, default prefix) from namespace binding (using xmlns attributes) cleanup of printing code (added ns-awareness) added *ignore-namespaces* switch to disable ns-awareness (backward compatibility) Date: Mon Aug 29 17:01:50 2005 Author: scaekenberghe Index: s-xml/test/test-xml-struct-dom.lisp diff -u s-xml/test/test-xml-struct-dom.lisp:1.1.1.1 s-xml/test/test-xml-struct-dom.lisp:1.2 --- s-xml/test/test-xml-struct-dom.lisp:1.1.1.1 Mon Jun 7 20:49:59 2004 +++ s-xml/test/test-xml-struct-dom.lisp Mon Aug 29 17:01:49 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: test-xml-struct-dom.lisp,v 1.1.1.1 2004/06/07 18:49:59 scaekenberghe Exp $ +;;;; $Id: test-xml-struct-dom.lisp,v 1.2 2005/08/29 15:01:49 scaekenberghe Exp $ ;;;; ;;;; Unit and functional tests for xml-struct-dom.lisp ;;;; @@ -61,7 +61,7 @@ "")) (assert - (string-equal (print-xml-string (make-xml-element :name "foo" :attributes '((bar . "1"))) + (string-equal (print-xml-string (make-xml-element :name "foo" :attributes '((:|bar| . "1"))) :input-type :xml-struct) "")) From scaekenberghe at common-lisp.net Mon Aug 29 15:01:50 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Mon, 29 Aug 2005 17:01:50 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/src/dom.lisp s-xml/src/lxml-dom.lisp s-xml/src/sxml-dom.lisp s-xml/src/xml-struct-dom.lisp s-xml/src/xml.lisp Message-ID: <20050829150150.AEF0D88549@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/src In directory common-lisp.net:/tmp/cvs-serv14302/src Modified Files: dom.lisp lxml-dom.lisp sxml-dom.lisp xml-struct-dom.lisp xml.lisp Log Message: redesigned the namespaces implementation separated namespace definition (incl package mapping, default prefix) from namespace binding (using xmlns attributes) cleanup of printing code (added ns-awareness) added *ignore-namespaces* switch to disable ns-awareness (backward compatibility) Date: Mon Aug 29 17:01:48 2005 Author: scaekenberghe Index: s-xml/src/dom.lisp diff -u s-xml/src/dom.lisp:1.1.1.1 s-xml/src/dom.lisp:1.2 --- s-xml/src/dom.lisp:1.1.1.1 Mon Jun 7 20:49:56 2004 +++ s-xml/src/dom.lisp Mon Aug 29 17:01:47 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: dom.lisp,v 1.1.1.1 2004/06/07 18:49:56 scaekenberghe Exp $ +;;;; $Id: dom.lisp,v 1.2 2005/08/29 15:01:47 scaekenberghe Exp $ ;;;; ;;;; This is the generic simple DOM parser and printer interface. ;;;; @@ -46,5 +46,30 @@ "Generate XML output to a string from a DOM of input-type (:lxml by default), optionally pretty printing (off by default)" (with-output-to-string (stream) (print-xml dom :stream stream :pretty pretty :input-type input-type))) + +;;; shared/common support functions + +(defun print-spaces (n stream &optional (preceding-newline t)) + (when preceding-newline + (terpri stream)) + (loop :repeat n + :do (write-char #\Space stream))) + +(defun print-solitary-tag (tag stream) + (write-char #\< stream) + (print-identifier tag stream) + (write-string "/>" stream)) + +(defun print-closing-tag (tag stream) + (write-string " stream)) + +(defun print-attribute (name value stream) + (write-char #\space stream) + (print-identifier name stream t) + (write-string "=\"" stream) + (print-string-xml value stream) + (write-char #\" stream)) ;;;; eof Index: s-xml/src/lxml-dom.lisp diff -u s-xml/src/lxml-dom.lisp:1.3 s-xml/src/lxml-dom.lisp:1.4 --- s-xml/src/lxml-dom.lisp:1.3 Mon Aug 29 10:54:41 2005 +++ s-xml/src/lxml-dom.lisp Mon Aug 29 17:01:47 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: lxml-dom.lisp,v 1.3 2005/08/29 08:54:41 scaekenberghe Exp $ +;;;; $Id: lxml-dom.lisp,v 1.4 2005/08/29 15:01:47 scaekenberghe Exp $ ;;;; ;;;; LXML implementation of the generic DOM parser and printer. ;;;; @@ -44,40 +44,40 @@ :finish-element-hook #'lxml-finish-element-hook :text-hook #'lxml-text-hook)))) +(defun plist->alist (plist) + (when plist + (cons (cons (first plist) (second plist)) + (plist->alist (rest (rest plist)))))) + (defmethod print-xml-dom (dom (input-type (eql :lxml)) stream pretty level) - (cond ((symbolp dom) (format stream "<~a/>" (print-identifier dom nil))) + (declare (special *namespaces)) + (cond ((symbolp dom) (print-solitary-tag dom stream)) ((stringp dom) (print-string-xml dom stream)) ((consp dom) (let (tag attributes) - (cond ((symbolp (car dom)) (setf tag (car dom))) - ((consp (car dom)) (setf tag (caar dom) attributes (cdar dom))) + (cond ((symbolp (first dom)) (setf tag (first dom))) + ((consp (first dom)) (setf tag (first (first dom)) + attributes (plist->alist (rest (first dom))))) (t (error "Input not recognized as LXML ~s" dom))) - (format stream "<~a" (print-identifier tag nil)) - (labels ((print-attributes (attributes) - (unless (null attributes) - (format stream " ~a=\"" (print-identifier (car attributes) nil t)) - (print-string-xml (cadr attributes) stream) - (format stream "\"") - (print-attributes (cddr attributes))))) - (when attributes (print-attributes attributes))) - (if (cdr dom) - (let ((children (cdr dom))) - (format stream ">") - (if (and (= (length children) 1) (stringp (first children))) - (print-string-xml (first children) stream) - (progn - (dolist (child children) - (when pretty - (terpri stream) - (dotimes (i (* 2 level)) (write-char #\space stream))) - (if (stringp child) - (print-string-xml child stream) - (print-xml-dom child input-type stream pretty (1+ level)))) - (when pretty - (terpri stream) - (dotimes (i (* 2 (1- level))) (write-char #\space stream))))) - (format stream "" (print-identifier tag nil))) - (format stream "/>")))) + (let ((*namespaces* (extend-namespaces attributes *namespaces*))) + (write-char #\< stream) + (print-identifier tag stream) + (loop :for (name . value) :in attributes + :do (print-attribute name value stream)) + (if (rest dom) + (let ((children (rest dom))) + (write-char #\> stream) + (if (and (= (length children) 1) (stringp (first children))) + (print-string-xml (first children) stream) + (progn + (dolist (child children) + (when pretty (print-spaces (* 2 level) stream)) + (if (stringp child) + (print-string-xml child stream) + (print-xml-dom child input-type stream pretty (1+ level)))) + (when pretty (print-spaces (* 2 level) stream)))) + (print-closing-tag tag stream)) + (write-string "/>" stream))))) (t (error "Input not recognized as LXML ~s" dom)))) ;;;; eof Index: s-xml/src/sxml-dom.lisp diff -u s-xml/src/sxml-dom.lisp:1.2 s-xml/src/sxml-dom.lisp:1.3 --- s-xml/src/sxml-dom.lisp:1.2 Wed Aug 17 10:06:01 2005 +++ s-xml/src/sxml-dom.lisp Mon Aug 29 17:01:47 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: sxml-dom.lisp,v 1.2 2005/08/17 08:06:01 scaekenberghe Exp $ +;;;; $Id: sxml-dom.lisp,v 1.3 2005/08/29 15:01:47 scaekenberghe Exp $ ;;;; ;;;; LXML implementation of the generic DOM parser and printer. ;;;; @@ -40,38 +40,37 @@ :text-hook #'sxml-text-hook)))) (defmethod print-xml-dom (dom (input-type (eql :sxml)) stream pretty level) + (declare (special *namespaces)) (cond ((stringp dom) (print-string-xml dom stream)) ((consp dom) - (let ((tag (car dom)) + (let ((tag (first dom)) attributes children) - (if (and (consp (cadr dom)) (eq (caadr dom) :@)) - (setf attributes (cdadr dom) - children (cddr dom)) - (setf children (cdr dom))) - (format stream "<~a" tag) - (dolist (pair attributes) - (format stream " ~a=\"" (car pair)) - (print-string-xml (cadr pair) stream) - (format stream "\"")) - (if children - (progn - (format stream ">") - (if (and (= (length children) 1) (stringp (first children))) - (print-string-xml (first children) stream) - (progn - (dolist (child children) - (when pretty - (terpri stream) - (dotimes (i (* 2 level)) (write-char #\space stream))) - (if (stringp child) - (print-string-xml child stream) - (print-xml-dom child input-type stream pretty (1+ level)))) - (when pretty - (terpri stream) - (dotimes (i (* 2 (1- level))) (write-char #\space stream))))) - (format stream "" tag)) - (format stream "/>")))) + (if (and (consp (second dom)) (eq (first (second dom)) :@)) + (setf attributes (rest (second dom)) + children (rest (rest dom))) + (setf children (rest dom))) + (let ((*namespaces* (extend-namespaces (loop :for (name value) :in attributes + :collect (cons name value)) + *namespaces*))) + (write-char #\< stream) + (print-identifier tag stream) + (loop :for (name value) :in attributes + :do (print-attribute name value stream)) + (if children + (progn + (write-char #\> stream) + (if (and (= (length children) 1) (stringp (first children))) + (print-string-xml (first children) stream) + (progn + (dolist (child children) + (when pretty (print-spaces (* 2 level) stream)) + (if (stringp child) + (print-string-xml child stream) + (print-xml-dom child input-type stream pretty (1+ level)))) + (when pretty (print-spaces (* 2 level) stream)))) + (print-closing-tag tag stream)) + (write-string "/>" stream))))) (t (error "Input not recognized as SXML ~s" dom)))) ;;;; eof Index: s-xml/src/xml-struct-dom.lisp diff -u s-xml/src/xml-struct-dom.lisp:1.1.1.1 s-xml/src/xml-struct-dom.lisp:1.2 --- s-xml/src/xml-struct-dom.lisp:1.1.1.1 Mon Jun 7 20:49:57 2004 +++ s-xml/src/xml-struct-dom.lisp Mon Aug 29 17:01:47 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: xml-struct-dom.lisp,v 1.1.1.1 2004/06/07 18:49:57 scaekenberghe Exp $ +;;;; $Id: xml-struct-dom.lisp,v 1.2 2005/08/29 15:01:47 scaekenberghe Exp $ ;;;; ;;;; XML-STRUCT implementation of the generic DOM parser and printer. ;;;; @@ -75,30 +75,28 @@ ;;; printing xml structures (defmethod print-xml-dom (xml-element (input-type (eql :xml-struct)) stream pretty level) - (format stream "<~a" (xml-element-name xml-element)) - (dolist (attribute (xml-element-attributes xml-element)) - (format stream " ~a=\"" (car attribute)) - (print-string-xml (cdr attribute) stream) - (format stream "\"")) - (let ((children (xml-element-children xml-element))) - (if children - (progn - (format stream ">") - (if (and (= (length children) 1) (stringp (first children))) - (print-string-xml (first children) stream) - (progn - (dolist (child children) - (when pretty - (terpri stream) - (dotimes (i (* 2 level)) (write-char #\space stream))) - (if (stringp child) - (print-string-xml child stream) - (print-xml-dom child input-type stream pretty (1+ level)))) - (when pretty - (terpri stream) - (dotimes (i (* 2 (1- level))) (write-char #\space stream))))) - (format stream "" (xml-element-name xml-element))) - (format stream "/>")))) + (declare (special *namespaces*)) + (let ((*namespaces* (extend-namespaces (xml-element-attributes xml-element) + *namespaces*))) + (write-char #\< stream) + (print-identifier (xml-element-name xml-element) stream) + (loop :for (name . value) :in (xml-element-attributes xml-element) + :do (print-attribute name value stream)) + (let ((children (xml-element-children xml-element))) + (if children + (progn + (write-char #\> stream) + (if (and (= (length children) 1) (stringp (first children))) + (print-string-xml (first children) stream) + (progn + (dolist (child children) + (when pretty (print-spaces (* 2 level) stream)) + (if (stringp child) + (print-string-xml child stream) + (print-xml-dom child input-type stream pretty (1+ level)))) + (when pretty (print-spaces (* 2 level) stream)))) + (print-closing-tag (xml-element-name xml-element) stream)) + (write-string "/>" stream))))) ;;; the standard hooks to generate xml-element structs Index: s-xml/src/xml.lisp diff -u s-xml/src/xml.lisp:1.9 s-xml/src/xml.lisp:1.10 --- s-xml/src/xml.lisp:1.9 Mon Aug 29 10:54:42 2005 +++ s-xml/src/xml.lisp Mon Aug 29 17:01:47 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: xml.lisp,v 1.9 2005/08/29 08:54:42 scaekenberghe Exp $ +;;;; $Id: xml.lisp,v 1.10 2005/08/29 15:01:47 scaekenberghe Exp $ ;;;; ;;;; This is a Common Lisp implementation of a basic but usable XML parser. ;;;; The parser is non-validating and not complete (no CDATA). @@ -137,11 +137,14 @@ ;;; namespace support +(defvar *ignore-namespaces* nil + "When t, namespaces are ignored like in the old version of S-XML") + (defclass xml-namespace () ((uri :documentation "The URI used to identify this namespace" :accessor get-uri :initarg :uri) - (prefix :documentation "The prefix assigned to this namespace" + (prefix :documentation "The preferred prefix assigned to this namespace" :accessor get-prefix :initarg :prefix :initform nil) @@ -157,11 +160,37 @@ :package (find-package :keyword)) "The local (global default) XML namespace") -(defvar *namespaces* (list *local-namespace*) - "Ordered list of XML namespaces currently in effect") +(defvar *known-namespaces* (list *local-namespace*) + "The list of known/defined namespaces") + +(defun find-namespace (uri) + "Find a registered XML namespace identified by uri" + (find uri *known-namespaces* :key #'get-uri :test #'string-equal)) + +(defun register-namespace (uri prefix package) + "Register a new or redefine an existing XML namespace defined by uri with prefix and package" + (let ((namespace (find-namespace uri))) + (if namespace + (setf (get-prefix namespace) prefix + (get-package namespace) (find-package package)) + (push (setf namespace (make-instance 'xml-namespace + :uri uri + :prefix prefix + :package (find-package package))) + *known-namespaces*)) + namespace)) + +(defvar *namespaces* `(("" . *local-namespace*)) + "Ordered list of (prefix . XML-namespace) bindings currently in effect - special variable") + +(defun find-namespace-binding (prefix namespaces) + "Find the XML namespace currently bound to prefix in the namespaces bindings" + (cdr (assoc prefix namespaces :test #'string-equal))) (defun split-identifier (identifier) "Split an identifier 'prefix:name' and return (values prefix name)" + (when (symbolp identifier) + (setf identifier (symbol-name identifier))) (let ((colon-position (position #\: identifier :test #'char=))) (if colon-position (values (subseq identifier 0 colon-position) @@ -175,71 +204,78 @@ "If t, export newly interned symbols form their packages") (defun resolve-identifier (identifier namespaces &optional as-attribute) - "Resolve the string identifier in the list of namespaces" - (flet ((intern-symbol (string package) - (if *require-existing-symbols* - (let ((symbol (find-symbol string package))) - (or symbol - (error "Symbol ~s does not exist in ~s" string package))) - (let ((symbol (intern string package))) - (when (and *auto-export-symbols* - (not (eql package (find-package :keyword)))) - (export symbol package)) - symbol)))) - (multiple-value-bind (prefix name) - (split-identifier identifier) - (if (or (null prefix) (string= prefix "xmlns")) - (if as-attribute - (intern (if (string= prefix "xmlns") identifier name) (get-package *local-namespace*)) - (let ((default-namespace (find "" namespaces :key #'get-prefix :test #'string-equal))) - (intern-symbol name (get-package default-namespace)))) - (let ((namespace (find prefix namespaces :key #'get-prefix :test #'string-equal))) - (if namespace - (intern-symbol name (get-package namespace)) - (error "namespace not found for prefix ~s" prefix))))))) + "Resolve the string identifier in the list of namespace bindings" + (if *ignore-namespaces* + (intern identifier :keyword) + (flet ((intern-symbol (string package) ; intern string as a symbol in package + (if *require-existing-symbols* + (let ((symbol (find-symbol string package))) + (or symbol + (error "Symbol ~s does not exist in ~s" string package))) + (let ((symbol (intern string package))) + (when (and *auto-export-symbols* + (not (eql package (find-package :keyword)))) + (export symbol package)) + symbol)))) + (multiple-value-bind (prefix name) + (split-identifier identifier) + (if (or (null prefix) (string= prefix "xmlns")) + (if as-attribute + (intern (if (string= prefix "xmlns") identifier name) (get-package *local-namespace*)) + (let ((default-namespace (find-namespace-binding "" namespaces))) + (intern-symbol name (get-package default-namespace)))) + (let ((namespace (find-namespace-binding prefix namespaces))) + (if namespace + (intern-symbol name (get-package namespace)) + (error "namespace not found for prefix ~s" prefix)))))))) (defvar *auto-create-namespace-packages* t "If t, new packages will be created for namespaces, if needed, named by the prefix") (defun extend-namespaces (attributes namespaces) - "Given possible 'xmlns[:prefix]' attributes, extend namespaces" - (let (default-namespace-uri) - (loop :for (key . value) :in attributes - :do (if (string= key "xmlns") - (setf default-namespace-uri value) - (multiple-value-bind (prefix name) - (split-identifier key) - (when (string= prefix "xmlns") - (push (make-instance 'xml-namespace - :uri value - :prefix name - :package (or (find-package name) - (if *auto-create-namespace-packages* - (make-package name :nicknames (list (string-upcase name))) - (error "Cannot find or create package ~s" name)))) - namespaces))))) - (when default-namespace-uri - (let ((namespace (find default-namespace-uri namespaces :key #'get-uri :test #'string-equal))) - (if namespace - (push (make-instance 'xml-namespace - :uri (get-uri namespace) - :prefix "" - :package (get-package namespace)) - namespaces) - (error "No prefix found for default namespace ~s" default-namespace-uri))))) + "Given possible 'xmlns[:prefix]' attributes, extend the namespaces bindings" + (unless *ignore-namespaces* + (let (default-namespace-uri) + (loop :for (key . value) :in attributes + :do (if (string= key "xmlns") + (setf default-namespace-uri value) + (multiple-value-bind (prefix name) + (split-identifier key) + (when (string= prefix "xmlns") + (let* ((uri value) + (prefix name) + (namespace (find-namespace uri))) + (unless namespace + (setf namespace + (register-namespace uri + prefix + (or (find-package prefix) + (if *auto-create-namespace-packages* + (make-package prefix :nicknames `(,(string-upcase prefix))) + (error "Cannot find or create package ~s" prefix)))))) + (push `(,prefix . ,namespace) namespaces)))))) + (when default-namespace-uri + (let ((namespace (find-namespace default-namespace-uri))) + (if namespace + (push `("" . namespace) namespaces) + (error "No prefix found for default namespace ~s" default-namespace-uri)))))) namespaces) (defun print-identifier (identifier stream &optional as-attribute) "Print identifier on stream using namespace conventions" - (declare (ignore as-attribute)) - (let (prefix name) + (declare (ignore as-attribute) (special *namespaces*)) + (if *ignore-namespaces* + (princ identifier stream) (if (symbolp identifier) - (setf prefix (package-name (symbol-package identifier)) - name (symbol-name identifier)) - (setf (values prefix name) (split-identifier identifier))) - (if (equal prefix "KEYWORD") - (format stream "~a" name) - (format stream "~a:~a" prefix name)))) + (let ((package (symbol-package identifier)) + (name (symbol-name identifier))) + (let* ((namespace (find package *known-namespaces* :key #'get-package)) + (prefix (or (car (find namespace *namespaces* :key #'cdr)) + (get-prefix namespace)))) + (if (string= prefix "") + (princ name stream) + (format stream "~a:~a" prefix name)))) + (princ identifier stream)))) ;;; the parser state From scaekenberghe at common-lisp.net Tue Aug 30 10:37:07 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Tue, 30 Aug 2005 12:37:07 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/src/package.lisp Message-ID: <20050830103707.92B5D8853E@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/src In directory common-lisp.net:/tmp/cvs-serv782/src Modified Files: package.lisp Log Message: added exports for XML Namespaces API Date: Tue Aug 30 12:37:06 2005 Author: scaekenberghe Index: s-xml/src/package.lisp diff -u s-xml/src/package.lisp:1.2 s-xml/src/package.lisp:1.3 --- s-xml/src/package.lisp:1.2 Wed Jun 30 21:09:06 2004 +++ s-xml/src/package.lisp Tue Aug 30 12:37:06 2005 @@ -1,6 +1,6 @@ ;;;; -*- mode: lisp -*- ;;;; -;;;; $Id: package.lisp,v 1.2 2004/06/30 19:09:06 scaekenberghe Exp $ +;;;; $Id: package.lisp,v 1.3 2005/08/30 10:37:06 scaekenberghe Exp $ ;;;; ;;;; This is a Common Lisp implementation of a very basic XML parser. ;;;; The parser is non-validating and not at all complete (no CDATA). @@ -8,7 +8,7 @@ ;;;; see also http://pobox.com/~oleg/ftp/Scheme/xml.html or http://ssax.sourceforge.net ;;;; Different DOM models are provided, an XSML, an LXML and a xml-element struct based one. ;;;; -;;;; Copyright (C) 2002, 2004 Sven Van Caekenberghe, Beta Nine BVBA. +;;;; Copyright (C) 2002, 2003, 2004, 2005 Sven Van Caekenberghe, Beta Nine BVBA. ;;;; ;;;; You are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser General Public License @@ -20,7 +20,6 @@ ;; main parser interface #:start-parse-xml #:print-string-xml - #:echo-xml #:xml-parser-error #:xml-parser-error-message #:xml-parser-error-args #:xml-parser-error-stream #:xml-parser-state #:get-entities #:get-seed #:get-new-element-hook #:get-finish-element-hook #:get-text-hook @@ -30,7 +29,12 @@ ;; xml-element structure #:make-xml-element #:xml-element-children #:xml-element-name #:xml-element-attribute #:xml-element-attributes - #:xml-element-p #:new-xml-element #:first-xml-element-child) + #:xml-element-p #:new-xml-element #:first-xml-element-child + ;; namespaces + #:*ignore-namespaces* #:*local-namespace* #:*namespaces* + #:*require-existing-symbols* #:*auto-export-symbols* #:*auto-create-namespace-packages* + #:find-namespace #:register-namespace + #:resolve-identifier #:extend-namespaces #:print-identifier) (:documentation "A simple XML parser with an efficient, purely functional, event-based interface as well as a DOM interface")) From scaekenberghe at common-lisp.net Tue Aug 30 13:01:14 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Tue, 30 Aug 2005 15:01:14 +0200 (CEST) Subject: [s-xml-cvs] CVS update: Directory change: s-xml/debian Message-ID: <20050830130114.A47E68815C@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/debian In directory common-lisp.net:/tmp/cvs-serv10835/debian Log Message: Directory /project/s-xml/cvsroot/s-xml/debian added to the repository Date: Tue Aug 30 15:01:14 2005 Author: scaekenberghe New directory s-xml/debian added From scaekenberghe at common-lisp.net Tue Aug 30 13:03:20 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Tue, 30 Aug 2005 15:03:20 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/debian/README.Debian s-xml/debian/changelog s-xml/debian/control s-xml/debian/copyright s-xml/debian/postinst s-xml/debian/prerm s-xml/debian/rules Message-ID: <20050830130320.5B1518815C@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml/debian In directory common-lisp.net:/tmp/cvs-serv10863/debian Added Files: README.Debian changelog control copyright postinst prerm rules Log Message: Debian packaging (contributed by Luca Capello ) Date: Tue Aug 30 15:03:18 2005 Author: scaekenberghe From scaekenberghe at common-lisp.net Tue Aug 30 13:05:09 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Tue, 30 Aug 2005 15:05:09 +0200 (CEST) Subject: [s-xml-cvs] CVS update: s-xml/ChangeLog Message-ID: <20050830130509.B9A318815C@common-lisp.net> Update of /project/s-xml/cvsroot/s-xml In directory common-lisp.net:/tmp/cvs-serv10946 Modified Files: ChangeLog Log Message: updated the changelog Date: Tue Aug 30 15:05:09 2005 Author: scaekenberghe Index: s-xml/ChangeLog diff -u s-xml/ChangeLog:1.2 s-xml/ChangeLog:1.3 --- s-xml/ChangeLog:1.2 Thu Feb 3 09:30:30 2005 +++ s-xml/ChangeLog Tue Aug 30 15:05:09 2005 @@ -1,3 +1,8 @@ +2005-08-30 Sven Van Caekenberghe + + * added Debian packaging directory (contributed by Luca Capello luca at pca.it) + * added experimental XML namespace support + 2005-02-03 Sven Van Caekenberghe * release 5 (cvs tag RELEASE_5) @@ -43,4 +48,4 @@ * release 0 * as part of an XML-RPC implementation -$Id: ChangeLog,v 1.2 2005/02/03 08:30:30 scaekenberghe Exp $ +$Id: ChangeLog,v 1.3 2005/08/30 13:05:09 scaekenberghe Exp $ From scaekenberghe at common-lisp.net Tue Aug 30 14:28:36 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Tue, 30 Aug 2005 16:28:36 +0200 (CEST) Subject: [s-xml-cvs] CVS update: Module imported: cl-soap Message-ID: <20050830142836.E4C7D8815C@common-lisp.net> Update of /project/s-xml/cvsroot/cl-soap In directory common-lisp.net:/tmp/cvs-serv16411 Log Message: project creation Status: Vendor Tag: svc Release Tags: start No conflicts created by this import Date: Tue Aug 30 16:28:36 2005 Author: scaekenberghe New module cl-soap added