dbertoni 01/06/06 14:47:55
Modified: c/src/XPath SimpleNodeLocator.cpp
Log:
Fixed bug with certain match patterns. Fix courtesy of [EMAIL PROTECTED]
Revision Changes Path
1.39 +27 -0 xml-xalan/c/src/XPath/SimpleNodeLocator.cpp
Index: SimpleNodeLocator.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/SimpleNodeLocator.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- SimpleNodeLocator.cpp 2001/05/03 22:14:02 1.38
+++ SimpleNodeLocator.cpp 2001/06/06 21:47:54 1.39
@@ -448,6 +448,33 @@
{
score = XPath::s_MatchScoreOther;
}
+ else
+ {
+ const int prevPos =
currentExpression.getNextOpCodePosition(startOpPos);
+ const int prevStepType =
currentExpression.getOpCodeMapValue(prevPos);
+
+ if (xpath.s_MatchScoreNone == score &&
+ (prevStepType ==
XPathExpression::eMATCH_ANY_ANCESTOR ||
+ prevStepType ==
XPathExpression::eMATCH_ANY_ANCESTOR_WITH_PREDICATE))
+ {
+ while(0 != context)
+ {
+ score = nodeTest(
+ xpath,
+ executionContext,
+ context,
+ context->getNodeType(),
+ opPos,
+ argLen,
+ stepType);
+
+ if(xpath.s_MatchScoreNone !=
score)
+ break;
+
+ context =
DOMServices::getParentOfNode(*context);
+ }
+ }
+ }
}
break;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]