From dlichteblau at common-lisp.net Fri Feb 8 21:43:13 2008 From: dlichteblau at common-lisp.net (dlichteblau) Date: Fri, 8 Feb 2008 16:43:13 -0500 (EST) Subject: [cxml-cvs] CVS cxml/klacks Message-ID: <20080208214313.46890610B2@common-lisp.net> Update of /project/cxml/cvsroot/cxml/klacks In directory clnet:/tmp/cvs-serv22544/klacks Modified Files: klacks-impl.lisp Log Message: represent base uris as strings, not puri objects --- /project/cxml/cvsroot/cxml/klacks/klacks-impl.lisp 2007/12/02 20:56:23 1.14 +++ /project/cxml/cvsroot/cxml/klacks/klacks-impl.lisp 2008/02/08 21:43:12 1.15 @@ -490,7 +490,10 @@ nil))) (defmethod klacks:current-xml-base ((source cxml-source)) - (car (base-stack (slot-value source 'context)))) + (let ((x (car (base-stack (slot-value source 'context))))) + (if (stringp x) + x + (puri:render-uri x nil)))) (defmethod klacks:map-current-namespace-declarations (fn (source cxml-source)) (loop From dlichteblau at common-lisp.net Fri Feb 8 21:43:13 2008 From: dlichteblau at common-lisp.net (dlichteblau) Date: Fri, 8 Feb 2008 16:43:13 -0500 (EST) Subject: [cxml-cvs] CVS cxml/xml Message-ID: <20080208214313.D9DD36209D@common-lisp.net> Update of /project/cxml/cvsroot/cxml/xml In directory clnet:/tmp/cvs-serv22544/xml Modified Files: xml-parse.lisp Log Message: represent base uris as strings, not puri objects --- /project/cxml/cvsroot/cxml/xml/xml-parse.lisp 2007/12/22 15:24:52 1.76 +++ /project/cxml/cvsroot/cxml/xml/xml-parse.lisp 2008/02/08 21:43:13 1.77 @@ -692,7 +692,10 @@ nil))) (defmethod sax:xml-base ((parser cxml-parser)) - (car (base-stack (slot-value parser 'ctx)))) + (let ((uri (car (base-stack (slot-value parser 'ctx))))) + (if (stringp uri) + uri + (puri:render-uri uri nil)))) (defvar *validate* t) (defvar *external-subset-p* nil) From dlichteblau at common-lisp.net Tue Feb 19 18:53:06 2008 From: dlichteblau at common-lisp.net (dlichteblau) Date: Tue, 19 Feb 2008 13:53:06 -0500 (EST) Subject: [cxml-cvs] CVS cxml/xml Message-ID: <20080219185306.BD7B85535C@common-lisp.net> Update of /project/cxml/cvsroot/cxml/xml In directory clnet:/tmp/cvs-serv2761 Modified Files: xml-parse.lisp Log Message: fixed PARSE for non-file-streams --- /project/cxml/cvsroot/cxml/xml/xml-parse.lisp 2008/02/08 21:43:13 1.77 +++ /project/cxml/cvsroot/cxml/xml/xml-parse.lisp 2008/02/19 18:53:06 1.78 @@ -3113,8 +3113,9 @@ (make-stream-name :entity-name "main document" :entity-kind :main - :uri (pathname-to-uri - (merge-pathnames (or pathname (pathname input)))))) + :uri (if pathname + (pathname-to-uri (merge-pathnames pathname)) + (safe-stream-sysid input)))) (apply #'parse-xstream xstream handler args)))))) (defun parse-xstream (xstream handler &rest args) From dlichteblau at common-lisp.net Sun Feb 24 19:03:50 2008 From: dlichteblau at common-lisp.net (dlichteblau) Date: Sun, 24 Feb 2008 14:03:50 -0500 (EST) Subject: [cxml-cvs] CVS cxml/xml Message-ID: <20080224190350.8258B2F047@common-lisp.net> Update of /project/cxml/cvsroot/cxml/xml In directory clnet:/tmp/cvs-serv17828/xml Modified Files: xmls-compat.lisp Log Message: add XPath support for xmls-compat --- /project/cxml/cvsroot/cxml/xml/xmls-compat.lisp 2007/11/18 18:43:00 1.6 +++ /project/cxml/cvsroot/cxml/xml/xmls-compat.lisp 2008/02/24 19:03:48 1.7 @@ -9,7 +9,7 @@ (defpackage cxml-xmls (:use :cl :runes) (:export #:make-node #:node-name #:node-ns #:node-attrs #:node-children - #:make-xmls-builder #:map-node)) + #:make-xmls-builder #:map-node #:make-xpath-navigator)) (in-package :cxml-xmls) @@ -241,3 +241,20 @@ :specified-p t) nil))) (node-attrs node)))) + +;;;; XPath + +(defun make-xpath-navigator () + (make-instance 'xpath-navigator)) + +(defclass xpath-navigator () + ((parents :initform (make-hash-table)) + (prefixes :initform (make-hash-table)) + (children :initform (make-hash-table)) + (attributes :initform (make-hash-table)) + (namespaces :initform (make-hash-table)))) + +(defmethod initialize-instance :after ((instance xpath-navigator) &key) + (with-slots (prefixes) instance + (setf (gethash "http://www.w3.org/XML/1998/namespace" prefixes) + "xml"))) From dlichteblau at common-lisp.net Sun Feb 24 20:38:35 2008 From: dlichteblau at common-lisp.net (dlichteblau) Date: Sun, 24 Feb 2008 15:38:35 -0500 (EST) Subject: [cxml-cvs] CVS closure-common Message-ID: <20080224203835.C985A15011@common-lisp.net> Update of /project/cxml/cvsroot/closure-common In directory clnet:/tmp/cvs-serv4575 Modified Files: xstream.lisp Log Message: allow Microsoft BOM (thanks to Ivan Shvedunov) --- /project/cxml/cvsroot/closure-common/xstream.lisp 2007/12/22 15:19:25 1.9 +++ /project/cxml/cvsroot/closure-common/xstream.lisp 2008/02/24 20:38:35 1.10 @@ -342,7 +342,6 @@ (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))) (declare (type (simple-array buffer-byte (*)) buffer)) @@ -375,6 +374,11 @@ (t (cond ((and (= c0 #xFE) (= c1 #xFF)) (values :utf-16-big-endian nil)) ((and (= c0 #xFF) (= c1 #xFE)) (values :utf-16-little-endian nil)) + ((and (= c0 #xEF) (= c1 #xBB)) + (let ((c2 (read-byte stream nil :eof))) + (if (= c2 #xBF) + (values :utf-8 nil) + (values :utf-8 (list c0 c1 c2))))) (t (values :utf-8 (list c0 c1)))))))))))