dbertoni 01/02/15 09:02:30
Modified: c/src/XPath SimpleNodeLocator.cpp
Log:
Fixed bug with index in pattern when matching root.
Revision Changes Path
1.35 +15 -8 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.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- SimpleNodeLocator.cpp 2001/02/08 21:45:12 1.34
+++ SimpleNodeLocator.cpp 2001/02/15 17:02:28 1.35
@@ -584,19 +584,26 @@
XalanNode* const parentContext =
DOMServices::getParentOfNode(*localContext);
- typedef XPathExecutionContext::BorrowReturnMutableNodeRefList
BorrowReturnMutableNodeRefList;
-
- BorrowReturnMutableNodeRefList mnl(executionContext);
-
- step(xpath, executionContext, parentContext, startOpPos, *mnl);
-
- if (mnl->indexOf(localContext) == MutableNodeRefList::npos)
+ if (parentContext == 0)
{
return XPath::s_MatchScoreNone;
}
else
{
- return XPath::s_MatchScoreOther;
+ typedef XPathExecutionContext::BorrowReturnMutableNodeRefList
BorrowReturnMutableNodeRefList;
+
+ BorrowReturnMutableNodeRefList mnl(executionContext);
+
+ step(xpath, executionContext, parentContext, startOpPos, *mnl);
+
+ if (mnl->indexOf(localContext) == MutableNodeRefList::npos)
+ {
+ return XPath::s_MatchScoreNone;
+ }
+ else
+ {
+ return XPath::s_MatchScoreOther;
+ }
}
}