Closed Bug 75307 Opened 23 years ago Closed 23 years ago

PathExpr::evaluate does the wrong thing for //

Categories

(Core :: XSLT, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: sicking, Assigned: sicking)

Details

Attachments

(1 file)

The implementation of PathExpr::evaluate does some really strange things for // 
ops. Will attach a patch that should fix it. The patch also does some 
whitespace filtering. (this along with the patch in 75304 should be all 
whitespace filtering needed in the XPath engine)
Status: NEW → ASSIGNED
Keywords: review
-void PathExpr::fromDescendants
-    (PatternExpr* pExpr, Node* context, ContextState* cs, NodeSet* nodes)
+void PathExpr::evalDescendants
+    (PatternExpr* pExpr, Node* context, ContextState* cs, NodeSet* resNodes)
 {
-
-    if (( !context ) || (! pExpr )) return;
+    ExprResult *res = pExpr->evaluate(context, cs);
+    if (!res || res->getResultType() != ExprResult::NODESET) {
+        //XXX ErrorReport: report nonnodeset error


As you change the name of this, might it be worthwhile to change the signature
so that you can report failure to the caller?  (Perhaps in addition to making an
error report there.)  Seems like callers might really want to know if the
evaluation might fail.
ContextState inherits from ErrorObserver, so we had all we need.
(Though in this part of the code, there isn't really much to fail)

Axel
I'd rather that we waited with errorhandeling. The XPath engine needs to report 
errors on a ton of places and we havn't even decided exactly how all 
errorhandling should be done yet (ie what should be returned, what/when should 
be reported to the errorhandler)
Fix checked in, Axel
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Keywords: review
Resolution: --- → FIXED
bitching buttons, verfication spam
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: