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...@locus.apache.org on 2000/06/07 20:16:01 UTC

cvs commit: xml-xalan/c/src/XPath SimpleNodeLocator.cpp SimpleNodeLocator.hpp

dbertoni    00/06/07 11:16:01

  Modified:    c/src/XPath SimpleNodeLocator.cpp SimpleNodeLocator.hpp
  Log:
  Fixed bug in stepPattern().
  
  Revision  Changes    Path
  1.14      +17 -5     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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- SimpleNodeLocator.cpp	2000/06/06 16:54:26	1.13
  +++ SimpleNodeLocator.cpp	2000/06/07 18:16:01	1.14
  @@ -405,7 +405,7 @@
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context, 
   			int 					opPos,
  -			double& 				score)
  +			double& 				scoreHolder)
   {
   	const XPathExpression&	currentExpression =
   		xpath.getExpression();
  @@ -425,17 +425,21 @@
   								   executionContext,
   								   localContext,
   								   endStep,
  -								   score);
  +								   scoreHolder);
   
   		if(0 == localContext)
   		{
  -			score = xpath.s_MatchScoreNone;
  +			scoreHolder = xpath.s_MatchScoreNone;
  +
  +		}
   
  +		if (scoreHolder == xpath.s_MatchScoreNone)
  +		{
   			// !!!!!!!!!!!!! Big ugly return here !!!!!!!!!!!!!!!!!!!
   			return 0;
   		}
   
  -		score = xpath.s_MatchScoreOther;
  +		scoreHolder = xpath.s_MatchScoreOther;
   
   		localContext = executionContext.getParentOfNode(*localContext);
   
  @@ -448,8 +452,10 @@
   
   	assert(localContext != 0);
   
  -	int argLen = 0;
  +	int			argLen = 0;
   
  +	double		score = xpath.s_MatchScoreNone;
  +
   	switch(stepType)
   	{
   	case XPathExpression::eOP_FUNCTION:
  @@ -651,6 +657,12 @@
   				}
   			}
   		}
  +	}
  +
  +	if (scoreHolder == xpath.s_MatchScoreNone || 
  +        score == xpath.s_MatchScoreNone)
  +	{
  +		scoreHolder = score;
   	}
   
   	return score == xpath.s_MatchScoreNone ? 0 : localContext;
  
  
  
  1.7       +1 -1      xml-xalan/c/src/XPath/SimpleNodeLocator.hpp
  
  Index: SimpleNodeLocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/SimpleNodeLocator.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SimpleNodeLocator.hpp	2000/04/11 14:46:11	1.6
  +++ SimpleNodeLocator.hpp	2000/06/07 18:16:01	1.7
  @@ -144,7 +144,7 @@
   			XPathExecutionContext&	executionContext,
   			XalanNode* 				context, 
   			int 					opPos,
  -			double& 				score);
  +			double& 				scoreHolder);
   
   	int
   	findNodeSet(