From luca at pca.it Sun Nov 6 10:30:08 2005 From: luca at pca.it (Luca Capello) Date: Sun, 06 Nov 2005 11:30:08 +0100 Subject: [s-xml-devel] [PATCH] Make S-XML a Debian native package In-Reply-To: <878xyjlaso.fsf@gismo.pca.it> (Luca Capello's message of "Tue, 30 Aug 2005 17:11:19 +0200") References: <87k6noqdva.fsf@gismo.pca.it> <1F54E6E2-2EFC-4EA2-A1EC-B6A1A944B8E2@common-lisp.net> <878xyjlaso.fsf@gismo.pca.it> Message-ID: <87hdaqt6fj.fsf@gismo.pca.it> Hello Sven! On Tue 30 Aug 2005 17:11 +0200, Luca Capello wrote: > Actually, the story took another road: people involved in > packaging CL software for Debian decided to avoid Debian native > packages, as you can read from the cl-debian mailing-list archive, > please refer to posts [1] and [2]. As an example, the same happens > to cl-rfc2388 (Debian bug [3]). > > Finally, I'm really sorry to have forgotten to write you back, in > order to cancel in some way my patch. So, could you revert it, > letting s-xml as a _non_ Debian native package, please? I noticed that the debian/ folder is still present in the CVS. Please, could you remove it? Thx, bye, Gismo / Luca -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From scaekenberghe at common-lisp.net Sun Nov 6 12:21:07 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Sun, 6 Nov 2005 13:21:07 +0100 Subject: [s-xml-devel] [PATCH] Make S-XML a Debian native package In-Reply-To: <87hdaqt6fj.fsf@gismo.pca.it> References: <87k6noqdva.fsf@gismo.pca.it> <1F54E6E2-2EFC-4EA2-A1EC-B6A1A944B8E2@common-lisp.net> <878xyjlaso.fsf@gismo.pca.it> <87hdaqt6fj.fsf@gismo.pca.it> Message-ID: Luca, Sorry for the delay - the (contents of the) debian directory has been removed. Due CVS's behavior, you need to do cvs update -dP if you don't want to see it. I hope this is OK, unless you want me to go into the CVS repository itself and remove the file - although I am not 100% sure than I am allowed to do this on comm-lisp.net. Sven On 06 Nov 2005, at 11:30, Luca Capello wrote: > Hello Sven! > > On Tue 30 Aug 2005 17:11 +0200, Luca Capello wrote: >> Actually, the story took another road: people involved in >> packaging CL software for Debian decided to avoid Debian native >> packages, as you can read from the cl-debian mailing-list archive, >> please refer to posts [1] and [2]. As an example, the same happens >> to cl-rfc2388 (Debian bug [3]). >> >> Finally, I'm really sorry to have forgotten to write you back, in >> order to cancel in some way my patch. So, could you revert it, >> letting s-xml as a _non_ Debian native package, please? > > I noticed that the debian/ folder is still present in the CVS. > > Please, could you remove it? > > Thx, bye, > Gismo / Luca > _______________________________________________ > s-xml-devel site list > s-xml-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/s-xml-devel From scaekenberghe at common-lisp.net Sun Nov 6 12:48:09 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Sun, 6 Nov 2005 13:48:09 +0100 Subject: [s-xml-devel] CDATA support added Message-ID: <9EAE1C40-795C-45A0-A37E-79F69E5BFB73@common-lisp.net> Thanks to a clean patch by Peter Van Eynde, CDATA support was added to CVS head. Sven -- Sven Van Caekenberghe - http://homepage.mac.com/svc Beta Nine - software engineering - http://www.beta9.be "Lisp isn't a language, it's a building material." - Alan Kay From scaekenberghe at common-lisp.net Sun Nov 6 12:55:41 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Sun, 6 Nov 2005 13:55:41 +0100 Subject: [s-xml-devel] Getting XML attributes In-Reply-To: <4f2a8db50510150205r1a5037cbga2d59f6d9164c8a7@mail.gmail.com> References: <4f2a8db50510150205r1a5037cbga2d59f6d9164c8a7@mail.gmail.com> Message-ID: <79FFDEE9-EA82-4E3F-8D7A-226F231148FA@common-lisp.net> Peter, On 15 Oct 2005, at 11:05, Peter BARABAS wrote: > Hello, > > > Is there a way to get the attributes of an element via a specified > "path"? E.g. something like: > > (let ((xml "Added > plan.")) > (get-xml-element "//changelog/patch/@local_date" xml)) > > would return the string "Fri Apr 15 11:43:05 CEST 2005". > > A similar approach to get the text content of an element would be > useful, > > (get-text-element "//changelog/patch/name" xml) > > would return "Added plan.". > > > Thank you for your help. > > -- > '(Yours parenthetically), > peter barabas. > > ((call/cc call/cc) (call/cc call/cc)) > _______________________________________________ I somehow missed you question - sorry about that. No, something like that does currently not exist in S-XML. It would fit in one of the DOM packages I suppose. If you convert XML to the LXML representation, for example, it would not be too difficult to write some simple Lisp function to access the data you need. These are for example some functions that I have been using (from the Cl-SOAP project): (defun lxml-get-tag (lxml) "Return the XML tag symbol of the lxml XML DOM" (cond ((symbolp lxml) lxml) ((stringp lxml) '()) ((symbolp (first lxml)) (first lxml)) (t (first (first lxml))))) (defun lxml-get-attributes (lxml) "Return the XML attributes plist of the lxml XML DOM" (cond ((or (symbolp lxml) (stringp lxml) (symbolp (first lxml))) '()) (t (rest (first lxml))))) (defun lxml-get-children (lxml) "Return the XML children list of the lxml XML DOM" (cond ((or (symbolp lxml) (stringp lxml)) '()) (t (rest lxml)))) (defun lxml-get-contents (lxml) "Return the contents (first child) of the lxml XML DOM" (first (lxml-get-children lxml))) (defun lxml-find-tag (tag lxml) "Find a specific tag in a lxml XML DOM list" (find tag lxml :key #'lxml-get-tag)) (defun lxml-find-tags (tag lxml) "Find all elements of a specific tag in a lxml XML DOM list" (remove-if-not #'(lambda (x) (eql (lxml-get-tag x) tag)) lxml)) Along these lines, you could add 'recursive drilling down' based on a 'path' string. Is there some standard for these 'path queries' ? Contributions/extensions are allways welcome! HTH, Sven -- Sven Van Caekenberghe - http://homepage.mac.com/svc Beta Nine - software engineering - http://www.beta9.be "Lisp isn't a language, it's a building material." - Alan Kay From luca at pca.it Sun Nov 6 14:38:37 2005 From: luca at pca.it (Luca Capello) Date: Sun, 06 Nov 2005 15:38:37 +0100 Subject: [s-xml-devel] [PATCH] Make S-XML a Debian native package In-Reply-To: (Sven Van Caekenberghe's message of "Sun, 6 Nov 2005 13:21:07 +0100") References: <87k6noqdva.fsf@gismo.pca.it> <1F54E6E2-2EFC-4EA2-A1EC-B6A1A944B8E2@common-lisp.net> <878xyjlaso.fsf@gismo.pca.it> <87hdaqt6fj.fsf@gismo.pca.it> Message-ID: <87zmohon82.fsf@gismo.pca.it> Hi Sven! On Sun 06 Nov 2005 13:21 +0100, Sven Van Caekenberghe wrote: > Sorry for the delay - the (contents of the) debian directory has been > removed. Thanks! > Due CVS's behavior, you need to do cvs update -dP if you don't want > to see it. > I hope this is OK, unless you want me to go into the CVS repository > itself and remove the file - although I am not 100% sure than I am > allowed to do this on comm-lisp.net. Well, the best will be to completely delete any Debian reference, but if you download a CVS checkout by the ViewCVS repository, the debian/ folder is not present, so it's the same. Thank you again for your patience. Thx, bye, Gismo / Luca -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From rudi at constantly.at Thu Nov 17 13:14:00 2005 From: rudi at constantly.at (Rudi Schlatte) Date: Thu, 17 Nov 2005 14:14:00 +0100 Subject: [s-xml-devel] support for the xml: namespace Message-ID: <9DD657F7-BD49-475C-948F-8DF47C7E9442@constantly.at> Hi, This patch adds support for the xml: namespace, as per the xml namespace spec. I /think/ I have commit rights, but would appreciate comments, especially of the "no, it's supposed to be done *that* way" variety. Index: src/xml.lisp =================================================================== RCS file: /project/s-xml/cvsroot/s-xml/src/xml.lisp,v retrieving revision 1.13 diff -u -r1.13 xml.lisp --- src/xml.lisp 6 Nov 2005 12:44:48 -0000 1.13 +++ src/xml.lisp 11 Nov 2005 13:39:38 -0000 @@ -154,15 +154,16 @@ :initform nil)) (:documentation "Describes an XML namespace and how it is handled")) +(defmethod print-object ((object xml-namespace) stream) + (print-unreadable-object (object stream :type t :identity t) + (format stream "~A - ~A" (get-prefix object) (get-uri object)))) + (defvar *local-namespace* (make-instance 'xml-namespace :uri "local" :prefix "" :package (find- package :keyword)) "The local (global default) XML namespace") -(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)) @@ -180,9 +181,6 @@ *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))) @@ -250,6 +248,18 @@ (if *auto-create-namespace-packages* (make-package (string-upcase unique- name) :nicknames `(,unique-name)) (error "Cannot create package ~s" unique-name)))))) + +;;; REC-xml-names-19990114 says: "The prefix xml is by definition +;;; bound to the namespace name http://www.w3.org/XML/1998/namespace." +(defvar *xml-namespace* + (new-namespace "http://www.w3.org/XML/1998/namespace" "xml")) + +(defvar *known-namespaces* + (list *local-namespace* *xml-namespace*) + "The list of known/defined namespaces") + +(defvar *namespaces* `(("xml" . ,*xml-namespace*) ("" . ,*local- namespace*)) + "Ordered list of (prefix . XML-namespace) bindings currently in effect - special variable") (defun extend-namespaces (attributes namespaces) "Given possible 'xmlns[:prefix]' attributes, extend the namespaces bindings" -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: From rudi at constantly.at Sun Nov 20 16:35:08 2005 From: rudi at constantly.at (Rudi Schlatte) Date: Sun, 20 Nov 2005 17:35:08 +0100 Subject: [s-xml-devel] support for the xml: namespace In-Reply-To: <627E08F6-CE61-4CFD-916F-F4BC8DEA7A81@mac.com> References: <9DD657F7-BD49-475C-948F-8DF47C7E9442@constantly.at> <627E08F6-CE61-4CFD-916F-F4BC8DEA7A81@mac.com> Message-ID: <71B66D1D-3F58-41A4-9FD8-84651DB0F93B@constantly.at> [Replying to s-xml-devel as well; trolling for comments on namespaces and their Lispy representation..] On 20. Nov 2005, at 15:38, Sven Van Caekenberghe wrote: > I applied your patch, but I preferred to not use new-namespace and > shortcut the circular dependency by calling make-instance manually > for defining *xml-namespace*, like for *local-namespace*. Ah, I had never thought to try a clean reload of s-xml after making my changes... Thanks for applying! > Have you been using the new namespace support ? Did it work to your > expectations ? It is always nice to hear about the users of > someone's open source software. Not for big values of "using" - I'm looking at various xml libraries currently, just to get a feel for what's available. One thing I'm not sure about is whether it's a good idea to map namespace prefixes to packages. Consider: The two foo elements are different, but a hypothetical element-equal function would have to go to very great lengths to determine this from the resulting datastructure -- I can think of examples where two elements with identical names are be different, and two elements with differing parsed names have the same xml name. I haven't thought this through at all, but I think I'd identify elements and attributes by: - name (always a symbol in the keyword package or a dedicated package) - namespace (an object, as per register-namespace) That way, element equality can be determined with two calls to EQ. I'd keep the namespace prefix used for reading the element/attribute for pretty-printing. (The prefix can't be stored with the namespace, since multiple prefixes can simultaneously refer to the same namespace.) At the moment, this is just idle speculation on my part since I haven't used any Lisp xml parser (or indeed, xml) in anger yet, so I don't know how much of a problem this is in practice... Cheers, Rudi -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: