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/01/25 18:14:39 UTC

cvs commit: xml-xalan/c/src/XPath FunctionConcat.cpp FunctionNormalizeSpace.cpp FunctionNumber.cpp FunctionString.cpp FunctionStringLength.cpp FunctionSubstring.cpp FunctionSubstringAfter.cpp FunctionSubstringBefore.cpp FunctionSum.cpp FunctionTranslate.cpp XObject.cpp XPathExecutionContext.hpp XPathExpression.cpp XPathFunctionTable.cpp XPathProcessorImpl.cpp XResultTreeFrag.hpp XStringCached.cpp

dbertoni    01/01/25 09:14:39

  Modified:    c/src/XPath FunctionConcat.cpp FunctionNormalizeSpace.cpp
                        FunctionNumber.cpp FunctionString.cpp
                        FunctionStringLength.cpp FunctionSubstring.cpp
                        FunctionSubstringAfter.cpp
                        FunctionSubstringBefore.cpp FunctionSum.cpp
                        FunctionTranslate.cpp XObject.cpp
                        XPathExecutionContext.hpp XPathExpression.cpp
                        XPathFunctionTable.cpp XPathProcessorImpl.cpp
                        XResultTreeFrag.hpp XStringCached.cpp
  Log:
  Change for Solaris port.
  
  Revision  Changes    Path
  1.9       +16 -12    xml-xalan/c/src/XPath/FunctionConcat.cpp
  
  Index: FunctionConcat.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionConcat.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionConcat.cpp	2000/12/21 04:29:29	1.8
  +++ FunctionConcat.cpp	2001/01/25 17:14:10	1.9
  @@ -110,13 +110,15 @@
   
   	XPathExecutionContext::GetAndReleaseCachedString	theResult(executionContext);
   
  +	XalanDOMString&			theString = theResult.get();
  +
   	const XalanDOMString&	theArg1 = arg1->str();
   	const XalanDOMString&	theArg2 = arg2->str();
   
  -	reserve(theResult, length(theArg1) + length(theArg2) + 1);
  +	reserve(theString, length(theArg1) + length(theArg2) + 1);
   
  -	append(theResult, theArg1);
  -	append(theResult, theArg2);
  +	append(theString, theArg1);
  +	append(theString, theArg2);
   
   	return executionContext.getXObjectFactory().createString(theResult);
   }
  @@ -135,15 +137,17 @@
   
   	XPathExecutionContext::GetAndReleaseCachedString	theResult(executionContext);
   
  +	XalanDOMString&			theString = theResult.get();
  +
   	const XalanDOMString&	theArg1 = arg1->str();
   	const XalanDOMString&	theArg2 = arg2->str();
   	const XalanDOMString&	theArg3 = arg3->str();
   
  -	reserve(theResult, length(theArg1) + length(theArg2) + length(theArg3) + 1);
  +	reserve(theString, length(theArg1) + length(theArg2) + length(theArg3) + 1);
   
  -	append(theResult, theArg1);
  -	append(theResult, theArg2);
  -	append(theResult, theArg3);
  +	append(theString, theArg1);
  +	append(theString, theArg2);
  +	append(theString, theArg3);
   
   	return executionContext.getXObjectFactory().createString(theResult);
   }
  @@ -174,14 +178,16 @@
   
   	XPathExecutionContext::GetAndReleaseCachedString	theResult(executionContext);
   
  -	reserve(theResult, theCombinedLength + 1);
  +	XalanDOMString&		theString = theResult.get();
   
  +	reserve(theString, theCombinedLength + 1);
  +
   	{
   		XObjectArgVectorType::const_iterator	i = args.begin();
   
   		for(; i != theEnd; ++i)
   		{
  -			append(theResult, (*i)->str());
  +			append(theString, (*i)->str());
   		}
   	}
   
  @@ -205,7 +211,5 @@
   const XalanDOMString
   FunctionConcat::getError() const
   {
  -	return XALAN_STATIC_UCODE_STRING(
  -		"The concat() function takes at least two arguments!");
  +	return XALAN_STATIC_UCODE_STRING("The concat() function takes at least two arguments!");
   }
  -
  
  
  
  1.10      +4 -2      xml-xalan/c/src/XPath/FunctionNormalizeSpace.cpp
  
  Index: FunctionNormalizeSpace.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNormalizeSpace.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FunctionNormalizeSpace.cpp	2000/12/06 21:00:37	1.9
  +++ FunctionNormalizeSpace.cpp	2001/01/25 17:14:11	1.10
  @@ -101,9 +101,11 @@
   		// Get a cached string...
   		XPathExecutionContext::GetAndReleaseCachedString	theData(executionContext);
   
  -		DOMServices::getNodeData(*context, theData);
  +		XalanDOMString&		theString = theData.get();
   
  -		return normalize(executionContext, theData);
  +		DOMServices::getNodeData(*context, theString);
  +
  +		return normalize(executionContext, theString);
   	}
   }
   
  
  
  
  1.6       +4 -2      xml-xalan/c/src/XPath/FunctionNumber.cpp
  
  Index: FunctionNumber.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNumber.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionNumber.cpp	2000/12/06 21:00:41	1.5
  +++ FunctionNumber.cpp	2001/01/25 17:14:12	1.6
  @@ -101,9 +101,11 @@
   		// Get a cached string...
   		XPathExecutionContext::GetAndReleaseCachedString	theData(executionContext);
   
  -		DOMServices::getNodeData(*context, theData);
  +		XalanDOMString&		theString = theData.get();
   
  -		return executionContext.getXObjectFactory().createNumber(DOMStringToDouble(theData));
  +		DOMServices::getNodeData(*context, theString);
  +
  +		return executionContext.getXObjectFactory().createNumber(DOMStringToDouble(theString));
   	}
   }
   
  
  
  
  1.9       +3 -1      xml-xalan/c/src/XPath/FunctionString.cpp
  
  Index: FunctionString.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionString.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionString.cpp	2000/12/21 04:29:29	1.8
  +++ FunctionString.cpp	2001/01/25 17:14:13	1.9
  @@ -101,7 +101,9 @@
   		// Get a cached string...
   		XPathExecutionContext::GetAndReleaseCachedString	theData(executionContext);
   
  -		DOMServices::getNodeData(*context, theData);
  +		XalanDOMString&		theString = theData.get();
  +
  +		DOMServices::getNodeData(*context, theString);
   
   		return executionContext.getXObjectFactory().createString(theData);
   	}
  
  
  
  1.6       +4 -2      xml-xalan/c/src/XPath/FunctionStringLength.cpp
  
  Index: FunctionStringLength.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionStringLength.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionStringLength.cpp	2000/12/06 21:00:55	1.5
  +++ FunctionStringLength.cpp	2001/01/25 17:14:13	1.6
  @@ -101,9 +101,11 @@
   		// Get a cached string...
   		XPathExecutionContext::GetAndReleaseCachedString	theData(executionContext);
   
  -		DOMServices::getNodeData(*context, theData);
  +		XalanDOMString&		theString = theData.get();
   
  -		return executionContext.getXObjectFactory().createNumber(length(theData));
  +		DOMServices::getNodeData(*context, theString);
  +
  +		return executionContext.getXObjectFactory().createNumber(length(theString));
   	}
   }
   
  
  
  
  1.11      +4 -2      xml-xalan/c/src/XPath/FunctionSubstring.cpp
  
  Index: FunctionSubstring.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstring.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FunctionSubstring.cpp	2000/12/21 04:29:29	1.10
  +++ FunctionSubstring.cpp	2001/01/25 17:14:14	1.11
  @@ -254,10 +254,12 @@
   
   				XPathExecutionContext::GetAndReleaseCachedString	theResult(executionContext);
   
  +				XalanDOMString&		theString = theResult.get();
  +
   				assign(
  -						theResult,
  +						theString,
   						toCharArray(theSourceString) + theStartIndex,
  -						theSubstringLength );
  +						theSubstringLength);
   
   				return executionContext.getXObjectFactory().createString(theResult);
   			}
  
  
  
  1.10      +3 -1      xml-xalan/c/src/XPath/FunctionSubstringAfter.cpp
  
  Index: FunctionSubstringAfter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstringAfter.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FunctionSubstringAfter.cpp	2000/12/21 04:29:29	1.9
  +++ FunctionSubstringAfter.cpp	2001/01/25 17:14:15	1.10
  @@ -143,8 +143,10 @@
   
   			XPathExecutionContext::GetAndReleaseCachedString	theResult(executionContext);
   
  +			XalanDOMString&		theString = theResult.get();
  +
   			assign(
  -					theResult,
  +					theString,
   					theFirstCharacter,
   					theSubstringLength);
   
  
  
  
  1.10      +3 -1      xml-xalan/c/src/XPath/FunctionSubstringBefore.cpp
  
  Index: FunctionSubstringBefore.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstringBefore.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FunctionSubstringBefore.cpp	2000/12/21 04:29:29	1.9
  +++ FunctionSubstringBefore.cpp	2001/01/25 17:14:15	1.10
  @@ -131,8 +131,10 @@
   		{
   			XPathExecutionContext::GetAndReleaseCachedString	theResult(executionContext);
   
  +			XalanDOMString&		theString = theResult.get();
  +
   			assign(
  -					theResult,
  +					theString,
   					toCharArray(theFirstString),
   					theIndex);
   
  
  
  
  1.7       +5 -3      xml-xalan/c/src/XPath/FunctionSum.cpp
  
  Index: FunctionSum.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSum.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FunctionSum.cpp	2001/01/03 19:32:38	1.6
  +++ FunctionSum.cpp	2001/01/25 17:14:16	1.7
  @@ -106,13 +106,15 @@
   
   	XPathExecutionContext::GetAndReleaseCachedString	theData(executionContext);
   
  +	XalanDOMString&		theString = theData.get();
  +
   	for (unsigned int i = 0; i < count; i++)
   	{
  -		DOMServices::getNodeData(*nl.item(i), theData);
  +		DOMServices::getNodeData(*nl.item(i), theString);
   
  -		sum += DoubleSupport::toDouble(theData);
  +		sum += DoubleSupport::toDouble(theString);
   
  -		clear(theData);
  +		clear(theString);
   	}
   
   	return executionContext.getXObjectFactory().createNumber(sum);
  
  
  
  1.10      +6 -6      xml-xalan/c/src/XPath/FunctionTranslate.cpp
  
  Index: FunctionTranslate.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionTranslate.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FunctionTranslate.cpp	2000/12/21 04:29:29	1.9
  +++ FunctionTranslate.cpp	2001/01/25 17:14:16	1.10
  @@ -140,10 +140,12 @@
   	// A string to hold the result.
   	XPathExecutionContext::GetAndReleaseCachedString	theResult(executionContext);
   
  +	XalanDOMString&		theString = theResult.get();
  +
   	// The result string can only be as large as the first string, so
   	// just reserve the space now.  Also reserve space for the
   	// terminating 0.
  -	reserve(theResult, theFirstStringLength + 1);
  +	reserve(theString, theFirstStringLength + 1);
   
   	for (unsigned int i = 0; i < theFirstStringLength; i++)
   	{
  @@ -155,13 +157,13 @@
   		{
   			// Didn't find the character in the second string, so it
   			// is not translated.
  -			append(theResult, theCurrentChar);
  +			append(theString, theCurrentChar);
   		}
   		else if (theIndex < theThirdStringLength)
   		{
   			// OK, there's a corresponding character in the
   			// third string, so do the translation...
  -			append(theResult, charAt(theThirdString, theIndex));
  +			append(theString, charAt(theThirdString, theIndex));
   		}
   		else
   		{
  @@ -207,7 +209,5 @@
   const XalanDOMString
   FunctionTranslate::getError() const
   {
  -	return XALAN_STATIC_UCODE_STRING(
  -		"The translate() function takes three arguments!");
  +	return XALAN_STATIC_UCODE_STRING("The translate() function takes three arguments!");
   }
  -
  
  
  
  1.20      +13 -9     xml-xalan/c/src/XPath/XObject.cpp
  
  Index: XObject.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XObject.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XObject.cpp	2001/01/08 18:25:17	1.19
  +++ XObject.cpp	2001/01/25 17:14:17	1.20
  @@ -214,7 +214,9 @@
   	const XalanDOMString
   	operator()(const XalanNode&		theNode) const
   	{
  -		XPathExecutionContext::GetAndReleaseCachedString	theString(m_executionContext);
  +		XPathExecutionContext::GetAndReleaseCachedString	theGuard(m_executionContext);
  +
  +		XalanDOMString&		theString = theGuard.get();
   
   		getStringFromNode(theNode, theString);
   
  @@ -265,9 +267,9 @@
   	{
   		XPathExecutionContext::GetAndReleaseCachedString	theString(m_executionContext);
   
  -		getStringFromNode(theNode, theString);
  +		getStringFromNode(theNode, theString.get());
   
  -		return DoubleSupport::toDouble(theString);
  +		return DoubleSupport::toDouble(theString.get());
   	}
   
   	void
  @@ -323,24 +325,24 @@
   				const XalanNode* const	theLHSNode = theLHSNodeSet.item(i);
   				assert(theLHSNode != 0);
   
  -				theTypeFunction(*theLHSNode, s1);
  +				theTypeFunction(*theLHSNode, s1.get());
   
   				for(unsigned int k = 0; k < len2 && theResult == false; k++)
   				{
   					const XalanNode* const	theRHSNode = theRHSNodeSet.item(k);
   					assert(theRHSNode != 0);
   
  -					theTypeFunction(*theRHSNode, s2);
  +					theTypeFunction(*theRHSNode, s2.get());
   
  -					if(theCompareFunction(s1, s2) == true)
  +					if(theCompareFunction(s1.get(), s2.get()) == true)
   					{
   						theResult = true;
   					}
   
  -					clear(s2);
  +					clear(s2.get());
   				}
   
  -				clear(s1);
  +				clear(s1.get());
   			}
   		}
   	}
  @@ -362,8 +364,10 @@
   	bool				theResult = false;
   
   	const unsigned int	len1 = theLHSNodeSet.getLength();
  +
  +	XPathExecutionContext::GetAndReleaseCachedString	theGuard(executionContext);
   
  -	XPathExecutionContext::GetAndReleaseCachedString	theLHS(executionContext);
  +	XalanDOMString&		theLHS = theGuard.get();
   
   	for(unsigned int i = 0; i < len1 && theResult == false; i++)
   	{
  
  
  
  1.36      +0 -7      xml-xalan/c/src/XPath/XPathExecutionContext.hpp
  
  Index: XPathExecutionContext.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExecutionContext.hpp,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- XPathExecutionContext.hpp	2001/01/17 16:57:37	1.35
  +++ XPathExecutionContext.hpp	2001/01/25 17:14:18	1.36
  @@ -481,13 +481,6 @@
   			return *m_string;
   		}
   
  -		operator XalanDOMString& () const
  -		{
  -			assert(m_string != 0);
  -
  -			return *m_string;
  -		}
  -
   		XPathExecutionContext&
   		getExecutionContext() const
   		{
  
  
  
  1.22      +9 -1      xml-xalan/c/src/XPath/XPathExpression.cpp
  
  Index: XPathExpression.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExpression.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- XPathExpression.cpp	2001/01/16 02:34:46	1.21
  +++ XPathExpression.cpp	2001/01/25 17:14:19	1.22
  @@ -648,7 +648,15 @@
   	{
   		assert(getToken(i) != 0);
   
  -		thePrintWriter.print(" '");
  +		if (i > 0)
  +		{
  +			thePrintWriter.print(" '");
  +		}
  +		else
  +		{
  +			thePrintWriter.print("'");
  +		}
  +
   		thePrintWriter.print(getToken(i)->str());
   		thePrintWriter.print("'");
   	}
  
  
  
  1.13      +1 -1      xml-xalan/c/src/XPath/XPathFunctionTable.cpp
  
  Index: XPathFunctionTable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathFunctionTable.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XPathFunctionTable.cpp	2000/11/06 19:33:49	1.12
  +++ XPathFunctionTable.cpp	2001/01/25 17:14:20	1.13
  @@ -119,7 +119,7 @@
   	assert(length(theFunctionName) != 0);
   
   	// See if a function of that name is already installed...
  -	const FunctionNameIndexMapType::const_iterator	i =
  +	const FunctionNameIndexMapType::iterator	i =
   		m_FunctionNameIndex.find(theFunctionName);
   
   	if (i != m_FunctionNameIndex.end())
  
  
  
  1.30      +89 -36    xml-xalan/c/src/XPath/XPathProcessorImpl.cpp
  
  Index: XPathProcessorImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathProcessorImpl.cpp,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- XPathProcessorImpl.cpp	2001/01/18 18:50:59	1.29
  +++ XPathProcessorImpl.cpp	2001/01/25 17:14:21	1.30
  @@ -65,6 +65,7 @@
   #include <PlatformSupport/DOMStringHelper.hpp>
   #include <PlatformSupport/DOMStringPrintWriter.hpp>
   #include <PlatformSupport/DoubleSupport.hpp>
  +#include <PlatformSupport/XalanXMLChar.hpp>
   
   
   
  @@ -118,6 +119,11 @@
   
   	Expr();
   
  +	if (length(m_token) != 0)
  +	{
  +		error("Extra illegal tokens!");
  +	}
  +
   	m_xpath = 0;
   	m_expression = 0;
   	m_prefixResolver = 0;
  @@ -148,6 +154,11 @@
   
   	Pattern();
   
  +	if (length(m_token) != 0)
  +	{
  +		error("Extra illegal tokens!");
  +	}
  +
   	// Terminate for safety.
   	m_expression->appendOpCode(XPathExpression::eENDOP);
   
  @@ -175,7 +186,6 @@
   
   	bool		isStartOfPat = true;
   	bool		isAttrName = false;
  -	bool		isNum = false;
   
   	// Nesting of '[' so we can know if the given element should be 
   	// counted inside the m_patternMap.
  @@ -192,7 +202,6 @@
   			{
   				if(startSubstring != -1)
   				{
  -					isNum = false;
   					isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
   
   					isAttrName = false;
  @@ -227,7 +236,6 @@
   			{
   				if(startSubstring != -1)
   				{
  -					isNum = false;
   					isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
   					isAttrName = false;
   
  @@ -264,7 +272,6 @@
   			{
   				if(startSubstring != -1)
   				{
  -					isNum = false;
   					isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
   					isAttrName = false;
   
  @@ -290,12 +297,10 @@
   			{
   				if(XalanUnicode::charHyphenMinus == c)
   				{
  -					if(!(isNum || startSubstring == -1))
  +					if(!(startSubstring == -1))
   					{
   						break;
   					}
  -
  -					isNum = false;
   				}
   			}
   			// fall-through on purpose
  @@ -319,7 +324,6 @@
   			{
   				if(startSubstring != -1)
   				{
  -					isNum = false;
   					isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
   					isAttrName = false;
   
  @@ -382,7 +386,6 @@
   						}
   					}
   
  -					isNum = false;
   					isAttrName = false;
   					startSubstring = -1;
   					posOfNSSep = -1;
  @@ -404,11 +407,41 @@
   				{
   					startSubstring = i;
   
  -					isNum = isXMLDigit(c);
  -				}
  -				else if(isNum == true)
  -				{
  -					isNum = isXMLDigit(c);
  +					if (XalanXMLChar::isDigit(c) == true)
  +					{
  +						bool	gotFullStop = false;
  +
  +						while(i < nChars - 1)
  +						{
  +							++i;
  +
  +							const XalanDOMChar	currentChar = charAt(pat, i);
  +
  +							if (currentChar == XalanUnicode::charFullStop)
  +							{
  +								if (gotFullStop == false)
  +								{
  +									gotFullStop = true;
  +								}
  +								else
  +								{
  +									--i;
  +
  +									break;
  +								}
  +							}
  +							else if (XalanXMLChar::isDigit(currentChar) == false)
  +							{
  +								--i;
  +
  +								break;
  +							}
  +						}
  +
  +						addToTokenQueue(substring(pat, startSubstring, i + 1));
  +
  +						startSubstring = -1;
  +					}
   				}
   			}
   		}
  @@ -416,8 +449,6 @@
   
   	if(startSubstring != -1)
   	{
  -		isNum = false;
  -
   		isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
   
   		if(-1 != posOfNSSep)
  @@ -430,11 +461,11 @@
   		}
   	}
   
  -	if(0 == m_expression->tokenQueueSize())
  +	if (0 == m_expression->tokenQueueSize())
   	{
   		error("Empty expression!");
   	}
  -	else if(0 != targetStrings)
  +	else if (0 != targetStrings)
   	{
   		recordTokenString(*targetStrings);
   	}
  @@ -537,7 +568,6 @@
   
   
   
  -
   void
   XPathProcessorImpl::addToTokenQueue(const XalanDOMString&	s) const
   {
  @@ -756,7 +786,14 @@
   	const XObject* const	theNextToken =
   			m_expression->getNextToken();
   
  -	m_token = theNextToken == 0 ? XalanDOMString() : theNextToken->str();
  +	if (theNextToken == 0)
  +	{
  +		clear(m_token);
  +	}
  +	else
  +	{
  +		m_token = theNextToken->str();
  +	}
   
   	if(length(m_token) > 0)
   	{
  @@ -906,14 +943,21 @@
   
   		DOMStringPrintWriter	thePrintWriter(emsg);
   
  +		thePrintWriter.print(msg);
  +
  +		thePrintWriter.println();
  +
   		if (length(theCurrentPattern) != 0)
   		{
   			thePrintWriter.print(XALAN_STATIC_UCODE_STRING("pattern = '"));
  -			thePrintWriter.println(theCurrentPattern);
  +			thePrintWriter.print(theCurrentPattern);
  +			thePrintWriter.println("'");
   		}
   
  -		thePrintWriter.print(msg);
  +		// Back up one token, since we've consumed one...
  +		m_expression->getPreviousToken();
   
  +		// Ask the expression to dump the remaining tokens...
   		m_expression->dumpRemainingTokenQueue(thePrintWriter);
   	}
   
  @@ -1330,7 +1374,7 @@
   
   	bool		isNeg = false;
   
  -	if(m_tokenChar == XalanUnicode::charHyphenMinus)
  +	if(tokenIs(XalanUnicode::charHyphenMinus) == true)
   	{
   		nextToken();
   
  @@ -1528,7 +1572,8 @@
   
   	const int	opPos = m_expression->opCodeMapLength();
   
  -	if(m_tokenChar == XalanUnicode::charApostrophe || m_tokenChar == XalanUnicode::charQuoteMark)
  +	if(tokenIs(XalanUnicode::charApostrophe) == true ||
  +	   tokenIs(XalanUnicode::charQuoteMark) == true)
   	{
   		m_expression->appendOpCode(XPathExpression::eOP_LITERAL);
   
  @@ -1537,7 +1582,7 @@
   		m_expression->updateOpCodeLength(XPathExpression::eOP_LITERAL,
   										 opPos);
   	}
  -	else if(m_tokenChar == XalanUnicode::charDollarSign)
  +	else if(tokenIs(XalanUnicode::charDollarSign) == true)
   	{
   		nextToken(); // consume '$'
   
  @@ -1548,7 +1593,7 @@
   		m_expression->updateOpCodeLength(XPathExpression::eOP_VARIABLE,
   											 opPos);
   	}
  -	else if(m_tokenChar == XalanUnicode::charLeftParenthesis)
  +	else if(tokenIs(XalanUnicode::charLeftParenthesis) == true)
   	{
   		nextToken();
   
  @@ -1561,10 +1606,10 @@
   		m_expression->updateOpCodeLength(XPathExpression::eOP_GROUP,
   										 opPos);
   	}
  -	else if((XalanUnicode::charFullStop == m_tokenChar &&
  -				m_token.length() > 1 &&
  -				isXMLDigit(charAt(m_token, 1)) == true)
  -			 || isXMLDigit(m_tokenChar) == true)
  +	else if((tokenIs(XalanUnicode::charFullStop) == true &&
  +				length(m_token) > 1 &&
  +				XalanXMLChar::isDigit(charAt(m_token, 1)) == true) ||
  +				XalanXMLChar::isDigit(m_tokenChar) == true)
   	{
   		m_expression->appendOpCode(XPathExpression::eOP_NUMBERLIT);
   
  @@ -1610,7 +1655,7 @@
   
   	consumeExpected(XalanUnicode::charLeftParenthesis);
   
  -	while(tokenIs(XalanUnicode::charRightParenthesis) == false)
  +	while(tokenIs(XalanUnicode::charRightParenthesis) == false && isEmpty(m_token) == false)
   	{
   		if(tokenIs(XalanUnicode::charComma) == true)
   		{
  @@ -1623,7 +1668,6 @@
   
   		if(tokenIs(XalanUnicode::charRightParenthesis) == false)
   		{
  -
   			consumeExpected(XalanUnicode::charComma);
   
   			if(tokenIs(XalanUnicode::charRightParenthesis) == true)
  @@ -1804,6 +1848,9 @@
   								   theArgs);
   
   		m_expression->appendOpCode(XPathExpression::eNODETYPE_NODE);
  +
  +		// Tell how long the entire step is.
  +		m_expression->updateOpCodeLength(opPos);
   	}
   	else if(tokenIs(s_dotDotString) == true)
   	{
  @@ -1816,8 +1863,14 @@
   								   theArgs);
   
   		m_expression->appendOpCode(XPathExpression::eNODETYPE_NODE);
  +
  +		// Tell how long the entire step is.
  +		m_expression->updateOpCodeLength(opPos);
   	}
  -	else
  +	else if (tokenIs(XalanUnicode::charAsterisk) ||
  +			 tokenIs(XalanUnicode::charCommercialAt) ||
  +			 tokenIs(XalanUnicode::charSolidus) ||
  +			 XalanXMLChar::isLetter(charAt(m_token, 0)))
   	{
   		Basis();
   
  @@ -1825,10 +1878,10 @@
   		{
   			Predicate();
   		}
  -	}
   
  -	// Tell how long the entire step is.
  -	m_expression->updateOpCodeLength(opPos);
  +		// Tell how long the entire step is.
  +		m_expression->updateOpCodeLength(opPos);
  +	}
   }
   
   
  
  
  
  1.19      +1 -1      xml-xalan/c/src/XPath/XResultTreeFrag.hpp
  
  Index: XResultTreeFrag.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XResultTreeFrag.hpp,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- XResultTreeFrag.hpp	2001/01/16 02:32:39	1.18
  +++ XResultTreeFrag.hpp	2001/01/25 17:14:22	1.19
  @@ -68,7 +68,7 @@
   
   
   
  -#if defined(XALAN_AUTO_PTR_NEEDS_DEFINITION)
  +#if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
   #include <XPath/ResultTreeFragBase.hpp>
   #endif
   
  
  
  
  1.2       +1 -1      xml-xalan/c/src/XPath/XStringCached.cpp
  
  Index: XStringCached.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XStringCached.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XStringCached.cpp	2000/12/21 04:23:07	1.1
  +++ XStringCached.cpp	2001/01/25 17:14:23	1.2
  @@ -101,7 +101,7 @@
   const XalanDOMString&
   XStringCached::str() const
   {
  -	return m_value;
  +	return m_value.get();
   }