Closed
Bug 75307
Opened 23 years ago
Closed 23 years ago
PathExpr::evaluate does the wrong thing for //
Categories
(Core :: XSLT, defect)
Core
XSLT
Tracking
()
VERIFIED
FIXED
People
(Reporter: sicking, Assigned: sicking)
Details
Attachments
(1 file)
4.51 KB,
patch
|
Details | Diff | Splinter Review |
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)
Assignee | ||
Comment 1•23 years ago
|
||
Comment 2•23 years ago
|
||
r=axel@pike.org
-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.
Comment 4•23 years ago
|
||
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
Assignee | ||
Comment 5•23 years ago
|
||
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)
OK, fair enough. sr=shaver.
Comment 7•23 years ago
|
||
Fix checked in, Axel
You need to log in
before you can comment on or make changes to this bug.
Description
•