[plexippus-xpath-devel] error with expression pointing to nonexistent child node

David A. Thompson thompdump at gmail.com
Thu Sep 16 23:28:19 UTC 2010


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 "<etx></etx>" (stp:make-builder)))

#<XPATH:NODE-SET #.(ELEMENT LOCAL-NAME etx), ... {C9378D9}>


2. Evaluation of this xpath expression yields an empty node set:

TTEST> (xpath:evaluate "/foo" (cxml:parse "<etx></etx>" (stp:make-builder)))

#<XPATH:NODE-SET empty {CA0A879}>


3. Evaluation of this xpath expression triggers an error:

TTEST> (xpath:evaluate "//foo" (cxml:parse "<etx></etx>"
(stp:make-builder)))


Thanks for any suggestions...

- Alan





More information about the plexippus-xpath-devel mailing list