Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/XML-XPath/Common-Lisp/xml-xpath.lisp
Normal file
15
Task/XML-XPath/Common-Lisp/xml-xpath.lisp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(dolist (system '(:xpath :cxml-stp :cxml))
|
||||
(asdf:oos 'asdf:load-op system))
|
||||
|
||||
(defparameter *doc* (cxml:parse-file "xml" (stp:make-builder)))
|
||||
|
||||
(xpath:first-node (xpath:evaluate "/inventory/section[1]/item[1]" *doc*))
|
||||
|
||||
(xpath:do-node-set (node (xpath:evaluate "/inventory/section/item/price/text()" *doc*))
|
||||
(format t "~A~%" (stp:data node)))
|
||||
|
||||
(defun node-array (node-set)
|
||||
(coerce (xpath:all-nodes node-set) 'vector))
|
||||
|
||||
(node-array
|
||||
(xpath:evaluate "/inventory/section/item/name" *doc*))
|
||||
Loading…
Add table
Add a link
Reference in a new issue