From thompdump at gmail.com Thu Sep 16 23:28:19 2010 From: thompdump at gmail.com (David A. Thompson) Date: Thu, 16 Sep 2010 16:28:19 -0700 Subject: [plexippus-xpath-devel] error with expression pointing to nonexistent child node Message-ID: <4C92A813.6040900@gmail.com> Depending on the xpath expression, when a match isn't found, either an empty node-set is returned or an error occurs. Is this deliberate? 1. Match works as expected: TTEST> (xpath:evaluate "/etx" (cxml:parse "" (stp:make-builder))) # 2. Evaluation of this xpath expression yields an empty node set: TTEST> (xpath:evaluate "/foo" (cxml:parse "" (stp:make-builder))) # 3. Evaluation of this xpath expression triggers an error: TTEST> (xpath:evaluate "//foo" (cxml:parse "" (stp:make-builder))) Thanks for any suggestions... - Alan From ivan4th at gmail.com Fri Sep 17 07:06:45 2010 From: ivan4th at gmail.com (Ivan Shvedunov) Date: Fri, 17 Sep 2010 11:06:45 +0400 Subject: [plexippus-xpath-devel] error with expression pointing to nonexistent child node In-Reply-To: <4C92A813.6040900@gmail.com> References: <4C92A813.6040900@gmail.com> Message-ID: Hello, On Fri, Sep 17, 2010 at 3:28 AM, David A. Thompson wrote: > Depending on the xpath expression, when a match isn't found, either an > empty node-set is returned or an error occurs. Is this deliberate? > > 1. Match works as expected: > > TTEST> (xpath:evaluate "/etx" (cxml:parse "" (stp:make-builder))) > > # > > > 2. Evaluation of this xpath expression yields an empty node set: > > TTEST> (xpath:evaluate "/foo" (cxml:parse "" (stp:make-builder))) > > # > > > 3. Evaluation of this xpath expression triggers an error: > > TTEST> (xpath:evaluate "//foo" (cxml:parse "" > (stp:make-builder))) > No, it should not signal an error when a match isn't found. Which CL implementation are you using? (looks like SBCL?) I cannot reproduce this problem, what does the backtrace look like? -- Ivan Shvedunov ;; My GPG fingerprint is: 2E61 0748 8E12 BB1A 5AB9? F7D0 613E C0F8 0BC5 2807 From thompdump at gmail.com Fri Sep 17 20:17:00 2010 From: thompdump at gmail.com (David A. Thompson) Date: Fri, 17 Sep 2010 13:17:00 -0700 Subject: [plexippus-xpath-devel] error with expression pointing to nonexistent child node In-Reply-To: References: <4C92A813.6040900@gmail.com> Message-ID: <4C93CCBC.50307@gmail.com> On 09/17/2010 12:06 AM, Ivan Shvedunov wrote: > Hello, > > On Fri, Sep 17, 2010 at 3:28 AM, David A. Thompson wrote: >> Depending on the xpath expression, when a match isn't found, either an >> empty node-set is returned or an error occurs. Is this deliberate? >> >> 1. Match works as expected: >> >> TTEST> (xpath:evaluate "/etx" (cxml:parse "" (stp:make-builder))) >> >> # >> >> >> 2. Evaluation of this xpath expression yields an empty node set: >> >> TTEST> (xpath:evaluate "/foo" (cxml:parse "" (stp:make-builder))) >> >> # >> >> >> 3. Evaluation of this xpath expression triggers an error: >> >> TTEST> (xpath:evaluate "//foo" (cxml:parse "" >> (stp:make-builder))) >> > > No, it should not signal an error when a match isn't found. > Which CL implementation are you using? (looks like SBCL?) > I cannot reproduce this problem, what does the backtrace look like? > Ivan, Thanks for the quick response. I'm using SBCL 1.0.39. SBCL's complaint: The value NIL is not of type VECTOR. [Condition of type TYPE-ERROR] Restarts: 0: [RETRY] Retry SLIME REPL evaluation request. 1: [*ABORT] Return to SLIME's top level. 2: [TERMINATE-THREAD] Terminate this thread (#) Backtrace: 0: (CXML-STP-IMPL::NORMALIZE-TEXT-NODES! #.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "etx")) 1: ((SB-PCL::FAST-METHOD XPATH-PROTOCOL:CHILD-PIPE-USING-NAVIGATOR ((EQL :DEFAULT-NAVIGATOR) CXML-STP:ELEMENT)) ..) 2: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) ..) 3: ((LAMBDA (XPATH::N)) #.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "etx")) 4: (XPATH::MAPPEND-PIPE # (#.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "etx") . #)) 5: (XPATH::MAPPEND-PIPE # (#.(CXML-STP-IMPL::DOCUMENT :CHILDREN '(#1=#.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "etx"))) #1# . #)) 6: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) ..) 7: ((LAMBDA (XPATH::N)) #.(CXML-STP-IMPL::DOCUMENT :CHILDREN '(#.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "etx")))) 8: (XPATH::MAPPEND-PIPE # (#.(CXML-STP-IMPL::DOCUMENT :CHILDREN '(#.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "etx"))) . #)) 9: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) ..) 10: ((LAMBDA (XPATH:CONTEXT)) #) 11: (XPATH:EVALUATE-COMPILED # #.(CXML-STP-IMPL::DOCUMENT :CHILDREN '(#.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "etx"))) NIL) 12: (SB-INT:SIMPLE-EVAL-IN-LEXENV (XPATH:EVALUATE "//foo" (CXML:PARSE "" (CXML-STP:MAKE-BUILDER))) #) --more-- From ivan4th at gmail.com Fri Sep 17 20:26:09 2010 From: ivan4th at gmail.com (Ivan Shvedunov) Date: Sat, 18 Sep 2010 00:26:09 +0400 Subject: [plexippus-xpath-devel] error with expression pointing to nonexistent child node In-Reply-To: <4C93CCBC.50307@gmail.com> References: <4C92A813.6040900@gmail.com> <4C93CCBC.50307@gmail.com> Message-ID: Hello, On Sat, Sep 18, 2010 at 12:17 AM, David A. Thompson wrote: > Ivan, > > Thanks for the quick response. I'm using SBCL 1.0.39. > > SBCL's complaint: > > The value NIL is not of type VECTOR. > ? [Condition of type TYPE-ERROR] > > Restarts: > ?0: [RETRY] Retry SLIME REPL evaluation request. > ?1: [*ABORT] Return to SLIME's top level. > ?2: [TERMINATE-THREAD] Terminate this thread (# RUNNING {C2A3F81}>) > > Backtrace: > ?0: (CXML-STP-IMPL::NORMALIZE-TEXT-NODES! #.(CXML-STP:ELEMENT #| :PARENT of > type DOCUMENT |# :LOCAL-NAME "etx")) > ?1: ((SB-PCL::FAST-METHOD XPATH-PROTOCOL:CHILD-PIPE-USING-NAVIGATOR ((EQL > :DEFAULT-NAVIGATOR) CXML-STP:ELEMENT)) ..) > ?2: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) ..) > ?3: ((LAMBDA (XPATH::N)) #.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# > :LOCAL-NAME "etx")) > ?4: (XPATH::MAPPEND-PIPE # > (#.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "etx") . > #)) > ?5: (XPATH::MAPPEND-PIPE # > (#.(CXML-STP-IMPL::DOCUMENT :CHILDREN '(#1=#.(CXML-STP:ELEMENT #| :PARENT of > type DOCUMENT |# :LOCAL-NAME "etx"))) #1# . #)) > ?6: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) ..) > ?7: ((LAMBDA (XPATH::N)) #.(CXML-STP-IMPL::DOCUMENT :CHILDREN > '(#.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "etx")))) > ?8: (XPATH::MAPPEND-PIPE # > (#.(CXML-STP-IMPL::DOCUMENT :CHILDREN '(#.(CXML-STP:ELEMENT #| :PARENT of > type DOCUMENT |# :LOCAL-NAME "etx"))) . #)) > ?9: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) ..) > ?10: ((LAMBDA (XPATH:CONTEXT)) #) > ?11: (XPATH:EVALUATE-COMPILED # > #.(CXML-STP-IMPL::DOCUMENT :CHILDREN '(#.(CXML-STP:ELEMENT #| :PARENT of > type DOCUMENT |# :LOCAL-NAME "etx"))) NIL) > ?12: (SB-INT:SIMPLE-EVAL-IN-LEXENV (XPATH:EVALUATE "//foo" (CXML:PARSE > "" (CXML-STP:MAKE-BUILDER))) #) > ?--more-- > Seems like this is CXML-STP whitespace normalization bug which is already fixed in its git repository. Try it with the fresh version: git clone http://www.lichteblau.com/git/cxml-stp.git -- Ivan Shvedunov ;; My GPG fingerprint is: 2E61 0748 8E12 BB1A 5AB9? F7D0 613E C0F8 0BC5 2807 From david at lichteblau.com Fri Sep 17 20:19:55 2010 From: david at lichteblau.com (David Lichteblau) Date: Fri, 17 Sep 2010 22:19:55 +0200 Subject: [plexippus-xpath-devel] error with expression pointing to nonexistent child node In-Reply-To: <4C93CCBC.50307@gmail.com> References: <4C92A813.6040900@gmail.com> <4C93CCBC.50307@gmail.com> Message-ID: <20100917201955.GA9830@radon> Quoting David A. Thompson (thompdump at gmail.com): > Ivan, > > Thanks for the quick response. I'm using SBCL 1.0.39. > > SBCL's complaint: > > The value NIL is not of type VECTOR. > [Condition of type TYPE-ERROR] This sounds like a recently fixed bug in cxml-stp, which occured with current SBCL. Try upgrading your cxml-stp from git. Thanks d.