You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by au...@locus.apache.org on 2000/11/07 16:12:20 UTC

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

auriemma    00/11/07 07:12:17

  Modified:    c/src/XPath FunctionNamespaceURI.cpp
                        FunctionNamespaceURI.hpp
  Log:
  Merged string class changes from hpp to cpp.
  
  Revision  Changes    Path
  1.2       +15 -12    xml-xalan/c/src/XPath/FunctionNamespaceURI.cpp
  
  Index: FunctionNamespaceURI.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNamespaceURI.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FunctionNamespaceURI.cpp	2000/11/06 19:49:15	1.1
  +++ FunctionNamespaceURI.cpp	2000/11/07 15:11:53	1.2
  @@ -78,11 +78,11 @@
   {
   	assert(arg1 != 0);
   	
  -	XalanDOMString	theNamespace;
  +	const XalanDOMString*	theNamespace = 0;
   
   	theNamespace = getNamespaceFromNodeSet(*arg1, executionContext);
   
  -	return executionContext.getXObjectFactory().createString(theNamespace);
  +	return executionContext.getXObjectFactory().createString(theNamespace == 0 ? XalanDOMString() : *theNamespace);
   }
   
   
  @@ -91,8 +91,8 @@
   FunctionNamespaceURI::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
  -{
  -	XalanDOMString	theNamespace;
  +{	
  +	const XalanDOMString*	theNamespace = 0;
   
   	if (context == 0)
   	{
  @@ -117,25 +117,28 @@
   		theNamespace = getNamespaceFromNodeSet(*theXObject.get(), executionContext);
   	}
   
  -	return executionContext.getXObjectFactory().createString(theNamespace);
  +	return executionContext.getXObjectFactory().createString(theNamespace == 0 ? XalanDOMString() : *theNamespace);
   }
   
   
   
  -XalanDOMString
  -FunctionNamespaceURI::getNamespaceFromNodeSet(const XObject&			theXObject,
  +const XalanDOMString*
  +FunctionNamespaceURI::getNamespaceFromNodeSet(
  +						const XObject&			theXObject,
   						XPathExecutionContext&	theContext)
   {
  -	XalanDOMString	theNamespace;
  -
   	const NodeRefListBase&	theList = theXObject.nodeset();
   
  -	if (theList.getLength() > 0)
  +	if (theList.getLength() == 0)
   	{
  -		theNamespace = theContext.getNamespaceOfNode(*theList.item(0));
  +		return 0;
   	}
  +	else
  +	{
  +		assert(theList.item(0) != 0);
   
  -	return theNamespace;
  +		return &theContext.getNamespaceOfNode(*theList.item(0));
  +	}
   }
   
   
  
  
  
  1.9       +1 -1      xml-xalan/c/src/XPath/FunctionNamespaceURI.hpp
  
  Index: FunctionNamespaceURI.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNamespaceURI.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionNamespaceURI.hpp	2000/11/06 19:27:58	1.8
  +++ FunctionNamespaceURI.hpp	2000/11/07 15:12:02	1.9
  @@ -106,7 +106,7 @@
   
   private:
   
  -	static XalanDOMString
  +	static const XalanDOMString*
   	getNamespaceFromNodeSet(const XObject&			theXObject,
   							XPathExecutionContext&	theContext);