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/05/15 17:54:36 UTC

cvs commit: xml-xalan/c/src/XPath SimpleNodeLocator.cpp XPathEnvSupport.hpp XPathEnvSupportDefault.cpp XPathEnvSupportDefault.hpp XPathExecutionContext.hpp XPathExecutionContextDefault.cpp XPathExecutionContextDefault.hpp XPathSupportDefault.cpp XPathSupportDefault.hpp

dbertoni    00/05/15 08:54:36

  Modified:    c/src/XPath SimpleNodeLocator.cpp XPathEnvSupport.hpp
                        XPathEnvSupportDefault.cpp
                        XPathEnvSupportDefault.hpp
                        XPathExecutionContext.hpp
                        XPathExecutionContextDefault.cpp
                        XPathExecutionContextDefault.hpp
                        XPathSupportDefault.cpp XPathSupportDefault.hpp
  Log:
  Fixed bugs in source node stripping.
  
  Revision  Changes    Path
  1.11      +1 -1      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SimpleNodeLocator.cpp	2000/05/05 15:12:17	1.10
  +++ SimpleNodeLocator.cpp	2000/05/15 15:54:30	1.11
  @@ -1522,7 +1522,7 @@
   					else
   					{
   						test = XPathExpression::eELEMWILDCARD == queueIndex || 
  -						   0 == length(contextNS) || 0 == length(contextNS);
  +						   (0 == length(contextNS) && 0 == length(targetNS));
   					}
   				}
   				else
  
  
  
  1.8       +4 -1      xml-xalan/c/src/XPath/XPathEnvSupport.hpp
  
  Index: XPathEnvSupport.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathEnvSupport.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XPathEnvSupport.hpp	2000/05/01 15:11:42	1.7
  +++ XPathEnvSupport.hpp	2000/05/15 15:54:30	1.8
  @@ -264,11 +264,14 @@
   	 * node.  Literal elements from template elements should <em>not</em> be
   	 * tested with this function.
   	 *
  +	 * @param executionContext  current execution context
   	 * @param node text node from the source tree
   	 * @return true if the text node should be stripped of extra whitespace
   	 */
   	virtual bool
  -	shouldStripSourceNode(const XalanNode&	node) const = 0;
  +	shouldStripSourceNode(
  +			XPathExecutionContext&	executionContext,
  +			const XalanNode&		node) const = 0;
   
   	enum eSource { eXMLParser		= 1,
   				   eXSLTProcessor	= 2,
  
  
  
  1.10      +3 -1      xml-xalan/c/src/XPath/XPathEnvSupportDefault.cpp
  
  Index: XPathEnvSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathEnvSupportDefault.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XPathEnvSupportDefault.cpp	2000/05/01 16:03:42	1.9
  +++ XPathEnvSupportDefault.cpp	2000/05/15 15:54:30	1.10
  @@ -457,7 +457,9 @@
   
   
   bool
  -XPathEnvSupportDefault::shouldStripSourceNode(const XalanNode&	/* node */) const
  +XPathEnvSupportDefault::shouldStripSourceNode(
  +			XPathExecutionContext&	/* executionContext */,
  +			const XalanNode&		/* node */) const
   {
   	return false;
   }
  
  
  
  1.9       +3 -1      xml-xalan/c/src/XPath/XPathEnvSupportDefault.hpp
  
  Index: XPathEnvSupportDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathEnvSupportDefault.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XPathEnvSupportDefault.hpp	2000/05/01 15:11:42	1.8
  +++ XPathEnvSupportDefault.hpp	2000/05/15 15:54:30	1.9
  @@ -204,7 +204,9 @@
   			XLocator*			xlocator);
   
   	virtual bool
  -	shouldStripSourceNode(const XalanNode&	node) const;
  +	shouldStripSourceNode(
  +			XPathExecutionContext&	executionContext,
  +			const XalanNode&		node) const;
   
   	virtual bool
   	problem(
  
  
  
  1.12      +1 -1      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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XPathExecutionContext.hpp	2000/05/08 17:24:46	1.11
  +++ XPathExecutionContext.hpp	2000/05/15 15:54:30	1.12
  @@ -521,7 +521,7 @@
   	 * @return true if the text node should be stripped of extra whitespace
   	 */
   	virtual bool
  -	shouldStripSourceNode(const XalanNode&	node) const = 0;
  +	shouldStripSourceNode(const XalanNode&	node) = 0;
   
   	/**
   	 * Tells if FoundIndex should be thrown if index is found. This is an
  
  
  
  1.8       +2 -2      xml-xalan/c/src/XPath/XPathExecutionContextDefault.cpp
  
  Index: XPathExecutionContextDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExecutionContextDefault.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XPathExecutionContextDefault.cpp	2000/05/08 17:24:47	1.7
  +++ XPathExecutionContextDefault.cpp	2000/05/15 15:54:31	1.8
  @@ -404,9 +404,9 @@
   
   
   bool
  -XPathExecutionContextDefault::shouldStripSourceNode(const XalanNode&	node) const
  +XPathExecutionContextDefault::shouldStripSourceNode(const XalanNode&	node)
   {
  -	return m_xpathEnvSupport.shouldStripSourceNode(node);
  +	return m_xpathEnvSupport.shouldStripSourceNode(*this, node);
   }
   
   
  
  
  
  1.10      +1 -1      xml-xalan/c/src/XPath/XPathExecutionContextDefault.hpp
  
  Index: XPathExecutionContextDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExecutionContextDefault.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XPathExecutionContextDefault.hpp	2000/05/08 17:24:47	1.9
  +++ XPathExecutionContextDefault.hpp	2000/05/15 15:54:31	1.10
  @@ -240,7 +240,7 @@
   			const XalanDocument&		theDocument) const;
   
   	virtual bool
  -	shouldStripSourceNode(const XalanNode&	node) const;
  +	shouldStripSourceNode(const XalanNode&	node);
   
   	virtual bool
   	getThrowFoundIndex() const;
  
  
  
  1.8       +5 -3      xml-xalan/c/src/XPath/XPathSupportDefault.cpp
  
  Index: XPathSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathSupportDefault.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XPathSupportDefault.cpp	2000/05/03 21:57:35	1.7
  +++ XPathSupportDefault.cpp	2000/05/15 15:54:31	1.8
  @@ -81,7 +81,8 @@
   XPathSupportDefault::XPathSupportDefault(DOMSupport&	theDOMSupport) :
   	XPathSupport(),
   	m_DOMSupport(theDOMSupport),
  -	m_whitespaceSupport()
  +	m_whitespaceSupport(),
  +	m_processNamespaces(true)
   {
   }
   
  @@ -173,8 +174,9 @@
   
   
   void
  -XPathSupportDefault::setProcessNamespaces(bool	/* processNamespaces */)
  +XPathSupportDefault::setProcessNamespaces(bool	processNamespaces)
   {
  +	m_processNamespaces = processNamespaces;
   }
   
   
  @@ -182,7 +184,7 @@
   bool
   XPathSupportDefault::getProcessNamespaces() const
   {
  -	return false;
  +	return m_processNamespaces;
   }
   
   
  
  
  
  1.6       +2 -0      xml-xalan/c/src/XPath/XPathSupportDefault.hpp
  
  Index: XPathSupportDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathSupportDefault.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XPathSupportDefault.hpp	2000/04/11 14:46:22	1.5
  +++ XPathSupportDefault.hpp	2000/05/15 15:54:31	1.6
  @@ -148,6 +148,8 @@
   	DOMSupport&								m_DOMSupport;
   
   	DOMServices::WhitespaceSupportDefault	m_whitespaceSupport;
  +
  +	bool									m_processNamespaces;
   };