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/24 17:12:03 UTC

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

dbertoni    01/01/24 08:12:03

  Modified:    c/src/XPath XPath.cpp XPath.hpp
  Log:
  Added flag to indicate that the instance is embedded in a compiled stylesheet.
  
  Revision  Changes    Path
  1.41      +18 -3     xml-xalan/c/src/XPath/XPath.cpp
  
  Index: XPath.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPath.cpp,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- XPath.cpp	2001/01/16 02:34:46	1.40
  +++ XPath.cpp	2001/01/24 16:11:59	1.41
  @@ -87,7 +87,8 @@
   
   XPath::XPath(bool	createDefaultLocator) :
   	m_defaultXLocator(createDefaultLocator == false ? 0 : createXLocatorHandler()),
  -	m_expression()
  +	m_expression(),
  +	m_inStylesheet(false)
   {
   }
   
  @@ -1087,7 +1088,14 @@
   
   	const XToken&	theLiteral = m_expression.m_tokenQueue[m_expression.m_opMap[opPos + 2]];
   
  -	return executionContext.getXObjectFactory().createString(theLiteral);
  +	if (m_inStylesheet == true)
  +	{
  +		return executionContext.getXObjectFactory().createString(theLiteral);
  +	}
  +	else
  +	{
  +		return executionContext.getXObjectFactory().createString(theLiteral.str());
  +	}
   }
   
   
  @@ -1148,7 +1156,14 @@
   
   	const XToken&	theLiteral = m_expression.m_tokenQueue[m_expression.m_opMap[opPos + 2]];
   
  -	return executionContext.getXObjectFactory().createNumber(theLiteral);
  +	if (m_inStylesheet == true)
  +	{
  +		return executionContext.getXObjectFactory().createNumber(theLiteral);
  +	}
  +	else
  +	{
  +		return executionContext.getXObjectFactory().createNumber(theLiteral.num());
  +	}
   }
   
   
  
  
  
  1.20      +20 -0     xml-xalan/c/src/XPath/XPath.hpp
  
  Index: XPath.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPath.hpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XPath.hpp	2000/11/21 21:08:32	1.19
  +++ XPath.hpp	2001/01/24 16:12:00	1.20
  @@ -423,6 +423,19 @@
   	{
   		s_functions.DestroyTable();
   	}
  +
  +	bool
  +	getInStylesheet() const
  +	{
  +		return m_inStylesheet;
  +	}
  +
  +	void
  +	setInStylesheet(bool	fValue)
  +	{
  +		m_inStylesheet = fValue;
  +	}
  +
   protected:
   
   	/**
  @@ -847,6 +860,13 @@
   	 *
   	 */
   	XPathExpression						m_expression;
  +
  +	/**
  +	 * If true, the XPath can allocated XObjects in more
  +	 * efficient ways, since its lifetime is guaranteed
  +	 * to be at least that of the transform.
  +	 */
  +	bool								m_inStylesheet;
   
   	/**
   	 *