s-xml home: http://common-lisp.net/project/s-xml/
I use Clozure CL to run Lisp. It works fine so far.
Then I tried s-xml like below:
Welcome to Clozure Common Lisp Version 1.7-dev-r14406M-trunk (DarwinX8664)!
? (load "~/quicklisp/setup.lisp")
#P"/Users/zijia/quicklisp/setup.lisp"
? (ql:quickload "s-xml")
To load "s-xml":
Load 1 ASDF system:
s-xml
; Loading "s-xml"
("s-xml")
? (in-package :s-xml)
#<开发者_如何学PythonPackage "S-XML">
? (print-xml '(p "Interesting stuff at " ((a href "http://slashdot.org") "SlashDot")))
<
> Error: There is no applicable method for the generic function:
> #<STANDARD-GENERIC-FUNCTION GET-PREFIX #x302000AB172F>
> when called with arguments:
> (NIL)
> While executing: #<CCL::STANDARD-KERNEL-METHOD NO-APPLICABLE-METHOD (T)>, in process listener(1).
> Type :GO to continue, :POP to abort, :R for a list of available restarts.
> If continued: Try calling it again
> Type :? for other options.
1 >
(print-xml '(p "Interesting stuff at " ((a href "http://slashdot.org") "SlashDot"))) is copied from http://common-lisp.net/project/s-xml/. The rest examples are running fine. What's wrong with this "print-xml"?
Thanks.
I get the same in SBCL. A quick inspection in Slime finds the following variable:
(defvar *ignore-namespaces* nil
"When t, namespaces are ignored like in the old version of S-XML")
I think that the documentation at common-lisp.net is outdated. A quick fix for you would be to let
or setf
this variable to t
, which would cause print-identifier
to just print that identifier.
I do not know how the namespaces are meant to be used; you could try to find that in more current documentation, diving into the code, or contacting the author.
First, 'print-xml' is outdated of course. You can write your own print xml function. And you do not even need documentation, because the interface of s-xml is very simple. So check out xml.lisp to browse the source code. :)
精彩评论