From scaekenberghe at common-lisp.net Tue Aug 30 13:07:25 2005 From: scaekenberghe at common-lisp.net (Sven Van Caekenberghe) Date: Tue, 30 Aug 2005 15:07:25 +0200 Subject: [s-xml-devel] [PATCH] Make S-XML a Debian native package In-Reply-To: <87k6noqdva.fsf@gismo.pca.it> References: <87k6noqdva.fsf@gismo.pca.it> Message-ID: <1F54E6E2-2EFC-4EA2-A1EC-B6A1A944B8E2@common-lisp.net> Luca, I finally came around to apply your patch (to the current CVS head), I didn't test it though ;-) Thanks for the contribution! Sven BTW, the CVS version also contains experimental XML namespace support. On 31 Mar 2005, at 13:00, Luca Capello wrote: > Hello all! > > I'm sorry for the cross-posting, but this mail concerns both > mailing-lists. > > I'm using S-XML since I debianized it and it works with no particular > problem. I can say the same for some friends of mine that install from > my Debian package (which is no more publicly available as it should > enter Debian official soon, but if someone wants to test it, just drop > me a mail). > > Now, after some discussions in the Debian world about the differents > CL packages [1], I'm here to propose a patch that make S-XML a Debian > native package. The patch is simply the debian/ folder, which is > necessary and sufficient to build a Debian package. > > Comments or suggestions? > > Thx, bye, > Gismo / Luca > > [1] http://common-lisp.net/pipermail/cl-debian/2005-March/000000.html > > > > _______________________________________________ > s-xml-devel site list > s-xml-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/s-xml-devel From sven at beta9.be Tue Aug 30 13:51:47 2005 From: sven at beta9.be (Sven Van Caekenberghe) Date: Tue, 30 Aug 2005 15:51:47 +0200 Subject: [s-xml-devel] XML Namespace Support Added Message-ID: <8ABCD05E-23E6-4281-B876-3B012B7C7388@beta9.be> Hi All, I recently added XML namespace support to S-XML. I need this to support the CL-SOAP implementation that I am working on. This code is 'experimental', only available in CVS and not yet released. Here is a short description of how things were designed/implemented (most of it is internal stuff). The XML Namespace spec is http://www.w3.org/TR/REC-xml-names/ Although the spec is simple, real life interoperability is tricky. First of all, there is a variable s-xml:*ignore-namespaces* which can be used to switch off all namespace support (S-XML should behave like before). XML Namespaces are identified by URIs (unique strings actually). The idea is to map XML Namespaces 1-1 to Common Lisp packages. This is done by adding to (or editing) the info stored under s- xml::*know-namespaces*. (s-xml:find-namespace ) is used to find known namespaces (s-xml:register-namespace ) is used to add/ edit known namespaces. The prefix is the default prefix used when no other is specified/ active (see further). The s-xml:*local-namespace* is always known (and maps unqualified identifiers to the keyword package). For example, the following code defines/installs a namespace: (defconstant +soapenv-ns-uri+ "http://schemas.xmlsoap.org/soap/ envelope/") (defpackage :soapenv (:nicknames "soapenv") (:export "Envelope" "Header" "Body" "Fault" "encodingStyle") (:documentation "Package for symbols in the SOAP Envelope XML Namespace")) (defparameter *soapenv-ns* (s-xml:register-namespace +soapenv-ns-uri+ "soap-env" :soapenv)) Now, there is a difference between the known XML namespaces (as described above), and the current prefix to namespace bindings used during XML parsing or printing. The bindings are controlled by xmlns[:prefix] attributes. The bindings are held in the special variable s-xml:*namespaces* which starts with the empty prefix bound to *local-namespace* (see above). There are 3 major operations: 1. (s-xml:resolve-identifier identifier namespaces &optional as- attribute) Given a possibly qualified XML identifier string and current namespace bindings (typically s-xml:*namespaces*), intern the identifier as a symbol in the correct CL package 2. (s-xml:print-identifier identifier stream &optional as-attribute) Given a CL symbol, print it as a possibly qualified XML identifier on stream, using the value of the s-xml:*namespaces* [Writing this, I now see this is inconsistent API: add as parameter or remove in others] 3. (s-xml:extend-namespaces attributes namespaces) Given an alist (name . value) of the attributes of the current XML tag, search for xmlns[:prefix] attributes and possibly extend the current namespace bindings as necessary (and possibly creating CL packages and registering new XML namespaces). While resolving XML identifiers, either known namespaces and CL packages are used, or new ones are created if necessary. Newly interned symbols can be exported automatically. Note that XML identifiers are case sensitive which leads to 'unprintable' CL symbols like :|Foo| The following variables control some of the automatic, behind-the- scenes behavior: s-xml:*require-existing-symbols* s-xml:*auto-export-symbols* s-xml:*auto-create-namespace-packages* The net result is that apart from predefining some namespaces for convencience, most namespace stuff is handled automatically during parsing and dom printing. Note that for printing to be correct, the xmlns[:prefix] attributes have to be preserved. Some XML namespace examples and tests will be added (much) later. When the CL-SOAP project starts to release some code, example usages will be found there too. All comments are welcome, 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2355 bytes Desc: not available URL: From luca at pca.it Tue Aug 30 15:11:19 2005 From: luca at pca.it (Luca Capello) Date: Tue, 30 Aug 2005 17:11:19 +0200 Subject: [s-xml-devel] [PATCH] Make S-XML a Debian native package In-Reply-To: <1F54E6E2-2EFC-4EA2-A1EC-B6A1A944B8E2@common-lisp.net> References: <87k6noqdva.fsf@gismo.pca.it> <1F54E6E2-2EFC-4EA2-A1EC-B6A1A944B8E2@common-lisp.net> Message-ID: <878xyjlaso.fsf@gismo.pca.it> Hi Sven! On Tue 30 Aug 2005 15:07 +0200, Sven Van Caekenberghe wrote: > I finally came around to apply your patch (to the current CVS > head), I didn't test it though ;-) Thanks for the contribution! And I should say that I'm a bit stupid, because I forgot my patch. 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? And please excuse me again for the confusion. > BTW, the CVS version also contains experimental XML namespace > support. I read your post to s-xml-devel and I'm planning to package a new s-xml for Debian (as I should update it to the latest Debian policy). But I'm a bit busy at university until mid-September :-( BTW, s-xml is already included in Debian testing ;-) Thx, bye, Gismo / Luca [1] http://common-lisp.net/pipermail/cl-debian/2005-June/000045.html [2] http://common-lisp.net/pipermail/cl-debian/2005-July/000177.html [3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=310665 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: