Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我犯了使用“的错误”;“打印xml”;在Lisp中,当我遵循s-xml主页的示例时_Xml_Lisp_Common Lisp - Fatal编程技术网

我犯了使用“的错误”;“打印xml”;在Lisp中,当我遵循s-xml主页的示例时

我犯了使用“的错误”;“打印xml”;在Lisp中,当我遵循s-xml主页的示例时,xml,lisp,common-lisp,Xml,Lisp,Common Lisp,s-xml主页: 我使用Clozure CL运行Lisp。到目前为止效果还不错 然后我尝试了s-xml,如下所示: 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":

s-xml主页:

我使用Clozure CL运行Lisp。到目前为止效果还不错

然后我尝试了s-xml,如下所示:

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)
#<Package "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 > 
欢迎使用Clozure通用Lisp版本1.7-dev-r14406M-trunk(DarwinX8664)!
? (加载“~/quicklisp/setup.lisp”)
#P“/Users/zijia/quicklisp/setup.lisp”
? (ql:quickload“s-xml”)
要加载“s-xml”:
加载1 ASDF系统:
s-xml
; 加载“s-xml”
(“s-xml”)
? (包中:s-xml)
#
? (打印xml)(p“有趣的东西在”((a href)”http://slashdot.org(“SlashDot”))
<
>错误:没有适用于泛型函数的方法:
>          #
>使用参数调用时:
>(零)
>执行时:#,进程内侦听器(1)。
>键入:继续,:POP中止,:R获取可用重新启动的列表。
>如果继续:请重试
>类型:?其他选择。
1 > 
(打印xml)(p“有趣的东西在”((a href)”http://slashdot.org)是从中复制的。其余的例子运行良好。“打印xml”有什么问题


谢谢。

我在SBCL也有同样的感受。在Slime中快速检查会发现以下变量:

(defvar *ignore-namespaces* nil
  "When t, namespaces are ignored like in the old version of S-XML")
我认为common-lisp.net上的文档已经过时了。您的一个快速解决方法是
将此变量设置为
t
,这将导致
打印标识符
只打印该标识符


我不知道名称空间是如何使用的;您可以尝试在更新的文档中找到它,深入研究代码,或者联系作者。

首先,“打印xml”当然已经过时了。您可以编写自己的打印xml函数。您甚至不需要文档,因为s-xml的接口非常简单。因此,请查看xml.lisp以浏览源代码。:)

谢谢你的回答。在哪里可以找到最新的s-xml文档?common-lisp.net是我能找到的最新版本。