You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/06/06 23:47:55 UTC
cvs commit: xml-xalan/c/src/XPath SimpleNodeLocator.cpp
dbertoni 01/06/06 14:47:55
Modified: c/src/XPath SimpleNodeLocator.cpp
Log:
Fixed bug with certain match patterns. Fix courtesy of mfpeng@excite.com.
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: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org