[plexippus-xpath-devel] Beginner: trying out xpath

Ivan Shvedunov ivan4th at gmail.com
Fri Nov 26 23:56:43 UTC 2010


Hello.
The error message indicates that your cxml-stp is not the most recent one.
Please use the version from quicklisp (make sure it was updated since its
beta release if you're already using it) or from cxml-stp git repository:
git clone http://www.lichteblau.com/git/cxml-stp.git

On Sat, Nov 27, 2010 at 2:48 AM, Andrei Stebakov <lispercat at gmail.com> wrote:
> Just tired to evaluate
>
> (let ((doc (chtml:parse (drakma:http-request "http://www.google.com")
>                        (stp:make-builder))))
>  (xpath:evaluate "//body" doc))
>
> This results in an exception:
> The value NIL is not of type VECTOR.
>   [Condition of type TYPE-ERROR]
>
> Restarts:
>  0: [RETRY] Retry SLIME interactive evaluation request.
>  1: [*ABORT] Return to SLIME's top level.
>  2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "worker"
> RUNNING {C499B91}>)
>
> Backtrace:
>  0: (CXML-STP-IMPL::NORMALIZE-TEXT-NODES! ..)
>  1: ((SB-PCL::FAST-METHOD XPATH-PROTOCOL:CHILD-PIPE-USING-NAVIGATOR
> ((EQL :DEFAULT-NAVIGATOR) CXML-STP:ELEMENT)) ..)
>  2: ((LAMBDA (SB-PCL::.PV. SB-PCL::.NEXT-METHOD-CALL. SB-PCL::.ARG0.
> SB-PCL::.ARG1.)) ..)
>  3: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) ..)
>  4: ((LAMBDA (XPATH::N)) ..)
>  5: (XPATH::MAPPEND-PIPE ..)
>  6: (XPATH::MAPPEND-PIPE ..)
>  7: (XPATH::MAPPEND-PIPE ..)
>  8: (XPATH::MAPPEND-PIPE ..)
>  9: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) ..)
>  10: ((LAMBDA (XPATH::N)) #.(CXML-STP-IMPL::DOCUMENT :CHILDREN
> '(#.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :CHILDREN '#
> :LOCAL-NAME "html" :NAMESPACE-URI "http://www.w3.org/1999/xhtml"))))
>  11: (XPATH::MAPPEND-PIPE ..)
>  12: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) ..)
>  13: ((LAMBDA (XPATH:CONTEXT)) #<XPATH:CONTEXT {DA0EA59}>)
>  14: (XPATH:EVALUATE-COMPILED ..)
>
>
> When evaluating "body" (without //) just returns an empty set.
>
> Got the latest xpath, cxml-stp, closure-html.
> What am I missing? Parsing html, should I use  (stp:do-recursively
> ...) instead for better results?
>
> Thank you,
> Andrew
>
> _______________________________________________
> plexippus-xpath-devel mailing list
> plexippus-xpath-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/plexippus-xpath-devel
>



-- 
Ivan Shvedunov <ivan4th at gmail.com>
;; My GPG fingerprint is: 2E61 0748 8E12 BB1A 5AB9  F7D0 613E C0F8 0BC5 2807




More information about the plexippus-xpath-devel mailing list