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/21 22:11:16 UTC

cvs commit: xml-xalan/c/src/XSLT AVTPartXPath.cpp ElemChoose.cpp ElemCopyOf.cpp ElemIf.cpp ElemNumber.cpp ElemParam.cpp ElemTemplateElement.cpp ElemValueOf.cpp ElemValueOf.hpp ElemVariable.hpp ExtensionFunctionHandler.cpp ExtensionFunctionHandler.hpp ExtensionNSHandler.cpp FunctionCurrent.cpp FunctionCurrent.hpp FunctionDocument.cpp FunctionDocument.hpp FunctionElementAvailable.cpp FunctionElementAvailable.hpp FunctionFormatNumber.cpp FunctionFormatNumber.hpp FunctionFunctionAvailable.cpp FunctionFunctionAvailable.hpp FunctionGenerateID.cpp FunctionGenerateID.hpp FunctionKey.cpp FunctionKey.hpp FunctionSystemProperty.cpp FunctionSystemProperty.hpp FunctionUnparsedEntityURI.cpp FunctionUnparsedEntityURI.hpp KeyTable.cpp NodeSorter.cpp SelectionEvent.cpp SelectionEvent.hpp Stylesheet.cpp StylesheetExecutionContext.hpp StylesheetExecutionContextDefault.cpp StylesheetExecutionContextDefault.hpp TopLevelArg.cpp TopLevelArg.hpp VariablesStack.cpp VariablesStack.hpp XSLTEngineImpl.cpp XSLTEngineImpl.hpp XSLTProcessor.hpp XSLTProcessorEnvSupport.hpp XSLTProcessorEnvSupportDefault.cpp XSLTProcessorEnvSupportDefault.hpp

auriemma    00/11/21 13:11:14

  Modified:    c/src/TestXPath TestXPath.cpp
               c/src/XPath Function.cpp Function.hpp FunctionBoolean.cpp
                        FunctionBoolean.hpp FunctionCeiling.cpp
                        FunctionCeiling.hpp FunctionConcat.cpp
                        FunctionConcat.hpp FunctionContains.cpp
                        FunctionContains.hpp FunctionCount.cpp
                        FunctionCount.hpp FunctionDoc.hpp FunctionFalse.cpp
                        FunctionFalse.hpp FunctionFloor.cpp
                        FunctionFloor.hpp FunctionID.cpp FunctionID.hpp
                        FunctionLang.cpp FunctionLang.hpp FunctionLast.cpp
                        FunctionLast.hpp FunctionLocalName.cpp
                        FunctionLocalName.hpp FunctionName.cpp
                        FunctionName.hpp FunctionNamespaceURI.cpp
                        FunctionNamespaceURI.hpp FunctionNormalizeSpace.cpp
                        FunctionNormalizeSpace.hpp FunctionNot.cpp
                        FunctionNot.hpp FunctionNumber.cpp
                        FunctionNumber.hpp FunctionPosition.cpp
                        FunctionPosition.hpp FunctionRound.cpp
                        FunctionRound.hpp FunctionStartsWith.cpp
                        FunctionStartsWith.hpp FunctionString.cpp
                        FunctionString.hpp FunctionStringLength.cpp
                        FunctionStringLength.hpp FunctionSubstring.cpp
                        FunctionSubstring.hpp FunctionSubstringAfter.cpp
                        FunctionSubstringAfter.hpp
                        FunctionSubstringBefore.cpp
                        FunctionSubstringBefore.hpp FunctionSum.cpp
                        FunctionSum.hpp FunctionTranslate.cpp
                        FunctionTranslate.hpp FunctionTrue.cpp
                        FunctionTrue.hpp SimpleNodeLocator.cpp
                        SimpleNodeLocator.hpp XLocator.hpp XObject.cpp
                        XObject.hpp XObjectFactory.hpp
                        XObjectFactoryDefault.cpp XObjectFactoryDefault.hpp
                        XPath.cpp XPath.hpp XPathEnvSupport.hpp
                        XPathEnvSupportDefault.cpp
                        XPathEnvSupportDefault.hpp
                        XPathExecutionContext.hpp
                        XPathExecutionContextDefault.cpp
                        XPathExecutionContextDefault.hpp
                        XPathExpression.cpp XPathExpression.hpp
                        XPathProcessorImpl.cpp
               c/src/XSLT AVTPartXPath.cpp ElemChoose.cpp ElemCopyOf.cpp
                        ElemIf.cpp ElemNumber.cpp ElemParam.cpp
                        ElemTemplateElement.cpp ElemValueOf.cpp
                        ElemValueOf.hpp ElemVariable.hpp
                        ExtensionFunctionHandler.cpp
                        ExtensionFunctionHandler.hpp ExtensionNSHandler.cpp
                        FunctionCurrent.cpp FunctionCurrent.hpp
                        FunctionDocument.cpp FunctionDocument.hpp
                        FunctionElementAvailable.cpp
                        FunctionElementAvailable.hpp
                        FunctionFormatNumber.cpp FunctionFormatNumber.hpp
                        FunctionFunctionAvailable.cpp
                        FunctionFunctionAvailable.hpp
                        FunctionGenerateID.cpp FunctionGenerateID.hpp
                        FunctionKey.cpp FunctionKey.hpp
                        FunctionSystemProperty.cpp
                        FunctionSystemProperty.hpp
                        FunctionUnparsedEntityURI.cpp
                        FunctionUnparsedEntityURI.hpp KeyTable.cpp
                        NodeSorter.cpp SelectionEvent.cpp
                        SelectionEvent.hpp Stylesheet.cpp
                        StylesheetExecutionContext.hpp
                        StylesheetExecutionContextDefault.cpp
                        StylesheetExecutionContextDefault.hpp
                        TopLevelArg.cpp TopLevelArg.hpp VariablesStack.cpp
                        VariablesStack.hpp XSLTEngineImpl.cpp
                        XSLTEngineImpl.hpp XSLTProcessor.hpp
                        XSLTProcessorEnvSupport.hpp
                        XSLTProcessorEnvSupportDefault.cpp
                        XSLTProcessorEnvSupportDefault.hpp
  Added:       c/src/PlatformSupport XalanReferenceCountedObject.cpp
                        XalanReferenceCountedObject.hpp
  Log:
  New reference-counted XObject implementation!
  
  Revision  Changes    Path
  1.1                  xml-xalan/c/src/PlatformSupport/XalanReferenceCountedObject.cpp
  
  Index: XalanReferenceCountedObject.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Xalan" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation and was
   * originally based on software copyright (c) 1999, International
   * Business Machines, Inc., http://www.ibm.com.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  // Class heaer file...
  #include "XalanReferenceCountedObject.hpp"
  
  
  
  XalanReferenceCountedObject::XalanReferenceCountedObject() :
  	m_referenceCount(0)
  {
  }
  
  
  
  XalanReferenceCountedObject::~XalanReferenceCountedObject()
  {
  }	
  
  
  
  void
  XalanReferenceCountedObject::addReference(XalanReferenceCountedObject*		theInstance)
  {
  	if (theInstance != 0)
  	{
  		if (++theInstance->m_referenceCount == 1)
  		{
  			theInstance->referenced();
  		}
  	}
  }
  
  
  
  void
  XalanReferenceCountedObject::removeReference(XalanReferenceCountedObject*	theInstance)
  {
  	if (theInstance != 0)
  	{
  		if (--theInstance->m_referenceCount == 0)
  		{
  			theInstance->dereferenced();
  		}
  	}
  }
  
  
  
  1.1                  xml-xalan/c/src/PlatformSupport/XalanReferenceCountedObject.hpp
  
  Index: XalanReferenceCountedObject.hpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Xalan" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation and was
   * originally based on software copyright (c) 1999, International
   * Business Machines, Inc., http://www.ibm.com.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  #if !defined(XALANREFERENCECOUNTEDOBJECT_HEADER_GUARD_1357924680)
  #define XALANREFERENCECOUNTEDOBJECT_HEADER_GUARD_1357924680
  
  
  
  // Base include file.  Must be first.
  #include <PlatformSupport/PlatformSupportDefinitions.hpp>
  
  
  
  /**
   * Class to hold reference count information.
   */
  class XALAN_PLATFORMSUPPORT_EXPORT XalanReferenceCountedObject
  {
  public:
  
  	/**
  	 * Increment reference count.	 
  	 */
  	static void
  	addReference(XalanReferenceCountedObject*	theInstance);
  
  	/**
  	 * Decrement reference count.	 
  	 */
  	static void
  	removeReference(XalanReferenceCountedObject*	theInstance);
  
  protected:
  
  	/**
  	 * Create a XalanReferenceCountedObject.
  	 */
  	explicit
  	XalanReferenceCountedObject();
  
  	virtual
  	~XalanReferenceCountedObject();
  
  	virtual void 
  	referenced() = 0;
  
  	virtual void 
  	dereferenced() = 0;
  
  private:
  
  	int		m_referenceCount;
  
  	// Not implemented...
  	XalanReferenceCountedObject&
  	operator=(const XalanReferenceCountedObject&);
  
  	XalanReferenceCountedObject(const XalanReferenceCountedObject&);
  };
  
  
  
  #endif	// XALANREFERENCECOUNTEDOBJECT_HEADER_GUARD_1357924680
  
  
  
  1.23      +13 -13    xml-xalan/c/src/TestXPath/TestXPath.cpp
  
  Index: TestXPath.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/TestXPath/TestXPath.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- TestXPath.cpp	2000/11/20 19:56:34	1.22
  +++ TestXPath.cpp	2000/11/21 21:07:46	1.23
  @@ -120,7 +120,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   ExecuteXPath(
   			XPathProcessor&			theXPathProcessor,
   			XPath&					theXPath,
  @@ -136,7 +136,7 @@
   								thePrefixResolver,
   								theXPathEnvSupport);
   
  -	const XObject* const	theResult =
  +	const XObjectPtr theResult =
   		theXPath.execute(theContextNode, thePrefixResolver, theContextNodeList, theExecutionContext);
   
   	return theResult;
  @@ -159,7 +159,7 @@
   {
   	bool	fError = false;
   
  -	const XObject* const	theResult =
  +	const XObjectPtr theResult =
   		ExecuteXPath(theXPathProcessor,
   					 theXPath,
   					 theXPathString,
  @@ -209,7 +209,7 @@
   {
   	bool	fError = false;
   
  -	const XObject* const	theResult =
  +	const XObjectPtr theResult =
   		ExecuteXPath(theXPathProcessor,
   					 theXPath,
   					 theXPathString,
  @@ -262,7 +262,7 @@
   {
   	bool	fError = false;
   
  -	const XObject* const	theResult =
  +	const XObjectPtr theResult =
   		ExecuteXPath(theXPathProcessor,
   					 theXPath,
   					 theXPathString,
  @@ -446,7 +446,7 @@
   	ElementPrefixResolverProxy	thePrefixResolver(theNamespaceContext, theXPathEnvSupport, theXPathSupport);
   	NodeRefList					theContextNodeList;
   
  -	const XObject* const	theXObject =
  +	const XObjectPtr theXObject =
   		ExecuteXPath(theXPathProcessor,
   					 *theXPath,
   					 theContextNodeMatchPattern,
  @@ -458,7 +458,7 @@
   
   	try
   	{
  -		assert(theXObject != 0);
  +		assert(theXObject.null == false);
   
   		const NodeRefListBase&	theResultList =
   						theXObject->nodeset();
  @@ -560,12 +560,12 @@
   					thePrintWriter.println();
   				}
   
  -				const XObject* const	theResult =
  +				const XObjectPtr theResult =
   					theXPath->execute(theContextNode, thePrefixResolver, theContextNodeList, theExecutionContext);
   
   				try
   				{
  -					assert(theResult != 0);
  +					assert(theResult.null == false);
   
   					const NodeRefListBase&	theResultList =
   						theResult->nodeset();
  @@ -693,12 +693,12 @@
   						continue;
   					}
   
  -					const XObject* const	theResult1 =
  +					const XObjectPtr theResult1 =
   							theXPath1->execute(theExecutionContext);
   
   					try
   					{
  -						assert(theResult1 != 0);
  +						assert(theResult1.null() == false);
   
   						const NodeRefListBase&	theResultList =
   								theResult1->nodeset();
  @@ -726,12 +726,12 @@
   						thePrintWriter.println(XALAN_STATIC_UCODE_STRING(" failed!"));
   					}
   
  -					const XObject* const	theResult2 =
  +					const XObjectPtr 	theResult2 =
   							theXPath2->execute(theExecutionContext);
   
   					try
   					{
  -						assert(theResult2 != 0);
  +						assert(theResult2.null() == false);
   
   						const NodeRefListBase&	theResultList =
   								theResult2->nodeset();
  
  
  
  1.2       +19 -18    xml-xalan/c/src/XPath/Function.cpp
  
  Index: Function.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/Function.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Function.cpp	2000/11/20 19:59:04	1.1
  +++ Function.cpp	2000/11/21 21:07:49	1.2
  @@ -72,7 +72,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   Function::execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,
  @@ -81,62 +81,63 @@
   {
   	executionContext.error(getError(), context);
   
  -	return 0;
  +	return XObjectPtr(0);
   }
   
   
   
  -XObject*
  +XObjectPtr
   Function::execute(
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context)
   {
   	executionContext.error(getError(), context);
   
  -	return 0;
  +	return XObjectPtr(0);
   }
   
   
   
  -XObject*
  +XObjectPtr
   Function::execute(
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context,			
  -			const XObject*			/* arg1 */)
  +			const XObjectPtr		/* arg1 */)
   {
   	executionContext.error(getError(), context);
   
  -	return 0;
  +	return XObjectPtr(0);
   }
   
   
   
  -XObject*
  +XObjectPtr
   Function::execute(
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context,			
  -			const XObject*			/* arg1 */,
  -			const XObject*			/* arg2 */)
  +			const XObjectPtr		/* arg1 */,
  +			const XObjectPtr		/* arg2 */)
   {
  -		executionContext.error(getError(), context);
  +	executionContext.error(getError(), context);
   
  -		return 0;
  +	return XObjectPtr(0);
   }
   
   
   
  -XObject*
  +XObjectPtr
   Function::execute(
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context,			
  -			const XObject*			/* arg1 */,
  -			const XObject*			/* arg2 */,
  -			const XObject*			/* arg3 */)
  +			const XObjectPtr		/* arg1 */,
  +			const XObjectPtr		/* arg2 */,
  +			const XObjectPtr		/* arg3 */)
   {
  -		executionContext.error(getError(), context);
  +	executionContext.error(getError(), context);
   
  -		return 0;
  +	return XObjectPtr(0);
   }
  +
   
   
   const XalanDOMString
  
  
  
  1.9       +13 -11    xml-xalan/c/src/XPath/Function.hpp
  
  Index: Function.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/Function.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Function.hpp	2000/11/20 19:59:20	1.8
  +++ Function.hpp	2000/11/21 21:07:50	1.9
  @@ -107,7 +107,7 @@
   	 * @param args             vector of pointers to XObject arguments
   	 * @return                 pointer to the result XObject
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,
  @@ -122,7 +122,7 @@
   	 * @param context          current context node	 
   	 * @return                 pointer to the result XObject
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context);
  @@ -136,11 +136,12 @@
   	 * @param arg              pointer to XObject argument
   	 * @return                 pointer to the result XObject
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
  +
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context,
  -			const XObject*			arg);
  +			const XObjectPtr		arg);
   
   	/**
   	 * Execute an XPath function object.  The function must return a valid
  @@ -152,12 +153,13 @@
   	 * @param arg2             pointer to XObject argument
   	 * @return                 pointer to the result XObject
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
  +
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context,			
  -			const XObject*			arg1,
  -			const XObject*			arg2);
  +			const XObjectPtr		arg1,
  +			const XObjectPtr		arg2);
   
   	/**
   	 * Execute an XPath function object.  The function must return a valid
  @@ -170,13 +172,13 @@
   	 * @param arg3             pointer to XObject argument
   	 * @return                 pointer to the result XObject
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context,			
  -			const XObject*			arg1,
  -			const XObject*			arg2,
  -			const XObject*			arg3);
  +			const XObjectPtr		arg1,
  +			const XObjectPtr		arg2,
  +			const XObjectPtr		arg3);
   
   	/**
   	 * Create a copy of the function object.
  
  
  
  1.3       +3 -3      xml-xalan/c/src/XPath/FunctionBoolean.cpp
  
  Index: FunctionBoolean.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionBoolean.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionBoolean.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionBoolean.cpp	2000/11/21 21:07:50	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionBoolean::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);
   
   	return executionContext.getXObjectFactory().createBoolean(arg1->boolean());	
   }
  
  
  
  1.6       +2 -2      xml-xalan/c/src/XPath/FunctionBoolean.hpp
  
  Index: FunctionBoolean.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionBoolean.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionBoolean.hpp	2000/11/06 19:33:06	1.5
  +++ FunctionBoolean.hpp	2000/11/21 21:07:51	1.6
  @@ -83,11 +83,11 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.3       +3 -3      xml-xalan/c/src/XPath/FunctionCeiling.cpp
  
  Index: FunctionCeiling.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionCeiling.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionCeiling.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionCeiling.cpp	2000/11/21 21:07:52	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionCeiling::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);
   
   	return executionContext.getXObjectFactory().createNumber(ceil(arg1->num()));
   }
  
  
  
  1.6       +2 -2      xml-xalan/c/src/XPath/FunctionCeiling.hpp
  
  Index: FunctionCeiling.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionCeiling.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionCeiling.hpp	2000/11/06 19:33:07	1.5
  +++ FunctionCeiling.hpp	2000/11/21 21:07:52	1.6
  @@ -87,11 +87,11 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.5       +13 -13    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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionConcat.cpp	2000/11/20 20:04:29	1.4
  +++ FunctionConcat.cpp	2000/11/21 21:07:53	1.5
  @@ -70,15 +70,15 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionConcat::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1,
  -		const XObject*					arg2)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2)
   {
  -	assert(arg1 != 0 && arg2 != 0);	
  -	
  +	assert(arg1.null() == false && arg2.null() == false);	
  +
   	XalanDOMString	theResult;
   
   	const XalanDOMString&	theArg1 = arg1->str();
  @@ -94,16 +94,16 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionConcat::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1,
  -		const XObject*					arg2,
  -		const XObject*					arg3)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2,
  +		const XObjectPtr				arg3)
   {
  -	assert(arg1 != 0 && arg2 != 0 && arg3 != 0);	
  -	
  +	assert(arg1.null() == false && arg2.null() == false && arg3.null() == false);	
  +
   	XalanDOMString	theResult;
   
   	const XalanDOMString&	theArg1 = arg1->str();
  @@ -121,7 +121,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionConcat::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,
  @@ -137,7 +137,7 @@
   
   		for(; i != theEnd; ++i)
   		{
  -			assert(*i != 0);
  +			assert((*i).null() == false);
   
   			theCombinedLength += length((*i)->str());
   		}
  
  
  
  1.7       +8 -8      xml-xalan/c/src/XPath/FunctionConcat.hpp
  
  Index: FunctionConcat.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionConcat.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FunctionConcat.hpp	2000/11/06 19:27:48	1.6
  +++ FunctionConcat.hpp	2000/11/21 21:07:53	1.7
  @@ -83,22 +83,22 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						/* context */,			
  -			const XObject*					arg1,
  -			const XObject*					arg2);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2);
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						/* context */,			
  -			const XObject*					arg1,
  -			const XObject*					arg2,
  -			const XObject*					arg3);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2,
  +			const XObjectPtr				arg3);
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,
  
  
  
  1.3       +4 -4      xml-xalan/c/src/XPath/FunctionContains.cpp
  
  Index: FunctionContains.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionContains.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionContains.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionContains.cpp	2000/11/21 21:07:54	1.3
  @@ -70,14 +70,14 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionContains::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1,
  -		const XObject*					arg2)
  +		const XObjectPtr					arg1,
  +		const XObjectPtr					arg2)
   {
  -	assert(arg1 != 0 || arg2 != 0);
  +	assert(arg1.null() == false && arg2.null() == false);	
   
   	const XalanDOMString&	str1 = arg1->str();
   	const XalanDOMString&	str2 = arg2->str();
  
  
  
  1.9       +3 -3      xml-xalan/c/src/XPath/FunctionContains.hpp
  
  Index: FunctionContains.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionContains.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionContains.hpp	2000/11/06 19:33:09	1.8
  +++ FunctionContains.hpp	2000/11/21 21:07:55	1.9
  @@ -83,12 +83,12 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1,
  -			const XObject*					arg2);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.3       +3 -3      xml-xalan/c/src/XPath/FunctionCount.cpp
  
  Index: FunctionCount.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionCount.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionCount.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionCount.cpp	2000/11/21 21:07:55	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionCount::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr					arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);
   
   	const NodeRefListBase&	theNodeList = arg1->nodeset();
   
  
  
  
  1.6       +2 -2      xml-xalan/c/src/XPath/FunctionCount.hpp
  
  Index: FunctionCount.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionCount.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionCount.hpp	2000/11/06 19:33:12	1.5
  +++ FunctionCount.hpp	2000/11/21 21:07:55	1.6
  @@ -83,11 +83,11 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.6       +1 -1      xml-xalan/c/src/XPath/Attic/FunctionDoc.hpp
  
  
  
  
  1.3       +1 -1      xml-xalan/c/src/XPath/FunctionFalse.cpp
  
  Index: FunctionFalse.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionFalse.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionFalse.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionFalse.cpp	2000/11/21 21:07:57	1.3
  @@ -70,7 +70,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionFalse::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */)
  
  
  
  1.6       +1 -1      xml-xalan/c/src/XPath/FunctionFalse.hpp
  
  Index: FunctionFalse.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionFalse.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionFalse.hpp	2000/11/06 19:33:16	1.5
  +++ FunctionFalse.hpp	2000/11/21 21:07:57	1.6
  @@ -83,7 +83,7 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);
  
  
  
  1.3       +4 -4      xml-xalan/c/src/XPath/FunctionFloor.cpp
  
  Index: FunctionFloor.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionFloor.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionFloor.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionFloor.cpp	2000/11/21 21:07:58	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionFloor::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  -{
  -	assert(arg1 != 0);
  +		const XObjectPtr				arg1)
  +{	
  +	assert(arg1.null() == false);	
   
   	return executionContext.getXObjectFactory().createNumber(floor(arg1->num()));
   }
  
  
  
  1.6       +2 -2      xml-xalan/c/src/XPath/FunctionFloor.hpp
  
  Index: FunctionFloor.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionFloor.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionFloor.hpp	2000/11/06 19:33:18	1.5
  +++ FunctionFloor.hpp	2000/11/21 21:07:58	1.6
  @@ -87,11 +87,11 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.3       +3 -3      xml-xalan/c/src/XPath/FunctionID.cpp
  
  Index: FunctionID.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionID.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionID.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionID.cpp	2000/11/21 21:07:58	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionID::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);	
   
   	if (context == 0)
   	{
  
  
  
  1.18      +2 -2      xml-xalan/c/src/XPath/FunctionID.hpp
  
  Index: FunctionID.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionID.hpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- FunctionID.hpp	2000/11/06 19:33:20	1.17
  +++ FunctionID.hpp	2000/11/21 21:07:59	1.18
  @@ -104,11 +104,11 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.3       +3 -3      xml-xalan/c/src/XPath/FunctionLang.cpp
  
  Index: FunctionLang.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLang.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionLang.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionLang.cpp	2000/11/21 21:08:00	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionLang::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);	
   
   	const XalanNode*		parent = context;
   
  
  
  
  1.11      +2 -2      xml-xalan/c/src/XPath/FunctionLang.hpp
  
  Index: FunctionLang.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLang.hpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FunctionLang.hpp	2000/11/06 19:27:52	1.10
  +++ FunctionLang.hpp	2000/11/21 21:08:00	1.11
  @@ -88,11 +88,11 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.3       +1 -1      xml-xalan/c/src/XPath/FunctionLast.cpp
  
  Index: FunctionLast.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLast.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionLast.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionLast.cpp	2000/11/21 21:08:00	1.3
  @@ -70,7 +70,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionLast::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */)
  
  
  
  1.6       +1 -1      xml-xalan/c/src/XPath/FunctionLast.hpp
  
  Index: FunctionLast.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLast.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionLast.hpp	2000/11/06 19:33:21	1.5
  +++ FunctionLast.hpp	2000/11/21 21:08:01	1.6
  @@ -84,7 +84,7 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);
  
  
  
  1.4       +9 -15     xml-xalan/c/src/XPath/FunctionLocalName.cpp
  
  Index: FunctionLocalName.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLocalName.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FunctionLocalName.cpp	2000/11/10 16:22:24	1.3
  +++ FunctionLocalName.cpp	2000/11/21 21:08:01	1.4
  @@ -70,55 +70,49 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionLocalName::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1)
  +		const XObjectPtr					arg1)
   {
  -	assert(arg1 != 0);	
  +	assert(arg1.null() == false);	
   
  -	XObject*	theResult = 0;
  -
   	const NodeRefListBase&	theNodeList = arg1->nodeset();
   
   	if (theNodeList.getLength() == 0)
   	{	
  -		theResult = executionContext.getXObjectFactory().createString(XalanDOMString());
  +		return executionContext.getXObjectFactory().createString(XalanDOMString());
   		
   	}
   	else
   	{	
  -		theResult = getLocalName(executionContext, *theNodeList.item(0));	
  +		return getLocalName(executionContext, *theNodeList.item(0));	
   	}
  -
  -	return theResult;
   }
   
   
   
  -XObject*
  +XObjectPtr
   FunctionLocalName::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
   {
  -	XObject*	theResult = 0;
  -
   	if (context == 0)
   	{
   		executionContext.error("The local-name() function requires a non-null context node!");
   	}
   	else
   	{
  -		theResult = getLocalName(executionContext, *context);
  +		return getLocalName(executionContext, *context);
   	}
   
  -	return theResult;
  +	return 0;
   }
   
   
   
  -XObject*
  +XObjectPtr
   FunctionLocalName::getLocalName(
   		XPathExecutionContext&	executionContext,
   		const XalanNode&		node)
  
  
  
  1.12      +4 -4      xml-xalan/c/src/XPath/FunctionLocalName.hpp
  
  Index: FunctionLocalName.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLocalName.hpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FunctionLocalName.hpp	2000/11/07 16:37:39	1.11
  +++ FunctionLocalName.hpp	2000/11/21 21:08:02	1.12
  @@ -95,13 +95,13 @@
   
   	// These methods are inherited from Function ...
   
  -	XObject*
  +	XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1);
  +		const XObjectPtr				arg1);
   		
  -	XObject*
  +	XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context);
  @@ -115,7 +115,7 @@
   
   private:
   
  -	XObject*
  +	XObjectPtr
   	getLocalName(
   		XPathExecutionContext&	executionContext,
   		const XalanNode&		node);
  
  
  
  1.3       +6 -7      xml-xalan/c/src/XPath/FunctionName.cpp
  
  Index: FunctionName.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionName.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionName.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionName.cpp	2000/11/21 21:08:02	1.3
  @@ -70,16 +70,15 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionName::execute(
   		XPathExecutionContext&			executionContext,
  -		XalanNode*						context,			
  -		const XObject*					arg1)
  +		XalanNode*						/* context */,			
  +		const XObjectPtr					arg1)
   {
  -	assert(arg1 != 0);	
  +	assert(arg1.null() == false);	
   	
  -	XalanDOMString	theData;
  -	XalanNode*		theContext = 0;
  +	XalanDOMString	theData;	
   
   	const NodeRefListBase&	theNodeList = arg1->nodeset();
   
  @@ -94,7 +93,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionName::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
  
  
  
  1.9       +3 -3      xml-xalan/c/src/XPath/FunctionName.hpp
  
  Index: FunctionName.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionName.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionName.hpp	2000/11/06 19:27:56	1.8
  +++ FunctionName.hpp	2000/11/21 21:08:03	1.9
  @@ -99,13 +99,13 @@
   
   	// These methods are inherited from Function ...
   
  -	XObject*
  +	XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1);
  +		const XObjectPtr				arg1);
   		
  -	XObject*
  +	XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context);
  
  
  
  1.4       +5 -6      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FunctionNamespaceURI.cpp	2000/11/10 16:22:24	1.3
  +++ FunctionNamespaceURI.cpp	2000/11/21 21:08:03	1.4
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionNamespaceURI::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr					arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);	
   	
   	const XalanDOMString*	theNamespace = 0;
   
  @@ -87,7 +87,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionNamespaceURI::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
  @@ -110,8 +110,7 @@
   		// we're done.
   
   		// An XObject that contains the context node.
  -		XObjectGuard	theXObject(executionContext.getXObjectFactory(),
  -								   executionContext.createNodeSet(*context));
  +		XObjectPtr	theXObject(executionContext.createNodeSet(*context));
   
   
   		theNamespace = getNamespaceFromNodeSet(*theXObject.get(), executionContext);
  
  
  
  1.10      +3 -3      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FunctionNamespaceURI.hpp	2000/11/07 15:12:02	1.9
  +++ FunctionNamespaceURI.hpp	2000/11/21 21:08:04	1.10
  @@ -90,13 +90,13 @@
   	virtual
   	~FunctionNamespaceURI();
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);	
  
  
  
  1.5       +6 -7      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionNormalizeSpace.cpp	2000/11/20 20:04:30	1.4
  +++ FunctionNormalizeSpace.cpp	2000/11/21 21:08:04	1.5
  @@ -70,20 +70,20 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionNormalizeSpace::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);	
   		
   	return normalize(executionContext, arg1->str());
   }
   
   
   
  -XObject*
  +XObjectPtr
   FunctionNormalizeSpace::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
  @@ -104,8 +104,7 @@
   		// do the real work in turning themselves into strings.
   
   		// A node set that contains the context node.
  -		XObjectGuard	theXObject(executionContext.getXObjectFactory(),
  -								executionContext.createNodeSet(*context));
  +		XObjectPtr	theXObject(executionContext.createNodeSet(*context));
   
   		return normalize(executionContext, theXObject->str());
   	}
  @@ -113,7 +112,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionNormalizeSpace::normalize(
   		XPathExecutionContext&	executionContext,
   		const XalanDOMString&	theString)
  
  
  
  1.3       +4 -4      xml-xalan/c/src/XPath/FunctionNormalizeSpace.hpp
  
  Index: FunctionNormalizeSpace.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNormalizeSpace.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionNormalizeSpace.hpp	2000/11/07 14:58:06	1.2
  +++ FunctionNormalizeSpace.hpp	2000/11/21 21:08:05	1.3
  @@ -86,13 +86,13 @@
   	virtual
   	~FunctionNormalizeSpace();
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);	
  @@ -102,7 +102,7 @@
   
   private:
   
  -	XObject*
  +	XObjectPtr
   	normalize(
   		XPathExecutionContext&	executionContext,
   		const XalanDOMString&	theString);
  
  
  
  1.3       +3 -3      xml-xalan/c/src/XPath/FunctionNot.cpp
  
  Index: FunctionNot.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNot.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionNot.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionNot.cpp	2000/11/21 21:08:05	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionNot::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);	
   
   	return executionContext.getXObjectFactory().createBoolean(!arg1->boolean());
   }
  
  
  
  1.6       +2 -2      xml-xalan/c/src/XPath/FunctionNot.hpp
  
  Index: FunctionNot.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNot.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionNot.hpp	2000/11/06 19:33:24	1.5
  +++ FunctionNot.hpp	2000/11/21 21:08:06	1.6
  @@ -83,11 +83,11 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.3       +6 -7      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionNumber.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionNumber.cpp	2000/11/21 21:08:06	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionNumber::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);	
   	
   	double	theValue = 0.0L;
   
  @@ -87,7 +87,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionNumber::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
  @@ -105,12 +105,11 @@
   		// as the only member.
   		// So we have to create an XNodeList with the context node as
   		// the only member and call the num() function on it.  We shroud
  -		// the temporary XNodeList in an XObjectGuard because it can be
  +		// the temporary XNodeList in an XObjectPtr because it can be
   		// deleted once we've converted the context node to a number.
   
   		// An XObject that contains the context node.
  -		XObjectGuard	theXObject(executionContext.getXObjectFactory(),
  -								   executionContext.createNodeSet(*context));
  +		XObjectPtr	theXObject(executionContext.createNodeSet(*context));
   
   		// Get the numeric value of the theXObject...
   		theValue = theXObject->num();
  
  
  
  1.8       +3 -3      xml-xalan/c/src/XPath/FunctionNumber.hpp
  
  Index: FunctionNumber.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionNumber.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionNumber.hpp	2000/11/06 19:33:26	1.7
  +++ FunctionNumber.hpp	2000/11/21 21:08:07	1.8
  @@ -86,13 +86,13 @@
   	virtual
   	~FunctionNumber();
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);	
  
  
  
  1.3       +1 -1      xml-xalan/c/src/XPath/FunctionPosition.cpp
  
  Index: FunctionPosition.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionPosition.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionPosition.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionPosition.cpp	2000/11/21 21:08:07	1.3
  @@ -70,7 +70,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionPosition::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
  
  
  
  1.6       +1 -1      xml-xalan/c/src/XPath/FunctionPosition.hpp
  
  Index: FunctionPosition.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionPosition.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionPosition.hpp	2000/11/06 19:33:27	1.5
  +++ FunctionPosition.hpp	2000/11/21 21:08:08	1.6
  @@ -83,7 +83,7 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);
  
  
  
  1.3       +3 -3      xml-xalan/c/src/XPath/FunctionRound.cpp
  
  Index: FunctionRound.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionRound.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionRound.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionRound.cpp	2000/11/21 21:08:08	1.3
  @@ -74,13 +74,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionRound::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);	
   
   	return executionContext.getXObjectFactory().createNumber(
   		getRoundedValue(arg1->num()));
  
  
  
  1.8       +2 -2      xml-xalan/c/src/XPath/FunctionRound.hpp
  
  Index: FunctionRound.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionRound.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionRound.hpp	2000/11/06 19:33:32	1.7
  +++ FunctionRound.hpp	2000/11/21 21:08:08	1.8
  @@ -87,11 +87,11 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.3       +4 -4      xml-xalan/c/src/XPath/FunctionStartsWith.cpp
  
  Index: FunctionStartsWith.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionStartsWith.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionStartsWith.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionStartsWith.cpp	2000/11/21 21:08:10	1.3
  @@ -70,14 +70,14 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionStartsWith::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1,
  -		const XObject*					arg2)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2)
   {
  -	assert(arg1 != 0 || arg2 != 0);
  +	assert(arg1.null() == false && arg2.null() == false);	
   
   	const bool	fStartsWith = startsWith(arg1->str(),
   										 arg2->str());
  
  
  
  1.6       +3 -3      xml-xalan/c/src/XPath/FunctionStartsWith.hpp
  
  Index: FunctionStartsWith.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionStartsWith.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionStartsWith.hpp	2000/11/06 19:33:34	1.5
  +++ FunctionStartsWith.hpp	2000/11/21 21:08:14	1.6
  @@ -83,12 +83,12 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1,
  -			const XObject*					arg2);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.4       +6 -9      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FunctionString.cpp	2000/11/20 20:04:30	1.3
  +++ FunctionString.cpp	2000/11/21 21:08:14	1.4
  @@ -70,20 +70,20 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionString::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr					arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);	
   	
   	return executionContext.getXObjectFactory().createString(arg1->str());
   }
   
   
   
  -XObject*
  +XObjectPtr
   FunctionString::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
  @@ -100,13 +100,10 @@
   		// the argument defaults to a node set with the context node
   		// as the only member.
   		// So we have to create an XNodeList with the context node as
  -		// the only member and call the str() function on it.  We shroud
  -		// the temporary XNodeList in an XObjectGuard because it can be
  -		// deleted once we've converted the context node to a string.
  +		// the only member and call the str() function on it.  
   
   		// An XObject that contains the context node.
  -		XObjectGuard	theXObject(executionContext.getXObjectFactory(),
  -								   executionContext.createNodeSet(*context));
  +		XObjectPtr	theXObject(executionContext.createNodeSet(*context));
   
   		return executionContext.getXObjectFactory().createString(theXObject->str());
   	}
  
  
  
  1.9       +3 -3      xml-xalan/c/src/XPath/FunctionString.hpp
  
  Index: FunctionString.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionString.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionString.hpp	2000/11/06 19:33:36	1.8
  +++ FunctionString.hpp	2000/11/21 21:08:14	1.9
  @@ -90,13 +90,13 @@
   	virtual
   	~FunctionString();
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);	
  
  
  
  1.3       +6 -9      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionStringLength.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionStringLength.cpp	2000/11/21 21:08:15	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionStringLength::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);	
   
   	unsigned int	theLength = length(arg1->str());	
   	
  @@ -85,7 +85,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionStringLength::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
  @@ -104,13 +104,10 @@
   		// the argument defaults to a node set with the context node
   		// as the only member.
   		// So we have to create an XNodeList with the context node as
  -		// the only member and call the str() function on it.  We shroud
  -		// the temporary XNodeList in an XObjectGuard because it can be
  -		// deleted once we've converted the context node to a string.
  +		// the only member and call the str() function on it.  
   
   		// An XObject that contains the context node.
  -		XObjectGuard	theXObject(executionContext.getXObjectFactory(),
  -								   executionContext.createNodeSet(*context));
  +		XObjectPtr	theXObject(executionContext.createNodeSet(*context));
   
   		// Get the value of the theXObject...
   		theValue = theXObject->str();
  
  
  
  1.8       +3 -3      xml-xalan/c/src/XPath/FunctionStringLength.hpp
  
  Index: FunctionStringLength.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionStringLength.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionStringLength.hpp	2000/11/06 19:33:38	1.7
  +++ FunctionStringLength.hpp	2000/11/21 21:08:15	1.8
  @@ -86,13 +86,13 @@
   	virtual
   	~FunctionStringLength();
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);	
  
  
  
  1.5       +13 -11    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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionSubstring.cpp	2000/11/20 20:04:30	1.4
  +++ FunctionSubstring.cpp	2000/11/21 21:08:16	1.5
  @@ -70,15 +70,15 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionSubstring::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1,
  -		const XObject*					arg2,
  -		const XObject*					arg3)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2,
  +		const XObjectPtr				arg3)
   {
  -	assert(arg1 != 0 || arg2 != 0);
  +	assert(arg1.null() == false && arg2.null() == false);	
   
   	const XalanDOMString&	theSourceString = arg1->str();
   	const unsigned int		theSourceStringLength = length(theSourceString);
  @@ -109,7 +109,7 @@
   		// the third argument is missing, make the total
   		// DBL_MAX.
   		const double	theTotal =
  -				arg3 == 0 ? DBL_MAX :
  +				arg3.null() == true ? DBL_MAX :
   								   FunctionRound::getRoundedValue(
   									   theSecondArgValue + arg3->num());
   
  @@ -154,16 +154,18 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionSubstring::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1,
  -		const XObject*					arg2)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2)
   {
  -	assert(arg1 != 0 || arg2 != 0);	
  +	assert(arg1.null() == false && arg2.null() == false);
  +	
  +	XObjectPtr dummy;
   
  -	return execute(executionContext, context, arg1, arg2, 0);
  +	return execute(executionContext, context, arg1, arg2, dummy);
   }
   
   
  
  
  
  1.9       +7 -7      xml-xalan/c/src/XPath/FunctionSubstring.hpp
  
  Index: FunctionSubstring.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstring.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionSubstring.hpp	2000/11/06 19:28:00	1.8
  +++ FunctionSubstring.hpp	2000/11/21 21:08:16	1.9
  @@ -95,20 +95,20 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1,
  -			const XObject*					arg2,
  -			const XObject*					arg3);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2,
  +			const XObjectPtr				arg3);
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1,
  -			const XObject*					arg2);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2);
   
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
  
  
  
  1.5       +4 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionSubstringAfter.cpp	2000/11/20 20:04:30	1.4
  +++ FunctionSubstringAfter.cpp	2000/11/21 21:08:16	1.5
  @@ -70,14 +70,14 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionSubstringAfter::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1,
  -		const XObject*					arg2)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2)
   {
  -	assert(arg1 != 0 || arg2 != 0);	
  +	assert(arg1.null() == false && arg2.null() == false);
   
   	const XalanDOMString&	theFirstString = arg1->str();
   	const XalanDOMString&	theSecondString = arg2->str();
  
  
  
  1.8       +3 -3      xml-xalan/c/src/XPath/FunctionSubstringAfter.hpp
  
  Index: FunctionSubstringAfter.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstringAfter.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionSubstringAfter.hpp	2000/11/06 19:28:02	1.7
  +++ FunctionSubstringAfter.hpp	2000/11/21 21:08:17	1.8
  @@ -83,12 +83,12 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1,
  -			const XObject*					arg2);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.5       +4 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionSubstringBefore.cpp	2000/11/20 20:04:30	1.4
  +++ FunctionSubstringBefore.cpp	2000/11/21 21:08:17	1.5
  @@ -70,14 +70,14 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionSubstringBefore::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1,
  -		const XObject*					arg2)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2)
   {
  -	assert(arg1 != 0 || arg2 != 0);	
  +	assert(arg1.null() == false && arg2.null() == false);
   
   	const XalanDOMString&	theFirstString = arg1->str();
   	const XalanDOMString&	theSecondString = arg2->str();
  
  
  
  1.8       +3 -3      xml-xalan/c/src/XPath/FunctionSubstringBefore.hpp
  
  Index: FunctionSubstringBefore.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstringBefore.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionSubstringBefore.hpp	2000/11/06 19:28:04	1.7
  +++ FunctionSubstringBefore.hpp	2000/11/21 21:08:17	1.8
  @@ -83,12 +83,12 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1,
  -			const XObject*					arg2);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.3       +3 -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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionSum.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionSum.cpp	2000/11/21 21:08:18	1.3
  @@ -70,13 +70,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionSum::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);
   
   	const NodeRefListBase&	nl = arg1->nodeset();
   
  
  
  
  1.9       +2 -2      xml-xalan/c/src/XPath/FunctionSum.hpp
  
  Index: FunctionSum.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSum.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionSum.hpp	2000/11/06 19:28:06	1.8
  +++ FunctionSum.hpp	2000/11/21 21:08:19	1.9
  @@ -88,11 +88,11 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.5       +5 -5      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionTranslate.cpp	2000/11/20 20:04:30	1.4
  +++ FunctionTranslate.cpp	2000/11/21 21:08:19	1.5
  @@ -70,15 +70,15 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionTranslate::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1,
  -		const XObject*					arg2,
  -		const XObject*					arg3)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2,
  +		const XObjectPtr				arg3)
   {
  -	assert(arg1 != 0 || arg2 != 0 || arg3 != 0);	
  +	assert(arg1.null() == false && arg2.null() == false && arg3.null() == false);
   
   	const XalanDOMString&	theFirstString = arg1->str();
   	const XalanDOMString&	theSecondString = arg2->str();
  
  
  
  1.9       +4 -4      xml-xalan/c/src/XPath/FunctionTranslate.hpp
  
  Index: FunctionTranslate.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionTranslate.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionTranslate.hpp	2000/11/06 19:28:08	1.8
  +++ FunctionTranslate.hpp	2000/11/21 21:08:19	1.9
  @@ -83,13 +83,13 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						/* context */,			
  -			const XObject*					arg1,
  -			const XObject*					arg2,
  -			const XObject*					arg3);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2,
  +			const XObjectPtr				arg3);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.3       +1 -1      xml-xalan/c/src/XPath/FunctionTrue.cpp
  
  Index: FunctionTrue.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionTrue.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionTrue.cpp	2000/11/10 16:22:24	1.2
  +++ FunctionTrue.cpp	2000/11/21 21:08:20	1.3
  @@ -70,7 +70,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionTrue::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */)
  
  
  
  1.6       +1 -1      xml-xalan/c/src/XPath/FunctionTrue.hpp
  
  Index: FunctionTrue.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionTrue.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionTrue.hpp	2000/11/06 19:33:40	1.5
  +++ FunctionTrue.hpp	2000/11/21 21:08:20	1.6
  @@ -83,7 +83,7 @@
   
   	// These methods are inherited from Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);
  
  
  
  1.27      +6 -14     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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- SimpleNodeLocator.cpp	2000/11/02 01:45:59	1.26
  +++ SimpleNodeLocator.cpp	2000/11/21 21:08:20	1.27
  @@ -106,7 +106,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   SimpleNodeLocator::locationPath(
   			const XPath&			xpath,
   			XPathExecutionContext&	executionContext,
  @@ -373,9 +373,7 @@
   		{
   			argLen = currentExpression.getOpCodeLength(opPos);
   
  -			const XObjectGuard		obj(
  -										executionContext.getXObjectFactory(),
  -										xpath.executeMore(localContext, opPos, executionContext));
  +			const XObjectPtr		obj(xpath.executeMore(localContext, opPos, executionContext));
   			assert(obj.get() != 0);
   
   			const NodeRefListBase&	nl = obj->nodeset();
  @@ -519,9 +517,7 @@
   
   			while(XPathExpression::eOP_PREDICATE == nextStepType)
   			{
  -				const XObjectGuard		pred(
  -										executionContext.getXObjectFactory(),
  -										xpath.predicate(localContext, opPos, executionContext));
  +				const XObjectPtr		pred(xpath.predicate(localContext, opPos, executionContext));
   				assert(pred.get() != 0);
   
   				if(XObject::eTypeNumber == pred->getType())
  @@ -606,9 +602,7 @@
   		xpath.getExpression();
   
   
  -	const XObjectGuard		obj(
  -				executionContext.getXObjectFactory(),
  -				xpath.executeMore(context, opPos, executionContext));
  +	const XObjectPtr		obj(xpath.executeMore(context, opPos, executionContext));
   
   	const NodeRefListBase&	nl = obj->nodeset();
   
  @@ -1354,7 +1348,7 @@
   			XPathExecutionContext&	executionContext,
   			XalanNode*				context, 
   			int 					opPos,
  -			int 					stepType,
  +			int 					/* stepType */,
   			MutableNodeRefList& 	/* subQueryResults */)
   {
   	const XPathExpression&	currentExpression =
  @@ -1659,9 +1653,7 @@
   			XalanNode* const	theNode = subQueryResults.item(i);
   			assert(theNode != 0);
   
  -			const XObjectGuard		pred(
  -						executionContext.getXObjectFactory(),
  -						xpath.predicate(theNode, opPos, executionContext));
  +			const XObjectPtr		pred(xpath.predicate(theNode, opPos, executionContext));
   			assert(pred.get() != 0);
   
   			// Remove any node that doesn't satisfy the predicate.
  
  
  
  1.12      +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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SimpleNodeLocator.hpp	2000/09/19 14:55:53	1.11
  +++ SimpleNodeLocator.hpp	2000/11/21 21:08:23	1.12
  @@ -105,7 +105,7 @@
   
   	// These methods are inherited from XLocator ...
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	locationPath(
   			const XPath&			xpath,
   			XPathExecutionContext&	executionContext,
  
  
  
  1.9       +4 -3      xml-xalan/c/src/XPath/XLocator.hpp
  
  Index: XLocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XLocator.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XLocator.hpp	2000/09/05 02:24:50	1.8
  +++ XLocator.hpp	2000/11/21 21:08:24	1.9
  @@ -70,6 +70,7 @@
   
   class XalanNode;
   class XObject;
  +class XObjectPtr;
   class XPath;
   class XPathExecutionContext;
   class XNodeSet;
  @@ -86,9 +87,9 @@
   	~XLocator();
   
   #if defined(XALAN_NO_NAMESPACES)
  -	typedef	vector<XObject*>		ConnectArgsVectorType;
  +	typedef	vector<XObjectPtr>		ConnectArgsVectorType;
   #else
  -	typedef	std::vector<XObject*>	ConnectArgsVectorType;
  +	typedef	std::vector<XObjectPtr>	ConnectArgsVectorType;
   #endif
   
   	/**
  @@ -102,7 +103,7 @@
   	 * @param opPos   current position in the xpath.m_opMap array
   	 * @return result of the query in a pointer to an XObject
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	locationPath(
   			const XPath&			xpath,
   			XPathExecutionContext&	executionContext,
  
  
  
  1.14      +23 -2     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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XObject.cpp	2000/11/02 01:46:00	1.13
  +++ XObject.cpp	2000/11/21 21:08:24	1.14
  @@ -76,6 +76,7 @@
   
   
   #include "NodeRefList.hpp"
  +#include "XObjectFactory.hpp"
   
   
   
  @@ -84,14 +85,16 @@
   
   
   XObject::XObject(eObjectType	theObjectType) :
  -	m_objectType(theObjectType)
  +	m_objectType(theObjectType),
  +	m_factory(0)
   {
   }
   
   
   
   XObject::XObject(const XObject&		source) :
  -	m_objectType(source.m_objectType)
  +	m_objectType(source.m_objectType),
  +	m_factory(0)
   {
   }
   
  @@ -99,6 +102,24 @@
   
   XObject::~XObject()
   {
  +}
  +
  +
  +
  +void
  +XObject::referenced()
  +{
  +}
  +
  +
  +
  +void 
  +XObject::dereferenced()
  +{
  +	if (m_factory != 0)
  +	{
  +		m_factory->returnObject(this);
  +	}
   }
   
   
  
  
  
  1.12      +135 -1    xml-xalan/c/src/XPath/XObject.hpp
  
  Index: XObject.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XObject.hpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XObject.hpp	2000/09/19 14:56:30	1.11
  +++ XObject.hpp	2000/11/21 21:08:25	1.12
  @@ -68,6 +68,10 @@
   
   
   
  +#include <PlatformSupport/XalanReferenceCountedObject.hpp>
  +
  +
  +
   #include <XPath/XPathException.hpp>
   
   
  @@ -75,6 +79,7 @@
   class MutableNodeRefList;
   class NodeRefListBase;
   class ResultTreeFragBase;
  +class XObjectFactory;
   class XObjectTypeCallback;
   class XPathExecutionContext;
   
  @@ -83,10 +88,12 @@
   /**
    * Class to hold XPath return types.
    */
  -class XALAN_XPATH_EXPORT XObject
  +class XALAN_XPATH_EXPORT XObject : protected XalanReferenceCountedObject
   {
   public:
   
  +	friend class XObjectPtr;
  +
   	/**
   	 * Enumeration of possible object types
   	 */
  @@ -257,6 +264,12 @@
   	// All XObject instances are controlled by an instance of an XObjectFactory.
   	friend class XObjectFactory;
   
  +	void
  +	setFactory(XObjectFactory*	theFactory)
  +	{
  +		m_factory = theFactory;
  +	}
  +
   	// Base class for all XObject exceptions...
   	class XObjectException : public XPathException
   	{
  @@ -309,6 +322,12 @@
   
   protected:
   
  +	virtual void 
  +	referenced();
  +
  +	virtual void 
  +	dereferenced();
  +
   	virtual
   	~XObject();
   
  @@ -321,6 +340,8 @@
   	operator=(const XObject&);
   
   	const eObjectType	m_objectType;
  +
  +	XObjectFactory*		m_factory;
   };
   
   
  @@ -381,6 +402,119 @@
   			const XObject&	theRHS)
   {
   	return theLHS.greaterThanOrEqual(theRHS);
  +}
  +
  +
  +
  +/**
  + * Class to hold XObjectPtr return types.
  + */
  +class XALAN_XPATH_EXPORT XObjectPtr
  +{
  +public:
  +
  +	friend bool operator==(const XObjectPtr&, const XObjectPtr&);
  +	/**
  +	 * Create an XObjectPtr.
  +	 */
  +	explicit
  +	XObjectPtr(XObject*		theXObject = 0) :
  +		m_xobjectPtr(theXObject)
  +	{
  +		XalanReferenceCountedObject::addReference(theXObject);
  +	}
  +	
  +	XObjectPtr(const XObjectPtr&	theSource) :
  +		m_xobjectPtr(theSource.m_xobjectPtr)
  +	{ 
  +		XalanReferenceCountedObject::addReference(m_xobjectPtr);
  +	};
  +
  +	XObjectPtr&
  +	operator=(const XObjectPtr&		theRHS)
  +	{ 
  +		if (m_xobjectPtr != theRHS.m_xobjectPtr)
  +		{
  +			XalanReferenceCountedObject::removeReference(m_xobjectPtr);
  +
  +			m_xobjectPtr = theRHS.m_xobjectPtr;
  +
  +			XalanReferenceCountedObject::addReference(m_xobjectPtr);
  +		}
  +
  +		return *this;
  +	}
  +
  +	~XObjectPtr()
  +	{
  +		XalanReferenceCountedObject::removeReference(m_xobjectPtr);
  +	};	
  +
  +	bool
  +	null() const
  +	{
  +		return m_xobjectPtr == 0 ? true : false;
  +	}
  +
  +	const XObject&
  +	operator*() const
  +	{
  +		return *m_xobjectPtr;
  +	};
  +
  +	XObject&
  +	operator*() 
  +	{
  +		return *m_xobjectPtr;
  +	};
  +
  +	const XObject*
  +	operator->() const
  +	{
  +		return m_xobjectPtr;
  +	};
  +
  +	XObject*
  +	operator->()
  +	{
  +		return m_xobjectPtr;
  +	};
  +
  +	const XObject*
  +	get() const
  +	{
  +		return m_xobjectPtr;
  +	};
  +
  +	XObject*
  +	get()
  +	{
  +		return m_xobjectPtr;
  +	};
  +
  +private:
  +
  +	XObject*	m_xobjectPtr;	
  +};
  +
  +
  +
  +inline bool
  +operator==(
  +			const XObjectPtr&	theLHS,
  +			const XObjectPtr&	theRHS)
  +{
  +	return theLHS.m_xobjectPtr == theRHS.m_xobjectPtr;
  +}
  +
  +
  +
  +inline bool
  +operator!=(
  +			const XObjectPtr&	theLHS,
  +			const XObjectPtr&	theRHS)
  +{
  +	return !(theLHS == theRHS);
   }
   
   
  
  
  
  1.15      +11 -182   xml-xalan/c/src/XPath/XObjectFactory.hpp
  
  Index: XObjectFactory.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XObjectFactory.hpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XObjectFactory.hpp	2000/11/20 20:04:30	1.14
  +++ XObjectFactory.hpp	2000/11/21 21:08:25	1.15
  @@ -80,6 +80,7 @@
   class NodeRefListBase;
   class ResultTreeFragBase;
   class XObject;
  +class XObjectPtr;
   
   
   
  @@ -118,21 +119,12 @@
   	reset() = 0;
   
   	/**
  -	 * Clone an XObject instance, and hold in the factory.
  -	 *
  -	 * @param theXObject the instance to clone
  -	 * @return a clone of the instance.
  -	 */
  -	virtual XObject*
  -	clone(const XObject&	theXObject) = 0;
  -
  -	/**
   	 * Create a boolean XObject from a boolean value.
   	 * 
   	 * @param theValue  value used to create object	 
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createBoolean(
   			bool	theValue) = 0;
   
  @@ -142,7 +134,7 @@
   	 * @param theValue  value used to create object.  theValue will be owned by the new XObject.
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createNodeSet(
   			BorrowReturnMutableNodeRefList&		theValue) = 0;
   
  @@ -152,7 +144,7 @@
   	 * @param theValue  value used to create object	
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createNull() = 0;
   
   	/**
  @@ -161,7 +153,7 @@
   	 * @param theValue  value used to create object	
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createNumber(
   			double	theValue) = 0;
   
  @@ -171,7 +163,7 @@
   	 * @param theValue  value used to create object	 
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createString(
   			const XalanDOMString&	theValue) = 0;
   
  @@ -181,7 +173,7 @@
   	 * @param theValue  a pointer to the array
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createString(
   			const XalanDOMChar*		theValue) = 0;
   
  @@ -192,7 +184,7 @@
   	 * @paran theLength the length of the array
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createString(
   			const XalanDOMChar*		theValue,
   			unsigned int			theLength) = 0;
  @@ -203,7 +195,7 @@
   	 * @param theValue  value used to create object	 
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createUnknown(
   			const XalanDOMString&	theValue) = 0;
   
  @@ -213,7 +205,7 @@
   	 * @param theValue  value used to create object.  theValue will be owned by the new XObject.	
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createResultTreeFrag(
   			ResultTreeFragBase*		theValue) = 0;
   
  @@ -223,7 +215,7 @@
   	 * @param theValue  value used to create object.  The new object will own the pointer.
   	 * @return pointer to new object
   	 */
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createSpan(
   			BorrowReturnMutableNodeRefList&		theValue) = 0;
   
  @@ -311,169 +303,6 @@
   
   	bool
   	operator==(const XObjectFactory&) const;
  -};
  -
  -
  -
  -/**
  - * Manages the lifetime of an XObject instance.
  - */
  -class XObjectGuard
  -{
  -public:
  -
  -	/**
  -	 * Construct an XObjectGuard instance from a factory object and an XObject.
  -	 * 
  -	 * @param theFactory object that manages lifetime of XObjects
  -	 * @param theXObject pointer to XObject managed
  -	 */
  -	XObjectGuard(
  -			XObjectFactory&		theFactory,
  -			const XObject*		theXObject) :
  -		m_factory(&theFactory),
  -		m_object(theXObject)
  -	{
  -	}
  -
  -	explicit
  -	XObjectGuard() :
  -		m_factory(0),
  -		m_object(0)
  -	{
  -	}
  -
  -	// Note that copy construction transfers ownership, just
  -	// as std::auto_ptr.
  -	XObjectGuard(XObjectGuard&	theRHS)
  -	{
  -		// Release the current object...
  -		release();
  -
  -		// Copy the factory and object pointers...
  -		m_factory = theRHS.m_factory;
  -		m_object = theRHS.m_object;
  -
  -		// The source object no longer points to
  -		// the object...
  -		theRHS.m_factory = 0;
  -		theRHS.m_object = 0;
  -	}
  -
  -	~XObjectGuard()
  -	{
  -		reset();
  -	}
  -
  -	// Note that assignment transfers ownership, just
  -	// as std::auto_ptr.
  -	XObjectGuard&
  -	operator=(XObjectGuard&		theRHS)
  -	{
  -		if (&theRHS != this)
  -		{
  -			// Release the current object...
  -			release();
  -
  -			// Copy the factory and object pointers...
  -			m_factory = theRHS.m_factory;
  -			m_object = theRHS.m_object;
  -
  -			// The source object no longer points to
  -			// the object...
  -			theRHS.m_factory = 0;
  -			theRHS.m_object = 0;
  -		}
  -
  -		return *this;
  -	}
  -
  -	/**
  -	 * Retrieve the object pointer (must not be null)
  -	 * 
  -	 * @return pointer to XObject
  -	 */
  -	const XObject*
  -	operator->() const
  -	{
  -		assert(m_object != 0);
  -
  -		return m_object;
  -	}
  -
  -	/**
  -	 * Retrieve the object pointer (may be null)
  -	 * 
  -	 * @return pointer to XObject
  -	 */
  -	const XObject*
  -	get() const
  -	{
  -		return m_object;
  -	}
  -
  -	/**
  -	 * Return the referenced object to the factory and set the pointers to null.
  -	 */
  -	void
  -	reset()
  -	{
  -		if (m_object != 0)
  -		{
  -			assert(m_factory != 0);
  -
  -			m_factory->returnObject(m_object);
  -
  -			m_object = 0;
  -		}
  -
  -		m_factory = 0;
  -	}
  -
  -	/**
  -	 * Return the referenced object to the factory, if there is one,
  -	 * and set the pointers to the new object and factory.
  -	 */
  -	void
  -	reset(
  -			XObjectFactory&		theFactory,
  -			const XObject*		theXObject)
  -	{
  -		if (m_object != 0)
  -		{
  -			assert(m_factory != 0);
  -
  -			m_factory->returnObject(m_object);
  -		}
  -
  -		m_object = theXObject;
  -		m_factory = &theFactory;
  -	}
  -
  -	/**
  -	 * Transfers ownership of XObject to caller
  -	 * 
  -	 * @return pointer to XObject
  -	 */
  -	const XObject*
  -	release()
  -	{
  -		const XObject* const	theTemp = m_object;
  -
  -		m_object = 0;
  -
  -		return theTemp;
  -	}
  -
  -private:
  -
  -	bool
  -	operator==(const XObjectGuard&) const;
  -
  -
  -	// Data members...
  -	XObjectFactory*		m_factory;
  -    const XObject*		m_object;
   };
   
   
  
  
  
  1.17      +42 -25    xml-xalan/c/src/XPath/XObjectFactoryDefault.cpp
  
  Index: XObjectFactoryDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XObjectFactoryDefault.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XObjectFactoryDefault.cpp	2000/11/20 20:04:30	1.16
  +++ XObjectFactoryDefault.cpp	2000/11/21 21:08:27	1.17
  @@ -200,7 +200,7 @@
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::clone(const XObject&		theXObject)
   {
   	XObject*	theClone = 0;
  @@ -222,8 +222,7 @@
   		const XObject::eObjectType	theType = theXObject.getType();		
   
   		switch(theType)
  -		{
  -		
  +		{	
   		case XObject::eTypeString:
   			theClone = m_xstringAllocator.clone(
   #if defined(XALAN_OLD_STYLE_CASTS)
  @@ -265,124 +264,142 @@
   			break;
   
   		default:
  -			XObject* const	theClone = theXObject.clone();
  +			theClone = theXObject.clone();
   
   			m_xobjects.insert(theClone);
   			break;
   		}
   	}
   
  -	return theClone;
  +	theClone->setFactory(this);
  +
  +	return XObjectPtr(theClone);
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createBoolean(
   			bool	theValue)
   {
  -	return theValue == true ? &theTrueBoolean : &theFalseBoolean;	
  +	return XObjectPtr(theValue == true ? &theTrueBoolean : &theFalseBoolean);
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createNull()
   {	
  -	return m_XNull.get();	
  +	return XObjectPtr(m_XNull.get());
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createUnknown(
   			const XalanDOMString&	theValue)
   {
   	XUnknown* const	theXUnknown = new XUnknown(theValue);
   
   	m_xobjects.insert(theXUnknown);
  +
  +	theXUnknown->setFactory(this);
   
  -	return theXUnknown;
  +	return XObjectPtr(theXUnknown);
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createSpan(
   			BorrowReturnMutableNodeRefList&		theValue)
   {
   	XSpan* const	theXSpan = new XSpan(theValue);
   
   	m_xobjects.insert(theXSpan);
  +
  +	theXSpan->setFactory(this);
   
  -	return theXSpan;
  +	return XObjectPtr(theXSpan);
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createNumber(
   			double	theValue)
   {
   	XNumber*	theXNumber = m_xnumberAllocator.createNumber(theValue);
   
  -	return theXNumber;
  +	theXNumber->setFactory(this);
  +
  +	return XObjectPtr(theXNumber);
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createNodeSet(
   			BorrowReturnMutableNodeRefList&		theValue)
   {
   	XNodeSet* const		theXNodeSet = m_xnodesetAllocator.createNodeSet(theValue);
  +
  +	theXNodeSet->setFactory(this);
   
  -	return theXNodeSet;
  +	return XObjectPtr(theXNodeSet);
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createString(
   			const XalanDOMString&	theValue)
   {
   	XString* const	theXString = m_xstringAllocator.createString(theValue);
   
  -	return theXString;
  +	theXString->setFactory(this);
  +
  +	return XObjectPtr(theXString);
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createString(
   			const XalanDOMChar*		theValue)
   {
   	XString* const	theXString = m_xstringAllocator.createString(theValue);
  +
  +	theXString->setFactory(this);
   
  -	return theXString;
  +	return XObjectPtr(theXString);
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createString(
   			const XalanDOMChar*		theValue,
   			unsigned int			theLength)
   {
   	XString* const	theXString = m_xstringAllocator.createString(theValue, theLength);
   
  -	return theXString;
  +	theXString->setFactory(this);
  +
  +	return XObjectPtr(theXString);
   }
   
   
   
  -XObject*
  +const XObjectPtr
   XObjectFactoryDefault::createResultTreeFrag(
   			ResultTreeFragBase*		theValue)
   {
   	XResultTreeFrag* const	theResultTreeFrag =  m_xresultTreeFragAllocator.create(theValue);
  +
  +	theResultTreeFrag->setFactory(this);
   
  -	return theResultTreeFrag;
  +	return XObjectPtr(theResultTreeFrag);
   }
   
   
  
  
  
  1.16      +11 -13    xml-xalan/c/src/XPath/XObjectFactoryDefault.hpp
  
  Index: XObjectFactoryDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XObjectFactoryDefault.hpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- XObjectFactoryDefault.hpp	2000/11/20 20:04:31	1.15
  +++ XObjectFactoryDefault.hpp	2000/11/21 21:08:27	1.16
  @@ -132,46 +132,46 @@
   	virtual void
   	reset();
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	clone(const XObject&	theXObject);
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createBoolean(
   			bool	theValue);
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createNodeSet(
   			BorrowReturnMutableNodeRefList&		theValue);
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createNull();
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createNumber(
   			double	theValue);
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createString(
   			const XalanDOMString&	theValue);
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createString(
   			const XalanDOMChar*		theValue);
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createString(
   			const XalanDOMChar*		theValue,
   			unsigned int			theLength);
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createUnknown(
   			const XalanDOMString&	theValue);
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createResultTreeFrag(
   			ResultTreeFragBase*		theValue);
   
  -	virtual XObject*
  +	virtual const XObjectPtr
   	createSpan(
   			BorrowReturnMutableNodeRefList&		theValue);
   
  @@ -182,8 +182,6 @@
   #endif
   
   protected:
  -
  -	// These methods are inherited from Factory ...
   
   	virtual bool
   	doReturnObject(
  
  
  
  1.34      +120 -194  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.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- XPath.cpp	2000/11/08 14:21:05	1.33
  +++ XPath.cpp	2000/11/21 21:08:30	1.34
  @@ -134,7 +134,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::execute(XPathExecutionContext&	executionContext) const
   {
   	assert(executionContext.getPrefixResolver() != 0);
  @@ -144,7 +144,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::execute(
   			XalanNode*				context,
   			const PrefixResolver&	prefixResolver,
  @@ -160,16 +160,12 @@
   									executionContext,
   									context);
   
  -	const XObject*	theResult = 0;
  -
  -	theResult = execute(executionContext);
  -
  -	return theResult;
  +	return execute(executionContext);
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::execute(
   			XalanNode*				context,
   			const PrefixResolver&	prefixResolver,
  @@ -179,24 +175,20 @@
   	// Push and pop the PrefixResolver...
   	XPathExecutionContext::ContextNodeListSetAndRestore		theSetAndRestore(
   									executionContext,
  -									contextNodeList);
  -
  -	const XObject*	theResult = 0;
  -
  -	theResult = execute(context, prefixResolver, executionContext);
  +									contextNodeList);	
   
  -	return theResult;
  +	return execute(context, prefixResolver, executionContext);
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::executeMore(
   			XalanNode* 				context,
   			int 					opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	const XObject*	result = 0;
  +	XObjectPtr	result;
   
   	switch(m_expression.m_opMap[opPos])
   	{
  @@ -605,7 +597,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::xpath(
   			XalanNode*				context,
   			int						opPos,
  @@ -616,23 +608,21 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::matchPattern(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   
   {
  -	const XObject*	score = 0;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  +	XObjectPtr	score;
   
   	while(m_expression.m_opMap[opPos] == XPathExpression::eOP_LOCATIONPATHPATTERN)
   	{
   		const int	nextOpPos = m_expression.getNextOpCodePosition(opPos);
   
   		score = executeMore(context, opPos, executionContext);
  -		assert(score != 0);
  +		assert(score.null() == false);
   
   		if(score->num() != s_MatchScoreNone)
   		{
  @@ -640,16 +630,11 @@
   		}
   		else
   		{
  -			// We're done with this object, so return it...
  -			theFactory.returnObject(score);
  -
  -			score = 0;
  -
   			opPos = nextOpPos;
   		}
   	}
   
  -	if(0 == score)
  +	if(score.null() == true)
   	{
   		score = executionContext.getXObjectFactory().createNumber(s_MatchScoreNone);
   	}
  @@ -673,17 +658,15 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::Or(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
   	opPos += 2;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	bool	fResult = expr1->boolean();
  @@ -692,120 +675,112 @@
   	{
   		const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -		const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +		const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   		assert(expr2.get() != 0);
   
   		fResult = expr2->boolean();
   	}
   
  -	return theFactory.createBoolean(fResult);
  +	return executionContext.getXObjectFactory().createBoolean(fResult);
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::And(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
   	bool	fResult = false;
  -
  -	opPos += 2;
   
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  +	opPos += 2;	
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	if (expr1->boolean() == true)
   	{
   		const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -		const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +		const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   		assert(expr2.get() != 0);
   
   		if (expr2->boolean() == true)
   		{
   			fResult = true;
   		}
  -	}
  +	}	
   
  -	return theFactory.createBoolean(fResult);
  +	return executionContext.getXObjectFactory().createBoolean(fResult);
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::notequals(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	opPos += 2;
  +	opPos += 2;	
   
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  -
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createBoolean(*expr1.get() != *expr2.get());
  +	return executionContext.getXObjectFactory().createBoolean(*expr1.get() != *expr2.get());
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::equals(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	opPos += 2;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  +	opPos += 2;	
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createBoolean(*expr1.get() == *expr2.get());
  +	return executionContext.getXObjectFactory().createBoolean(*expr1.get() == *expr2.get());
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::lte(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	opPos += 2;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  +	opPos += 2;	
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createBoolean(*expr1.get() <= *expr2.get());
  +	return executionContext.getXObjectFactory().createBoolean(*expr1.get() <= *expr2.get());
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::lt(
   			XalanNode*				context,
   			int						opPos,
  @@ -813,91 +788,83 @@
   {
   	opPos += 2;
   
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  -
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createBoolean(*expr1.get() < *expr2.get());
  +	return executionContext.getXObjectFactory().createBoolean(*expr1.get() < *expr2.get());
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::gte(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
   	opPos += 2;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createBoolean(*expr1.get() >= *expr2.get());
  +	return executionContext.getXObjectFactory().createBoolean(*expr1.get() >= *expr2.get());
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::gt(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
   	opPos += 2;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createBoolean(*expr1.get() > *expr2.get());
  +	return executionContext.getXObjectFactory().createBoolean(*expr1.get() > *expr2.get());
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::plus(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
   	opPos += 2;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createNumber(DoubleSupport::add(expr1->num(), expr2->num()));
  +	return executionContext.getXObjectFactory().createNumber(DoubleSupport::add(expr1->num(), expr2->num()));
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::minus(
   			XalanNode*				context,
   			int						opPos,
  @@ -905,91 +872,83 @@
   {
   	opPos += 2;
   
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  -
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createNumber(DoubleSupport::subtract(expr1->num(), expr2->num()));
  +	return executionContext.getXObjectFactory().createNumber(DoubleSupport::subtract(expr1->num(), expr2->num()));
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::mult(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
   	opPos += 2;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createNumber(DoubleSupport::multiply(expr1->num(), expr2->num()));
  +	return executionContext.getXObjectFactory().createNumber(DoubleSupport::multiply(expr1->num(), expr2->num()));
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::div(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
   	opPos += 2;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createNumber(DoubleSupport::divide(expr1->num(), expr2->num()));
  +	return executionContext.getXObjectFactory().createNumber(DoubleSupport::divide(expr1->num(), expr2->num()));
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::mod(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	opPos += 2;
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  +	opPos += 2;	
   
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos, executionContext));
   	assert(expr1.get() != 0);
   
   	const int		expr2Pos = m_expression.getNextOpCodePosition(opPos);
   
  -	const XObjectGuard	expr2(theFactory, executeMore(context, expr2Pos, executionContext));
  +	const XObjectPtr	expr2(executeMore(context, expr2Pos, executionContext));
   	assert(expr2.get() != 0);
   
  -	return theFactory.createNumber(DoubleSupport::modulus(expr1->num(), expr2->num()));
  +	return executionContext.getXObjectFactory().createNumber(DoubleSupport::modulus(expr1->num(), expr2->num()));
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::quo(
   			XalanNode*				context,
   			int						opPos,
  @@ -1003,98 +962,90 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::neg(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  -
  -	const XObjectGuard	expr1(theFactory, executeMore(context, opPos + 2, executionContext));
  +	const XObjectPtr	expr1(executeMore(context, opPos + 2, executionContext));
   	assert(expr1.get() != 0);
   
  -	return theFactory.createNumber(DoubleSupport::negative(expr1->num()));
  +	return executionContext.getXObjectFactory().createNumber(DoubleSupport::negative(expr1->num()));
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::string(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  -
  -	XObjectGuard	expr1(theFactory, executeMore(context, opPos + 2, executionContext));
  +	XObjectPtr	expr1(executeMore(context, opPos + 2, executionContext));
   	assert(expr1.get() != 0);
   
   	// Try to optimize when the result of the execution is
   	// already a string.
   	if (expr1->getType() == XObject::eTypeString)
   	{
  -		return expr1.release();
  +		return expr1;
   	}
   	else
   	{
  -		return theFactory.createString(expr1->str());
  +		return executionContext.getXObjectFactory().createString(expr1->str());
   	}
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::boolean(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  -
  -	XObjectGuard	expr1(theFactory, executeMore(context, opPos + 2, executionContext));
  +	XObjectPtr	expr1(executeMore(context, opPos + 2, executionContext));
   	assert(expr1.get() != 0);
   
   	// Try to optimize when the result of the execution is
   	// already a boolean.
   	if (expr1->getType() == XObject::eTypeBoolean)
   	{
  -		return expr1.release();
  +		return expr1;
   	}
   	else
   	{
  -		return theFactory.createBoolean(expr1->boolean());
  +		return executionContext.getXObjectFactory().createBoolean(expr1->boolean());
   	}
   }
   
   
    
  -const XObject*
  +const XObjectPtr
   XPath::number(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  -
  -	XObjectGuard	expr1(theFactory, executeMore(context, opPos + 2, executionContext));
  +	XObjectPtr	expr1(executeMore(context, opPos + 2, executionContext));
   	assert(expr1.get() != 0);
   
   	// Try to optimize when the result of the execution is
   	// already a number.
   	if (expr1->getType() == XObject::eTypeNumber)
   	{
  -		return expr1.release();
  +		return expr1;
   	}
   	else
   	{
  -		return theFactory.createNumber(expr1->num());
  +		return executionContext.getXObjectFactory().createNumber(expr1->num());
   	}
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::Union(
   			XalanNode*				context,
   			int						opPos,
  @@ -1105,31 +1056,28 @@
   	typedef XPathExecutionContext::BorrowReturnMutableNodeRefList	BorrowReturnMutableNodeRefList;
   
   	BorrowReturnMutableNodeRefList	resultNodeList(executionContext);
  -
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  +	
   
   	while(m_expression.m_opMap[opPos] != XPathExpression::eENDOP)
   	{
   		const int	nextOpPos = m_expression.getNextOpCodePosition(opPos);
   
  -		const XObject*	expr = executeMore(context, opPos, executionContext);
  +		const XObjectPtr	expr = executeMore(context, opPos, executionContext);
   
   		const NodeRefListBase&	nl =
   				expr->nodeset();
   
  -		resultNodeList->addNodesInDocOrder(nl, executionContext);
  +		resultNodeList->addNodesInDocOrder(nl, executionContext);	
   
  -		theFactory.returnObject(expr);
  -
   		opPos = nextOpPos;
   	}
   
  -	return theFactory.createNodeSet(resultNodeList);
  +	return executionContext.getXObjectFactory().createNodeSet(resultNodeList);
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::literal(
   			XalanNode*				/* context */,
   			int						opPos,
  @@ -1145,7 +1093,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::variable(
   			XalanNode*				context,
   			int						opPos,
  @@ -1159,9 +1107,9 @@
   
   	// $$$ ToDo: I don't this will be parsed right in the first place...
   	const QName		qname(ns.str(),
  -						  varName.str());
  +						  varName.str());	
   
  -	const XObject*	result = 0;
  +	XObjectPtr result;
   
   	try
   	{
  @@ -1174,7 +1122,7 @@
   		throw;
   	}
   
  -	if(0 == result)
  +	if(result.null() == true)
   	{
   		executionContext.warn(TranscodeFromLocalCodePage("VariableReference given for variable out ") +
   								TranscodeFromLocalCodePage("of context or without definition!  Name = ") +
  @@ -1187,7 +1135,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::group(
   			XalanNode*				context,
   			int						opPos,
  @@ -1198,7 +1146,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::numberlit(
   			XalanNode*				/* context */,
   			int						opPos,
  @@ -1214,7 +1162,7 @@
     
   
   
  -const XObject*
  +const XObjectPtr
   XPath::arg(
   			XalanNode*				context,
   			int						opPos,
  @@ -1225,7 +1173,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::locationPath(
   			XalanNode*				context,
   			int						opPos,
  @@ -1272,13 +1220,13 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::predicate(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	const XObject* const	expr1 = executeMore(context, opPos + 2, executionContext);
  +	const XObjectPtr expr1 = executeMore(context, opPos + 2, executionContext);
   
   	// $$$ ToDo: This appears to be just an optimization, but is it really?
   /*
  @@ -1294,7 +1242,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::locationPathPattern(
   			XalanNode*				context,
   			int						opPos,
  @@ -1316,7 +1264,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::runExtFunction(
   			XalanNode*				context,
   			int						opPos,
  @@ -1347,25 +1295,15 @@
   		opPos = nextOpPos;
   	}
   
  -	const XObject* const		theResult =
  +	const XObjectPtr	theResult =
   		extfunction(context, opPos, ns, funcName, args, executionContext);
   
  -	XObjectFactory&		theFactory = executionContext.getXObjectFactory();
  -
  -	// Return the args...
  -	while(args.size() > 0)
  -	{
  -		theFactory.returnObject(args.back());
  -
  -		args.pop_back();
  -	}
  -
   	return theResult;
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::extfunction(
   			XalanNode*								context,
   			int										/* opPos */,
  @@ -1382,14 +1320,12 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::runFunction(
   			XalanNode*				context,
   			int						opPos,
   			XPathExecutionContext&	executionContext) const
   {
  -	const XObject*	theResult = 0;
  -
   	const int	endFunc = opPos + m_expression.m_opMap[opPos + 1] - 1;
   
   	opPos += 2;
  @@ -1411,62 +1347,62 @@
   	{
   		assert(opPos == endFunc);
   
  -		theResult =  s_functions[funcID].execute(executionContext, context);
  +		return s_functions[funcID].execute(executionContext, context);
   	}
   	else if (argCount == 1)
   	{
   		const int	nextOpPos = m_expression.getNextOpCodePosition(opPos);
   
  -		const XObjectGuard	theArg(theFactory, executeMore(context, opPos, executionContext));
  +		const XObjectPtr	theArg(executeMore(context, opPos, executionContext));
   
   		opPos = nextOpPos;
   		
   		assert(opPos == endFunc);
   
  -		theResult =  s_functions[funcID].execute(executionContext, context, theArg.get());
  +		return s_functions[funcID].execute(executionContext, context, theArg);
   	}
   	else if (argCount == 2)
   	{
   		int	nextOpPos = m_expression.getNextOpCodePosition(opPos);
   
  -		const XObjectGuard	theArg1(theFactory, executeMore(context, opPos, executionContext));
  +		const XObjectPtr	theArg1(executeMore(context, opPos, executionContext));
   
   		opPos = nextOpPos;
   
   		nextOpPos = m_expression.getNextOpCodePosition(opPos);
   
  -		const XObjectGuard	theArg2(theFactory, executeMore(context, opPos, executionContext));
  +		const XObjectPtr	theArg2(executeMore(context, opPos, executionContext));
   
   		opPos = nextOpPos;
   		
   		assert(opPos == endFunc);
   
  -		theResult =  s_functions[funcID].execute(executionContext, context, theArg1.get(), theArg2.get());
  +		return s_functions[funcID].execute(executionContext, context, theArg1, theArg2);
   	}
   	else if (argCount == 3)
   	{
   
   		int	nextOpPos = m_expression.getNextOpCodePosition(opPos);
   
  -		const XObjectGuard	theArg1(theFactory, executeMore(context, opPos, executionContext));
  +		const XObjectPtr	theArg1(executeMore(context, opPos, executionContext));
   
   		opPos = nextOpPos;
   
   		nextOpPos = m_expression.getNextOpCodePosition(opPos);
   
  -		const XObjectGuard	theArg2(theFactory, executeMore(context, opPos, executionContext));
  +		const XObjectPtr	theArg2(executeMore(context, opPos, executionContext));
   
   		opPos = nextOpPos;
   
   		nextOpPos = m_expression.getNextOpCodePosition(opPos);
   
  -		const XObjectGuard	theArg3(theFactory, executeMore(context, opPos, executionContext));
  +		const XObjectPtr	theArg3(executeMore(context, opPos, executionContext));
   
   		opPos = nextOpPos;
   
   		assert(opPos == endFunc);
   
  -		theResult =  s_functions[funcID].execute(executionContext, context, theArg1.get(), theArg2.get(), theArg3.get());
  +		return s_functions[funcID].execute(executionContext, context, theArg1, theArg2, theArg3);
   	}
   	else
   	{
  @@ -1484,24 +1420,14 @@
   
   			opPos = nextOpPos;
   		}
  -
  -		theResult = function(context, opPos, funcID, args, executionContext);
  -
  -		// Return the args...
  -		while(args.size() > 0)
  -		{
  -			theFactory.returnObject(args.back());
   
  -			args.pop_back();
  -		}
  +		return function(context, opPos, funcID, args, executionContext);
   	}
  -
  -	return theResult;
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   XPath::function(
   			XalanNode*								context,
   			int										opPos,
  
  
  
  1.19      +37 -37    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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- XPath.hpp	2000/11/08 17:03:12	1.18
  +++ XPath.hpp	2000/11/21 21:08:32	1.19
  @@ -151,7 +151,7 @@
   	 * @param executionContext current execution context
   	 * @return pointer to union of node-set operands
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	execute(
   			XalanNode*				context,
   			const PrefixResolver&	prefixResolver,
  @@ -166,7 +166,7 @@
   	 * @param executionContext current execution context
   	 * @return pointer to union of node-set operands
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	execute(
   			XalanNode*				context,
   			const PrefixResolver&	prefixResolver,
  @@ -181,7 +181,7 @@
   	 * @param executionContext current execution context
   	 * @return pointer to result XObject
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	execute(XPathExecutionContext&	executionContext) const;
   
   	/**
  @@ -192,7 +192,7 @@
   	 * @param executionContext current execution context
   	 * @return pointer to union of node-set operands
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	executeMore(
   			XalanNode* 				context,
   			int 					opPos,
  @@ -206,7 +206,7 @@
   	 * @param executionContext current execution context
   	 * @return node-set
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	locationPath(
   			XalanNode*				context,
   			int						opPos,
  @@ -331,7 +331,7 @@
   	 * @param executionContext current execution context
   	 * @return pointer to either a boolean or a number
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	predicate(
   			XalanNode*				context,
   			int						opPos,
  @@ -437,7 +437,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return The result of the expression.
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	xpath(
   			XalanNode*				context,
   			int						opPos,
  @@ -449,7 +449,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return the match score in the form of an XObject.
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	matchPattern(
   			XalanNode*				context,
   			int						opPos,
  @@ -477,7 +477,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return XBoolean set to true if the one of the two arguments are true.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	Or(
   			XalanNode*				context,
   			int						opPos,
  @@ -489,7 +489,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return XBoolean set to true if the two arguments are both true.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	And(
   			XalanNode*				context,
   			int						opPos,
  @@ -501,7 +501,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return XBoolean set to true if the two arguments are not equal.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	notequals(
   			XalanNode*				context,
   			int						opPos,
  @@ -513,7 +513,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return XBoolean set to true if the two arguments are equal.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	equals(
   			XalanNode*				context,
   			int						opPos,
  @@ -525,7 +525,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return XBoolean set to true if arg 1 is less than or equal to arg 2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	lte(
   			XalanNode*				context,
   			int						opPos,
  @@ -537,7 +537,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return XBoolean set to true if arg 1 is less than arg 2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	lt(
   			XalanNode*				context,
   			int						opPos,
  @@ -549,7 +549,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return XBoolean set to true if arg 1 is greater than or equal to arg 2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	gte(
   			XalanNode*				context,
   			int						opPos,
  @@ -561,7 +561,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return XBoolean set to true if arg 1 is greater than arg 2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	gt(
   			XalanNode*				context,
   			int						opPos,
  @@ -573,7 +573,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return sum of arg1 and arg2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	plus(
   			XalanNode*				context,
   			int						opPos,
  @@ -585,7 +585,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return difference of arg1 and arg2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	minus(
   			XalanNode*				context,
   			int						opPos,
  @@ -597,7 +597,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return arg1 * arg2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	mult(
   			XalanNode*				context,
   			int						opPos,
  @@ -609,7 +609,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return arg1 / arg2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	div(
   			XalanNode*				context,
   			int						opPos,
  @@ -621,7 +621,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return arg1 mod arg2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	mod(
   			XalanNode*				context,
   			int						opPos,
  @@ -634,7 +634,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return arg1 mod arg2.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	quo(
   			XalanNode*				context,
   			int						opPos,
  @@ -646,7 +646,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return -arg.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	neg(
   			XalanNode*				context,
   			int						opPos,
  @@ -658,7 +658,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return arg cast to a string.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	string(
   			XalanNode*				context,
   			int						opPos,
  @@ -670,7 +670,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return arg cast to a boolean.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	boolean(
   			XalanNode*				context,
   			int						opPos,
  @@ -682,7 +682,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return arg cast to a number.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	number(
   			XalanNode*				context,
   			int						opPos,
  @@ -694,7 +694,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return the union of node-set operands.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	Union(
   			XalanNode*				context,
   			int						opPos,
  @@ -706,7 +706,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return an XObject object.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	literal(
   			XalanNode*				context,
   			int						opPos,
  @@ -718,7 +718,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return an XObject object.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	variable(
   			XalanNode*				context,
   			int						opPos,
  @@ -730,7 +730,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return arg.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	group(
   			XalanNode*				context,
   			int						opPos,
  @@ -742,7 +742,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return an XObject object.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	numberlit(
   			XalanNode*				context,
   			int						opPos,
  @@ -754,7 +754,7 @@
   	 * @param opPos The current position in the m_opMap array.
   	 * @return the result of the argument expression.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	arg(
   			XalanNode*				context,
   			int						opPos,
  @@ -767,7 +767,7 @@
   	 * @return score in an XNumber, one of MATCH_SCORE_NODETEST, 
   	 * MATCH_SCORE_NONE, MATCH_SCORE_OTHER, MATCH_SCORE_QNAME.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	locationPathPattern(
   			XalanNode*				context,
   			int						opPos,
  @@ -776,7 +776,7 @@
   	/**
   	 * Setup for and run an extension function.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	runExtFunction(
   			XalanNode*				context,
   			int						opPos,
  @@ -785,7 +785,7 @@
   	/**
   	 * Handle an extension function.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	extfunction(
   			XalanNode*								context,
   			int										opPos,
  @@ -797,7 +797,7 @@
   	/**
   	 * Setup for and run a function.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	runFunction(
   			XalanNode*				context,
   			int						opPos,
  @@ -806,7 +806,7 @@
   	/**
   	 * Handle a built-in function.
   	 */
  -	const XObject*
  +	const XObjectPtr
   	function(
   			XalanNode*								context,
   			int										opPos,
  
  
  
  1.12      +1 -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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XPathEnvSupport.hpp	2000/08/14 22:07:23	1.11
  +++ XPathEnvSupport.hpp	2000/11/21 21:08:33	1.12
  @@ -194,7 +194,7 @@
   	 * @param argVec        vector of arguments to function
   	 * @return pointer to XObject result
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	extFunction(
   			XPathExecutionContext&			executionContext,
   			const XalanDOMString&			theNamespace,
  
  
  
  1.21      +4 -6      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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- XPathEnvSupportDefault.cpp	2000/09/20 21:12:02	1.20
  +++ XPathEnvSupportDefault.cpp	2000/11/21 21:08:33	1.21
  @@ -423,7 +423,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   XPathEnvSupportDefault::extFunction(
   			XPathExecutionContext&			executionContext,
   			const XalanDOMString&			theNamespace,
  @@ -431,13 +431,11 @@
   			XalanNode*						context,
   			const XObjectArgVectorType&		argVec) const
   {
  -	XObject*	theResult = 0;
  -
   	Function* const		theFunction = findFunction(theNamespace, functionName);
   
   	if (theFunction != 0)
   	{
  -		theResult = theFunction->execute(
  +		return theFunction->execute(
   					executionContext,
   					context,
   					0,
  @@ -456,9 +454,9 @@
   		theFunctionName += functionName;
   
   		throw XPathExceptionFunctionNotAvailable(theFunctionName);
  -	}
   
  -	return theResult;
  +		return XObjectPtr();
  +	}
   }
   
   
  
  
  
  1.18      +1 -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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- XPathEnvSupportDefault.hpp	2000/09/20 21:12:03	1.17
  +++ XPathEnvSupportDefault.hpp	2000/11/21 21:08:35	1.18
  @@ -198,7 +198,7 @@
   			const XalanDOMString&	theNamespace, 
   			const XalanDOMString&	functionName) const;
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	extFunction(
   			XPathExecutionContext&			executionContext,
   			const XalanDOMString&			theNamespace,
  
  
  
  1.28      +6 -5      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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- XPathExecutionContext.hpp	2000/11/20 20:04:31	1.27
  +++ XPathExecutionContext.hpp	2000/11/21 21:08:35	1.28
  @@ -91,6 +91,7 @@
   class XLocator;
   class XMLURL;
   class XObject;
  +class XObjectPtr;
   class XObjectFactory;
   class XalanDocument;
   class XalanElement;
  @@ -109,9 +110,9 @@
   public:
   
   #if defined(XALAN_NO_NAMESPACES)
  -	typedef vector<const XObject*>			XObjectArgVectorType;
  +	typedef vector<XObjectPtr>			XObjectArgVectorType;
   #else
  -	typedef std::vector<const XObject*>		XObjectArgVectorType;
  +	typedef std::vector<XObjectPtr>		XObjectArgVectorType;
   #endif
   
   	explicit
  @@ -182,7 +183,7 @@
   	 * @param node	The  node queried
   	 * @return a pointer to the XObject instance.
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	createNodeSet(XalanNode&	theNode) = 0;
   
   	/**
  @@ -360,7 +361,7 @@
   	 * @param argVec        vector of arguments to function
   	 * @return pointer to XObject result
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	extFunction(
   			const XalanDOMString&			theNamespace,
   			const XalanDOMString&			functionName,
  @@ -558,7 +559,7 @@
   	 * @param theName name of variable
   	 * @return pointer to an XObject if the variable was found, 0 if it was not
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	getVariable(const QName&	name) const = 0;
   
   	/**
  
  
  
  1.25      +3 -3      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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- XPathExecutionContextDefault.cpp	2000/11/20 20:04:31	1.24
  +++ XPathExecutionContextDefault.cpp	2000/11/21 21:08:36	1.25
  @@ -164,7 +164,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   XPathExecutionContextDefault::createNodeSet(XalanNode&	theNode)
   {
   	// This list will hold the node...
  @@ -313,7 +313,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPathExecutionContextDefault::extFunction(
   			const XalanDOMString&			theNamespace,
   			const XalanDOMString&			functionName, 
  @@ -447,7 +447,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XPathExecutionContextDefault::getVariable(const QName&	name) const
   {
   	return m_xobjectFactory.createUnknown(name.getLocalPart());
  
  
  
  1.25      +3 -3      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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- XPathExecutionContextDefault.hpp	2000/11/20 20:04:31	1.24
  +++ XPathExecutionContextDefault.hpp	2000/11/21 21:08:37	1.25
  @@ -138,7 +138,7 @@
   	virtual XObjectFactory&
   	getXObjectFactory() const;
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	createNodeSet(XalanNode&	theNode);
   
   	virtual bool
  @@ -193,7 +193,7 @@
   			const XalanDOMString&	theNamespace, 
   			const XalanDOMString&	functionName) const;
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	extFunction(
   			const XalanDOMString&			theNamespace,
   			const XalanDOMString&			functionName,
  @@ -239,7 +239,7 @@
   			const PrefixResolver&	resolver,
   			MutableNodeRefList&		nodelist);
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	getVariable(
   			const QName&	name) const;
   
  
  
  
  1.19      +14 -0     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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- XPathExpression.cpp	2000/11/02 01:46:02	1.18
  +++ XPathExpression.cpp	2000/11/21 21:08:38	1.19
  @@ -367,6 +367,20 @@
   
   
   
  +void 
  +XPathExpression::XToken::referenced()
  +{
  +}
  +
  +
  +
  +void 
  +XPathExpression::XToken::dereferenced()
  +{
  +}
  +
  +
  +
   XPathExpression::XPathExpression() :
   	m_opMap(),
   	m_lastOpCodeIndex(0),
  
  
  
  1.12      +8 -0      xml-xalan/c/src/XPath/XPathExpression.hpp
  
  Index: XPathExpression.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExpression.hpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XPathExpression.hpp	2000/11/02 01:46:02	1.11
  +++ XPathExpression.hpp	2000/11/21 21:08:38	1.12
  @@ -784,6 +784,14 @@
   		XToken&
   		operator=(double	theNumber);
   
  +	protected:
  +
  +		virtual void 
  +		referenced();
  +
  +		virtual void 
  +		dereferenced();
  +
   	private:
   
   		// Not defined...
  
  
  
  1.27      +3 -2      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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- XPathProcessorImpl.cpp	2000/11/02 01:46:02	1.26
  +++ XPathProcessorImpl.cpp	2000/11/21 21:08:39	1.27
  @@ -1988,10 +1988,11 @@
   				{
   					const XObject* const	theToken =
   						m_expression->getRelativeToken(-1);
  +					assert(theToken != 0);
   
  -					const XalanDOMString	theString = theToken->str();
  +					const XalanDOMString&	theString = theToken->str();
   
  -					const XalanDOMString	theNamespace =
  +					const XalanDOMString&	theNamespace =
   						m_prefixResolver->getNamespaceForPrefix(theString);
   
   					m_expression->replaceRelativeToken(
  
  
  
  1.7       +1 -3      xml-xalan/c/src/XSLT/AVTPartXPath.cpp
  
  Index: AVTPartXPath.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVTPartXPath.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AVTPartXPath.cpp	2000/08/10 18:43:03	1.6
  +++ AVTPartXPath.cpp	2000/11/21 21:09:55	1.7
  @@ -85,9 +85,7 @@
   			const PrefixResolver&	prefixResolver,
   			XPathExecutionContext&	executionContext) const
   {
  -	const XObjectGuard		xobj(
  -								executionContext.getXObjectFactory(),
  -								m_pXPath->execute(contextNode, prefixResolver, executionContext));
  +	const XObjectPtr	xobj(m_pXPath->execute(contextNode, prefixResolver, executionContext));
   
   	if(0 != xobj.get())
   	{
  
  
  
  1.9       +3 -5      xml-xalan/c/src/XSLT/ElemChoose.cpp
  
  Index: ElemChoose.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemChoose.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ElemChoose.cpp	2000/11/02 01:46:20	1.8
  +++ ElemChoose.cpp	2000/11/21 21:09:56	1.9
  @@ -134,10 +134,8 @@
   			const XPath* const		theXPath = when->getXPath();
   			assert(theXPath != 0);
   
  -			const XObjectGuard		test(
  -								executionContext.getXObjectFactory(),
  -								theXPath->execute(sourceNode, *this, executionContext));
  -			assert(test.get() != 0);
  +			const XObjectPtr	test(theXPath->execute(sourceNode, *this, executionContext));
  +			assert(test.null() == false);
   
   			if(0 != executionContext.getTraceListeners())
   			{
  @@ -147,7 +145,7 @@
   					*when,
   					StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("test")),
   					*theXPath,
  -					test.get()));
  +					test));
   			}
   
   			if(test->boolean() == true)
  
  
  
  1.10      +3 -5      xml-xalan/c/src/XSLT/ElemCopyOf.cpp
  
  Index: ElemCopyOf.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemCopyOf.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ElemCopyOf.cpp	2000/11/02 01:46:21	1.9
  +++ ElemCopyOf.cpp	2000/11/21 21:09:56	1.10
  @@ -123,10 +123,8 @@
   
   	assert(m_pSelectPattern != 0);
   
  -	const XObjectGuard		value(
  -								executionContext.getXObjectFactory(),
  -								m_pSelectPattern->execute(sourceNode, *this, executionContext));
  -	assert(value.get() != 0);
  +	const XObjectPtr	value(m_pSelectPattern->execute(sourceNode, *this, executionContext));
  +	assert(value.null() == false);
   
   	if(0 != executionContext.getTraceListeners())
   	{
  @@ -137,7 +135,7 @@
   				*this,
   				StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("select")),
   				*m_pSelectPattern,
  -				value.get()));
  +				value));
   	}
   
   	const XObject::eObjectType	type = value->getType();
  
  
  
  1.9       +3 -5      xml-xalan/c/src/XSLT/ElemIf.cpp
  
  Index: ElemIf.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemIf.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ElemIf.cpp	2000/11/02 01:46:24	1.8
  +++ ElemIf.cpp	2000/11/21 21:09:57	1.9
  @@ -141,10 +141,8 @@
   
   	ElemTemplateElement::execute(executionContext,	sourceTree, sourceNode, mode);
   
  -	const XObjectGuard		test(
  -								executionContext.getXObjectFactory(),
  -								m_test->execute(sourceNode, *this, executionContext));
  -	assert(test.get() != 0);
  +	const XObjectPtr	test(m_test->execute(sourceNode, *this, executionContext));
  +	assert(test.null() == false);
   
   	if(0 != executionContext.getTraceListeners())
   	{
  @@ -154,7 +152,7 @@
   			*this, 
   			StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("test")),
   			*m_test, 
  -			test.get()));
  +			test));
   	}
   
   	if(test->boolean())
  
  
  
  1.30      +2 -4      xml-xalan/c/src/XSLT/ElemNumber.cpp
  
  Index: ElemNumber.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemNumber.cpp,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ElemNumber.cpp	2000/11/09 20:38:15	1.29
  +++ ElemNumber.cpp	2000/11/21 21:09:57	1.30
  @@ -378,10 +378,8 @@
   
   	if(0 != m_valueExpr)
   	{
  -		const XObjectGuard		countObj(
  -				executionContext.getXObjectFactory(),
  -				m_valueExpr->execute(sourceNode, *this, executionContext));
  -		assert(countObj.get() != 0);
  +		const XObjectPtr	countObj(m_valueExpr->execute(sourceNode, *this, executionContext));
  +		assert(countObj.null() == false);
   
   		const double	theValue = countObj->num();
   
  
  
  
  1.7       +2 -2      xml-xalan/c/src/XSLT/ElemParam.cpp
  
  Index: ElemParam.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemParam.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ElemParam.cpp	2000/11/02 01:46:25	1.6
  +++ ElemParam.cpp	2000/11/21 21:09:58	1.7
  @@ -96,9 +96,9 @@
   			XalanNode*						sourceNode,
   			const QName&					mode) const
   {
  -	const XObject* const	obj = executionContext.getParamVariable(m_qname);
  +	const XObjectPtr	obj = executionContext.getParamVariable(m_qname);
   
  -	if(0 == obj)
  +	if(obj.null() == true)
   	{
   		ElemVariable::execute(executionContext, sourceTree, sourceNode, mode);
   	}
  
  
  
  1.40      +4 -6      xml-xalan/c/src/XSLT/ElemTemplateElement.cpp
  
  Index: ElemTemplateElement.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.cpp,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- ElemTemplateElement.cpp	2000/11/20 20:04:37	1.39
  +++ ElemTemplateElement.cpp	2000/11/21 21:09:59	1.40
  @@ -634,7 +634,7 @@
   
   	if (0 != selectPattern)
   	{
  -		const XObject*	theXObject = 0;
  +		XObjectPtr	theXObject;
   
   		{
   			SetAndRestoreCurrentStackFrameIndex		theSetAndRestore(
  @@ -663,11 +663,9 @@
   		}
   
   		// @@ JMD: Should this be an assert ??
  -		if (0 != theXObject)
  +		if (theXObject.null() == false)
   		{
  -			const XObjectGuard	result(
  -					executionContext.getXObjectFactory(),
  -					theXObject);
  +			const XObjectPtr	result(theXObject);
   
   			const NodeRefListBase&	sourceNodes = result->nodeset();
   
  @@ -679,7 +677,7 @@
   							*this,
   							StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("select")),
   							*selectPattern,
  -							result.get()));
  +							result));
   			}
   
   			const unsigned int	nNodes = sourceNodes.getLength();
  
  
  
  1.15      +7 -11     xml-xalan/c/src/XSLT/ElemValueOf.cpp
  
  Index: ElemValueOf.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemValueOf.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ElemValueOf.cpp	2000/11/20 20:04:37	1.14
  +++ ElemValueOf.cpp	2000/11/21 21:10:00	1.15
  @@ -197,16 +197,14 @@
   	}
   	else
   	{
  -		const XObjectGuard		value(
  -								executionContext.getXObjectFactory(),
  -								m_selectPattern->execute(sourceNode, *this, executionContext));
  +		const XObjectPtr	value(m_selectPattern->execute(sourceNode, *this, executionContext));
   
   		if(0 != executionContext.getTraceListeners())
   		{
  -			fireSelectionEvent(executionContext, sourceNode, value.get());
  +			fireSelectionEvent(executionContext, sourceNode, value);
   		}
  -
  -		if(0 != value.get())
  +		
  +		if(value.null() == false)	
   		{
   			const XObject::eObjectType	type = value->getType();
   
  @@ -248,11 +246,9 @@
   			XalanNode*						sourceNode,
   			const XalanDOMString&			theValue) const
   {
  -	const XObjectGuard		value(
  -			executionContext.getXObjectFactory(),
  -			executionContext.getXObjectFactory().createString(theValue));
  +	const XObjectPtr value(executionContext.getXObjectFactory().createString(theValue));
   
  -	fireSelectionEvent(executionContext, sourceNode, value.get());
  +	fireSelectionEvent(executionContext, sourceNode, value);
   }
   
   
  @@ -261,7 +257,7 @@
   ElemValueOf::fireSelectionEvent(
   			StylesheetExecutionContext&		executionContext,
   			XalanNode*						sourceNode,
  -			const XObject*					theValue) const
  +			const XObjectPtr				theValue) const
   {
   	executionContext.fireSelectEvent(
   				SelectionEvent(
  
  
  
  1.8       +2 -2      xml-xalan/c/src/XSLT/ElemValueOf.hpp
  
  Index: ElemValueOf.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemValueOf.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ElemValueOf.hpp	2000/11/02 01:46:26	1.7
  +++ ElemValueOf.hpp	2000/11/21 21:10:01	1.8
  @@ -69,7 +69,7 @@
   
   
   
  -class XObject;
  +class XObjectPtr;
   class XPath;
   
   
  @@ -131,7 +131,7 @@
   	fireSelectionEvent(
   			StylesheetExecutionContext&		executionContext,
   			XalanNode*						sourceNode,
  -			const XObject*					theValue) const;
  +			const XObjectPtr				theValue) const;
   
   	/**
   	 * The select pattern used to locate the value.
  
  
  
  1.8       +4 -4      xml-xalan/c/src/XSLT/ElemVariable.hpp
  
  Index: ElemVariable.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemVariable.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ElemVariable.hpp	2000/11/02 22:26:01	1.7
  +++ ElemVariable.hpp	2000/11/21 21:10:01	1.8
  @@ -58,7 +58,7 @@
   #define XALAN_ELEMVARIABLE_HEADER_GUARD 
   
   /**
  - * $Id: ElemVariable.hpp,v 1.7 2000/11/02 22:26:01 dbertoni Exp $
  + * $Id: ElemVariable.hpp,v 1.8 2000/11/21 21:10:01 auriemma Exp $
    * 
    * $State: Exp $
    * 
  @@ -75,14 +75,14 @@
   
   
   #include <XPath/QName.hpp>
  +#include <XPath/XObject.hpp>
   
   
  -
   #include <XSLT/Constants.hpp>
   
   
   
  -class XObject;
  +class XObjectPtr;
   
   
   
  @@ -170,7 +170,7 @@
   
   	bool			m_isTopLevel;
   
  -	const XObject*	m_value;
  +	XObjectPtr		m_value;
   
   	XalanNode*		m_varContext;
   };
  
  
  
  1.7       +1 -1      xml-xalan/c/src/XSLT/ExtensionFunctionHandler.cpp
  
  Index: ExtensionFunctionHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ExtensionFunctionHandler.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ExtensionFunctionHandler.cpp	2000/11/02 01:46:26	1.6
  +++ ExtensionFunctionHandler.cpp	2000/11/21 21:10:02	1.7
  @@ -158,7 +158,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   ExtensionFunctionHandler::callFunction(
   			const XalanDOMString&	/* funcName */,
   			const ArgVectorType&	/* args */)
  
  
  
  1.9       +6 -2      xml-xalan/c/src/XSLT/ExtensionFunctionHandler.hpp
  
  Index: ExtensionFunctionHandler.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ExtensionFunctionHandler.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ExtensionFunctionHandler.hpp	2000/11/02 01:46:26	1.8
  +++ ExtensionFunctionHandler.hpp	2000/11/21 21:10:04	1.9
  @@ -77,10 +77,14 @@
   
   
   
  -class XObject;
  +#include <XPath/XObject.hpp>
   
   
   
  +class XObjectPtr;
  +
  +
  +
   /**
    * Class handling an extension namespace for XPath. Provides functions
    * to test a function's existence and call a function
  @@ -185,7 +189,7 @@
   	 * @exception SAXException          if parsing trouble
   	 */
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	callFunction(
   			const XalanDOMString&	funcName,
   			const ArgVectorType&	args);
  
  
  
  1.9       +2 -2      xml-xalan/c/src/XSLT/ExtensionNSHandler.cpp
  
  Index: ExtensionNSHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ExtensionNSHandler.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ExtensionNSHandler.cpp	2000/11/02 01:46:26	1.8
  +++ ExtensionNSHandler.cpp	2000/11/21 21:10:05	1.9
  @@ -212,7 +212,7 @@
   			const XalanNode*				/* sourceNode */,
   			const QName&					/* mode */)
   {
  -	const XObject*	result = 0;
  +	XObjectPtr	result;
   
   	if (!m_componentStarted) 
   	{
  @@ -246,7 +246,7 @@
   		} 
   	}
   
  -	if (result != 0) 
  +	if (result.null() == false) 
   	{
   		executionContext.outputToResultTree(*result);
   	}
  
  
  
  1.8       +1 -1      xml-xalan/c/src/XSLT/FunctionCurrent.cpp
  
  Index: FunctionCurrent.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionCurrent.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionCurrent.cpp	2000/11/10 16:46:20	1.7
  +++ FunctionCurrent.cpp	2000/11/21 21:10:05	1.8
  @@ -70,7 +70,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionCurrent::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context)
  
  
  
  1.6       +1 -1      xml-xalan/c/src/XSLT/FunctionCurrent.hpp
  
  Index: FunctionCurrent.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionCurrent.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionCurrent.hpp	2000/11/06 19:21:22	1.5
  +++ FunctionCurrent.hpp	2000/11/21 21:10:06	1.6
  @@ -91,7 +91,7 @@
   
   	// These methods are inherited from XPath/Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context);
  
  
  
  1.19      +9 -9      xml-xalan/c/src/XSLT/FunctionDocument.cpp
  
  Index: FunctionDocument.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionDocument.cpp,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- FunctionDocument.cpp	2000/11/10 16:46:20	1.18
  +++ FunctionDocument.cpp	2000/11/21 21:10:06	1.19
  @@ -138,14 +138,14 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionDocument::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1,
  -		const XObject*					arg2)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2)
   {
  -	assert(arg1 != 0 || arg2 != 0);	
  +	assert(arg1.null() == false && arg2.null() == false);
   
   	XalanDOMString				base;
   
  @@ -198,13 +198,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionDocument::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);	
  +	assert(arg1.null() == false);
   
   	if (context == 0)
   	{
  @@ -225,11 +225,11 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionDocument::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg,
  +		const XObjectPtr				arg,
   		XalanDOMString*					base,
   		int								argCount)
   {
  
  
  
  1.5       +7 -7      xml-xalan/c/src/XSLT/FunctionDocument.hpp
  
  Index: FunctionDocument.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionDocument.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionDocument.hpp	2000/11/06 19:21:25	1.4
  +++ FunctionDocument.hpp	2000/11/21 21:10:07	1.5
  @@ -81,18 +81,18 @@
   
   	// These methods are inherited from XPath/Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1);
  +		const XObjectPtr				arg1);
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,
  -		const XObject*					arg1,		
  -		const XObject*					arg2);
  +		const XObjectPtr				arg1,		
  +		const XObjectPtr				arg2);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  @@ -103,11 +103,11 @@
   
   private:
   
  -	XObject*
  +	XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg,
  +			const XObjectPtr				arg,
   			XalanDOMString*					base,
   			int								argCount);
   
  
  
  
  1.8       +3 -3      xml-xalan/c/src/XSLT/FunctionElementAvailable.cpp
  
  Index: FunctionElementAvailable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionElementAvailable.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionElementAvailable.cpp	2000/11/10 16:46:20	1.7
  +++ FunctionElementAvailable.cpp	2000/11/21 21:10:07	1.8
  @@ -74,13 +74,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionElementAvailable::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);
   
   	const XalanDOMString&	fullName = arg1->str();
   
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XSLT/FunctionElementAvailable.hpp
  
  Index: FunctionElementAvailable.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionElementAvailable.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionElementAvailable.hpp	2000/11/06 19:21:28	1.2
  +++ FunctionElementAvailable.hpp	2000/11/21 21:10:08	1.3
  @@ -91,11 +91,11 @@
   
   	// These methods are inherited from XPath/Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.8       +9 -9      xml-xalan/c/src/XSLT/FunctionFormatNumber.cpp
  
  Index: FunctionFormatNumber.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionFormatNumber.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionFormatNumber.cpp	2000/11/10 16:46:20	1.7
  +++ FunctionFormatNumber.cpp	2000/11/21 21:10:08	1.8
  @@ -81,14 +81,14 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionFormatNumber::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1,
  -		const XObject*					arg2)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2)
   {
  -	assert(arg1 != 0 || arg2 != 0);	
  +	assert(arg1.null() == false && arg2.null() == false);	
   	
   	const double						theNumber = arg1->num();
   	const XalanDOMString&				thePattern = arg2->str();
  @@ -112,15 +112,15 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionFormatNumber::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1, 
  -		const XObject*					arg2,
  -		const XObject*					arg3)
  +		const XObjectPtr				arg1, 
  +		const XObjectPtr				arg2,
  +		const XObjectPtr				arg3)
   {
  -	assert(arg1 != 0 || arg2 != 0 || arg3 != 0);
  +	assert(arg1.null() == false && arg2.null() == false && arg3.null() == false);
   	
   	const double						theNumber = arg1->num();
   	const XalanDOMString&				thePattern = arg2->str();
  
  
  
  1.7       +7 -7      xml-xalan/c/src/XSLT/FunctionFormatNumber.hpp
  
  Index: FunctionFormatNumber.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionFormatNumber.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FunctionFormatNumber.hpp	2000/11/06 19:21:31	1.6
  +++ FunctionFormatNumber.hpp	2000/11/21 21:10:08	1.7
  @@ -95,20 +95,20 @@
   
   	// These methods are inherited from XPath/Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1,
  -			const XObject*					arg2);
  +			const XObjectPtr				arg1,
  +			const XObjectPtr				arg2);
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1, 
  -			const XObject*					arg2,
  -			const XObject*					arg3);
  +			const XObjectPtr				arg1, 
  +			const XObjectPtr				arg2,
  +			const XObjectPtr				arg3);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.8       +3 -3      xml-xalan/c/src/XSLT/FunctionFunctionAvailable.cpp
  
  Index: FunctionFunctionAvailable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionFunctionAvailable.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionFunctionAvailable.cpp	2000/11/10 16:46:20	1.7
  +++ FunctionFunctionAvailable.cpp	2000/11/21 21:10:09	1.8
  @@ -74,13 +74,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionFunctionAvailable::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);
   
   	const XalanDOMString&	fullName = arg1->str();
   
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XSLT/FunctionFunctionAvailable.hpp
  
  Index: FunctionFunctionAvailable.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionFunctionAvailable.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FunctionFunctionAvailable.hpp	2000/11/06 19:21:34	1.2
  +++ FunctionFunctionAvailable.hpp	2000/11/21 21:10:10	1.3
  @@ -91,11 +91,11 @@
   
   	// These methods are inherited from XPath/Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.8       +10 -6     xml-xalan/c/src/XSLT/FunctionGenerateID.cpp
  
  Index: FunctionGenerateID.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionGenerateID.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionGenerateID.cpp	2000/11/20 20:04:37	1.7
  +++ FunctionGenerateID.cpp	2000/11/21 21:10:11	1.8
  @@ -114,13 +114,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionGenerateID::execute(
  -			XPathExecutionContext&		executionContext,
  -			XalanNode*					context,			
  -			const XObject*				arg1)
  +			XPathExecutionContext&	executionContext,
  +			XalanNode*				context,			
  +			const XObjectPtr		arg1)
   {
  -	assert(arg1 != 0);	
  +	assert(arg1.null() == false);
   
   	const NodeRefListBase&	theNodeList = arg1->nodeset();
   
  @@ -136,7 +136,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionGenerateID::execute(
   			XPathExecutionContext&		executionContext,
   			XalanNode*					context)
  @@ -156,9 +156,13 @@
   		getSuffix(context, theID);
   		assert(length(theID) != 0);
   
  +#if defined(XALAN_USE_XERCES_DOMSTRING)
  +		return executionContext.getXObjectFactory().createString(m_prefix + theID);
  +#else
   		insert(theID, 0, m_prefix);
   
   		return executionContext.getXObjectFactory().createString(theID);
  +#endif
   	}
   }
   
  
  
  
  1.7       +3 -3      xml-xalan/c/src/XSLT/FunctionGenerateID.hpp
  
  Index: FunctionGenerateID.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionGenerateID.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FunctionGenerateID.hpp	2000/11/20 20:04:37	1.6
  +++ FunctionGenerateID.hpp	2000/11/21 21:10:12	1.7
  @@ -83,13 +83,13 @@
   
   	// These methods are inherited from XPath/Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1);
  +		const XObjectPtr				arg1);
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context);
  
  
  
  1.16      +5 -5      xml-xalan/c/src/XSLT/FunctionKey.cpp
  
  Index: FunctionKey.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionKey.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- FunctionKey.cpp	2000/11/10 16:46:20	1.15
  +++ FunctionKey.cpp	2000/11/21 21:10:13	1.16
  @@ -100,14 +100,14 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionKey::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1,
  -		const XObject*					arg2)
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2)
   {
  -	assert(arg1 != 0 || arg2 != 0);	
  +	assert(arg1.null() == false && arg2.null() == false);
   
   	if (context == 0)
   	{
  @@ -137,7 +137,7 @@
   
   		const XalanDOMString	keyname = arg1->str();
   
  -		assert(arg2 != 0);
  +		assert(arg2.null() == false);
   
   		const bool				argIsNodeSet =
   				XObject::eTypeNodeSet == arg2->getType() ? true : false;
  
  
  
  1.7       +3 -3      xml-xalan/c/src/XSLT/FunctionKey.hpp
  
  Index: FunctionKey.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionKey.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FunctionKey.hpp	2000/11/06 19:21:41	1.6
  +++ FunctionKey.hpp	2000/11/21 21:10:13	1.7
  @@ -90,12 +90,12 @@
   
   	// These methods are inherited from XPath/Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1,
  -		const XObject*					arg2);
  +		const XObjectPtr				arg1,
  +		const XObjectPtr				arg2);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.14      +3 -3      xml-xalan/c/src/XSLT/FunctionSystemProperty.cpp
  
  Index: FunctionSystemProperty.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionSystemProperty.cpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FunctionSystemProperty.cpp	2000/11/10 16:46:20	1.13
  +++ FunctionSystemProperty.cpp	2000/11/21 21:10:14	1.14
  @@ -85,13 +85,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionSystemProperty::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						/* context */,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);
   
   	const XalanDOMString&	fullName = arg1->str();
   	const unsigned int		fullNameLength = length(fullName);
  
  
  
  1.5       +2 -2      xml-xalan/c/src/XSLT/FunctionSystemProperty.hpp
  
  Index: FunctionSystemProperty.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionSystemProperty.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionSystemProperty.hpp	2000/11/06 19:21:44	1.4
  +++ FunctionSystemProperty.hpp	2000/11/21 21:10:14	1.5
  @@ -81,11 +81,11 @@
   
   	// These methods are inherited from XPath/Function ...
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.9       +3 -3      xml-xalan/c/src/XSLT/FunctionUnparsedEntityURI.cpp
  
  Index: FunctionUnparsedEntityURI.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionUnparsedEntityURI.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionUnparsedEntityURI.cpp	2000/11/10 16:46:20	1.8
  +++ FunctionUnparsedEntityURI.cpp	2000/11/21 21:10:14	1.9
  @@ -75,13 +75,13 @@
   
   
   
  -XObject*
  +XObjectPtr
   FunctionUnparsedEntityURI::execute(
   		XPathExecutionContext&			executionContext,
   		XalanNode*						context,			
  -		const XObject*					arg1)
  +		const XObjectPtr				arg1)
   {
  -	assert(arg1 != 0);
  +	assert(arg1.null() == false);
   
   	if (context == 0)
   	{
  
  
  
  1.5       +2 -2      xml-xalan/c/src/XSLT/FunctionUnparsedEntityURI.hpp
  
  Index: FunctionUnparsedEntityURI.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionUnparsedEntityURI.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionUnparsedEntityURI.hpp	2000/11/06 19:21:48	1.4
  +++ FunctionUnparsedEntityURI.hpp	2000/11/21 21:10:15	1.5
  @@ -88,11 +88,11 @@
   
   	// These methods are inherited from XPath/Function ...
   	
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,			
  -			const XObject*					arg1);
  +			const XObjectPtr				arg1);
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
   	virtual Function*
  
  
  
  1.13      +1 -1      xml-xalan/c/src/XSLT/KeyTable.cpp
  
  Index: KeyTable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/KeyTable.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- KeyTable.cpp	2000/11/02 01:46:27	1.12
  +++ KeyTable.cpp	2000/11/21 21:10:16	1.13
  @@ -169,7 +169,7 @@
   							// use attribute in xsl:key.
   							assert(kd.getUse() != 0);
   
  -							const XObject* const	xuse =
  +							const XObjectPtr	xuse =
   								kd.getUse()->execute(testNode, resolver, NodeRefList(), executionContext);
   
   							const NodeRefListBase*	nl = 0;
  
  
  
  1.16      +4 -7      xml-xalan/c/src/XSLT/NodeSorter.cpp
  
  Index: NodeSorter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NodeSorter.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- NodeSorter.cpp	2000/09/19 15:12:03	1.15
  +++ NodeSorter.cpp	2000/11/21 21:10:17	1.16
  @@ -301,10 +301,8 @@
   		}
   	}
   
  -	const XObjectGuard	result(
  -		m_executionContext.getXObjectFactory(),
  -		xpath->execute(node, *theKey.getPrefixResolver(), dummy, m_executionContext));
  -	assert(result.get() != 0);
  +	const XObjectPtr	result(xpath->execute(node, *theKey.getPrefixResolver(), dummy, m_executionContext));
  +	assert(result.null() == false);
   
   	const double	theResult = result->num();
   
  @@ -344,10 +342,9 @@
   		}
   	}
   
  -	const XObjectGuard	result(
  -		m_executionContext.getXObjectFactory(),
  +	const XObjectPtr	result(
   		xpath->execute(node, *theKey.getPrefixResolver(), dummy, m_executionContext));
  -	assert(result.get() != 0);
  +	assert(result.null() == false);
   
   	const XalanDOMString&	theResult = result->str();
   
  
  
  
  1.5       +1 -1      xml-xalan/c/src/XSLT/SelectionEvent.cpp
  
  Index: SelectionEvent.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/SelectionEvent.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SelectionEvent.cpp	2000/11/02 01:46:27	1.4
  +++ SelectionEvent.cpp	2000/11/21 21:10:17	1.5
  @@ -73,7 +73,7 @@
   			const ElemTemplateElement&		styleNode,
   			const XalanDOMString&			attributeName,
   			const XPath&					xpath,
  -			const XObject*					selection) :
  +			const XObjectPtr				selection) :
   	m_executionContext(executionContext),
   	m_sourceNode(sourceNode),
   	m_styleNode(styleNode),
  
  
  
  1.6       +5 -3      xml-xalan/c/src/XSLT/SelectionEvent.hpp
  
  Index: SelectionEvent.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/SelectionEvent.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SelectionEvent.hpp	2000/05/24 19:38:49	1.5
  +++ SelectionEvent.hpp	2000/11/21 21:10:18	1.6
  @@ -68,11 +68,13 @@
   
   
   
  +#include <XPath/XObject.hpp>
  +
  +
   class XalanNode;
   class ElemTemplateElement;
   class StylesheetExecutionContext;
   class XPath;
  -class XObject;
   
   
   
  @@ -96,7 +98,7 @@
   			const ElemTemplateElement&		styleNode,
   			const XalanDOMString&			attributeName,
   			const XPath&					xpath,
  -			const XObject*					selection);
  +			const XObjectPtr				selection);
   
   	virtual
   	~SelectionEvent();
  @@ -129,7 +131,7 @@
   	/**
   	 * The result of the selection.
   	 */
  -	const XObject* const				m_selection;
  +	const XObjectPtr					m_selection;
   
   private:
   
  
  
  
  1.42      +2 -2      xml-xalan/c/src/XSLT/Stylesheet.cpp
  
  Index: Stylesheet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.cpp,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- Stylesheet.cpp	2000/11/02 22:26:01	1.41
  +++ Stylesheet.cpp	2000/11/21 21:10:19	1.42
  @@ -1082,9 +1082,9 @@
   				{
   					isParam = true;
   
  -					const XObject* const	theXObject = arg.getXObject();
  +					const XObjectPtr	theXObject = arg.getXObject();
   
  -					if (theXObject != 0)
  +					if (theXObject.null() == false)
   					{
   						executionContext.pushVariable(arg.getName(),
   													  theXObject,
  
  
  
  1.37      +11 -21    xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp
  
  Index: StylesheetExecutionContext.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- StylesheetExecutionContext.hpp	2000/11/20 20:04:37	1.36
  +++ StylesheetExecutionContext.hpp	2000/11/21 21:10:20	1.37
  @@ -137,6 +137,7 @@
   class XalanNumberFormat;
   class XPath;
   class XObject;
  +class XObjectPtr;
   
   
   
  @@ -380,7 +381,7 @@
   	 * @param resolver    resolver for namespace resolution
   	 * @return pointer to resulting XObject
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	executeXPath(
   			const XalanDOMString&	str,
   			XalanNode*				contextNode,
  @@ -501,7 +502,7 @@
   	 * @param resolver    resolver for namespace resolution
   	 * @return a pointer to the XObject result
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	createVariable(
   			const ElemTemplateElement*	element,
   			const XPath&				xpath,
  @@ -519,7 +520,7 @@
   	 * @param sourceNode source node
   	 * @return a pointer to the XObject result
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	createVariable(
   			const ElemTemplateElement*	element,
   			const ElemTemplateElement&	templateChild,
  @@ -594,7 +595,7 @@
   	virtual void
   	pushVariable(
   			const QName&				name,
  -			const XObject*				var,
  +			const XObjectPtr			var,
   			const ElemTemplateElement*	element) = 0;
   
   	/**
  @@ -647,7 +648,7 @@
   	 * @param theName name of variable
   	 * @return pointer to XObject for variable
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	getParamVariable(const QName&	theName) const = 0;
   
   	/**
  @@ -942,7 +943,7 @@
   	 * @param sourceNode source node
   	 * @return XObject instance
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	createXResultTreeFrag(
   			const ElemTemplateElement&	templateChild,
   			XalanNode*					sourceTree,
  @@ -957,7 +958,7 @@
   	 * @param mode current mode
   	 * @return XObject instance
   	 */
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	createXResultTreeFrag(
   			const ElemTemplateElement&	templateChild,
   			XalanNode*					sourceTree,
  @@ -965,17 +966,6 @@
   			const QName&				mode) = 0;
   
   	/**
  -	 * Function to destroy an XObject that was returned
  -	 * by executing.  It is safe to call this function
  -	 * with any XObject.
  -	 *
  -	 * @param theXObject pointer to the XObject.
  -	 * @return true if the object was destroyed.
  -	 */
  -	virtual bool
  -	destroyXObject(const XObject*	theXObject) const = 0;
  -
  -	/**
   	 * Output an object to the result tree by doing the right conversions.
   	 * This is public for access by extensions.
   	 *
  @@ -1340,7 +1330,7 @@
   	virtual XObjectFactory&
   	getXObjectFactory() const = 0;
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	createNodeSet(XalanNode&	theNode) = 0;
   
   	virtual bool
  @@ -1395,7 +1385,7 @@
   			const XalanDOMString&	theNamespace, 
   			const XalanDOMString&	functionName) const = 0;
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	extFunction(
   			const XalanDOMString&			theNamespace,
   			const XalanDOMString&			functionName,
  @@ -1441,7 +1431,7 @@
   			const PrefixResolver&	resolver,
   			MutableNodeRefList&		nodelist) = 0;
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	getVariable(const QName&	name) const = 0;
   
   	virtual const PrefixResolver*
  
  
  
  1.41      +21 -169   xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp
  
  Index: StylesheetExecutionContextDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- StylesheetExecutionContextDefault.cpp	2000/11/20 20:04:37	1.40
  +++ StylesheetExecutionContextDefault.cpp	2000/11/21 21:10:20	1.41
  @@ -81,7 +81,7 @@
   #include <XPath/XObjectFactory.hpp>
   #include <XPath/XPath.hpp>
   #include <XPath/XPathExecutionContext.hpp>
  -#include <XPath/QName.hpp>
  +#include <XPath/XObject.hpp>
   
   
   
  @@ -135,7 +135,6 @@
   	m_printWriters(),
   	m_outputStreams(),
   	m_collationCompareFunctor(&s_defaultFunctor),
  -	m_liveVariablesStack(theXObjectFactory),
   	m_variablesStack(),
   	m_matchPatternCache(),
   	m_keyTables(),
  @@ -354,7 +353,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   StylesheetExecutionContextDefault::executeXPath(
   			const XalanDOMString&	str,
   			XalanNode*				contextNode,
  @@ -450,26 +449,19 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   StylesheetExecutionContextDefault::createVariable(
   			const ElemTemplateElement*	/* element */,
   			const XPath&				xpath,
   			XalanNode*					contextNode,
   			const PrefixResolver&		resolver)
   {
  -	const XObject* const	theVariable =
  -		xpath.execute(contextNode, resolver, *this);
  -
  -	// We'll want to return this variable after the current element frame
  -	// has finished executing, so save this off for later...
  -	m_liveVariablesStack.pushVariable(theVariable);
  -
  -	return theVariable;
  +	return xpath.execute(contextNode, resolver, *this);
   }
   
   
   
  -const XObject*
  +const XObjectPtr
   StylesheetExecutionContextDefault::createVariable(
   			const ElemTemplateElement*	/* element */,
   			const ElemTemplateElement&	templateChild,
  @@ -477,14 +469,7 @@
   			XalanNode*					sourceNode,
   			const QName&				mode)
   {
  -	const XObject* const	theVariable =
  -		createXResultTreeFrag(templateChild, sourceTree, sourceNode, mode);
  -
  -	// We'll want to return this variable after the current element frame
  -	// has finished executing, so save this off for later...
  -	m_liveVariablesStack.pushVariable(theVariable);
  -
  -	return theVariable;
  +	return createXResultTreeFrag(templateChild, sourceTree, sourceNode, mode);
   }
   
   
  @@ -497,16 +482,16 @@
   			XalanNode*					contextNode,
   			const PrefixResolver&		resolver)
   {
  -	const XObject*	var = 0;
  +	XObjectPtr	var;
   
   	if (length(str) > 0)
   	{
  -		var = 	m_xsltProcessor.evalXPathStr(
  +		var = m_xsltProcessor.evalXPathStr(
   						str,
   						contextNode,
   						resolver,
   						*this);
  -		assert(var != 0);
  +		assert(var.null() == false);
   	}
   
   	// Call to our own member function, to keep track of the XObject...
  @@ -518,17 +503,10 @@
   void
   StylesheetExecutionContextDefault::pushVariable(
   			const QName&				name,
  -			const XObject*				var,
  +			const XObjectPtr			var,
   			const ElemTemplateElement*	element)
   {
   	m_variablesStack.pushVariable(name, var, element);
  -
  -	if (m_liveVariablesStack.empty() == false)
  -	{
  -		// We'll want to return this variable after the current element frame
  -		// has finished executing, so save this off for later...
  -		m_liveVariablesStack.pushVariable(var);
  -	}
   }
   
   
  @@ -541,13 +519,9 @@
   			XalanNode*					contextNode,
   			const PrefixResolver&		resolver)
   {
  -	XObjectGuard	theXObject(
  -				m_xpathExecutionContextDefault.getXObjectFactory(),
  -				xpath.execute(contextNode, resolver, *this));
  -
  -	pushVariable(name, theXObject.get(), element);
  +	XObjectPtr	theXObject(xpath.execute(contextNode, resolver, *this));
   
  -	theXObject.release();
  +	pushVariable(name, theXObject, element);
   }
   
   
  @@ -560,13 +534,7 @@
   			XalanNode*					sourceTree,
   			XalanNode*					sourceNode)
   {
  -	XObjectGuard	theXObject(
  -				m_xpathExecutionContextDefault.getXObjectFactory(),
  -				createXResultTreeFrag(templateChild, sourceTree, sourceNode));
  -
  -	pushVariable(name, theXObject.get(), element);
  -
  -	theXObject.release();
  +	pushVariable(name, createXResultTreeFrag(templateChild, sourceTree, sourceNode), element);
   }
   
   
  @@ -575,8 +543,6 @@
   StylesheetExecutionContextDefault::pushContextMarker()
   {
   	m_variablesStack.pushContextMarker();
  -
  -	m_liveVariablesStack.pushContext();
   }
   
   
  @@ -585,8 +551,6 @@
   StylesheetExecutionContextDefault::popContextMarker()
   {
   	m_variablesStack.popContextMarker();
  -
  -	m_liveVariablesStack.popContext();
   }
   
   
  @@ -668,7 +632,7 @@
   
   				const XPath* const	pxpath = xslParamElement->getSelectPattern();
   
  -				const XObject*	theXObject = 0;
  +				XObjectPtr	theXObject;
   
   				if(0 != pxpath)
   				{
  @@ -703,7 +667,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   StylesheetExecutionContextDefault::getParamVariable(const QName&	theName) const
   {
   	return m_variablesStack.getParamVariable(theName);
  @@ -715,8 +679,6 @@
   StylesheetExecutionContextDefault::pushElementFrame(const ElemTemplateElement*	elem)
   {
   	m_variablesStack.pushElementFrame(elem);
  -
  -	m_liveVariablesStack.pushContext();
   }
   
   
  @@ -725,8 +687,6 @@
   StylesheetExecutionContextDefault::popElementFrame(const ElemTemplateElement*	elem)
   {
   	m_variablesStack.popElementFrame(elem);
  -
  -	m_liveVariablesStack.popContext();
   }
   
   
  @@ -849,7 +809,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   StylesheetExecutionContextDefault::createXResultTreeFrag(
   			const ElemTemplateElement&	templateChild,
   			XalanNode*					sourceTree,
  @@ -863,7 +823,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   StylesheetExecutionContextDefault::createXResultTreeFrag(
   			const ElemTemplateElement&	templateChild,
   			XalanNode*					sourceTree,
  @@ -882,14 +842,6 @@
   
   
   
  -bool
  -StylesheetExecutionContextDefault::destroyXObject(const XObject*	theXObject) const
  -{
  -	return getXObjectFactory().returnObject(theXObject);
  -}
  -
  -
  -
   void
   StylesheetExecutionContextDefault::outputToResultTree(const XObject&	xobj)
   {
  @@ -1307,8 +1259,6 @@
   
   	m_outputStreams.clear();
   
  -	m_liveVariablesStack.clear();
  -
   	m_variablesStack.reset();
   
   	// Clean up the key table vector
  @@ -1347,7 +1297,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   StylesheetExecutionContextDefault::createNodeSet(XalanNode&	theNode)
   {
   	return m_xpathExecutionContextDefault.createNodeSet(theNode);
  @@ -1486,7 +1436,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   StylesheetExecutionContextDefault::extFunction(
   			const XalanDOMString&			theNamespace,
   			const XalanDOMString&			functionName,
  @@ -1589,20 +1539,10 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   StylesheetExecutionContextDefault::getVariable(const QName&		name) const
   {
  -	const XObject* const	theVariable =
  -		m_variablesStack.getVariable(name);
  -
  -	if (theVariable != 0)
  -	{
  -		return m_xpathExecutionContextDefault.getXObjectFactory().clone(*theVariable);
  -	}
  -	else
  -	{
  -		return 0;
  -	}
  +	return m_variablesStack.getVariable(name);
   }
   
   
  @@ -1964,92 +1904,4 @@
   
   	// Add the XPath with the current clock
   	m_matchPatternCache.insert(XPathCacheMapType::value_type(pattern, XPathCacheEntry(theXPath, addClock)));
  -}
  -
  -
  -
  -StylesheetExecutionContextDefault::LiveVariablesStack::LiveVariablesStack(XObjectFactory&	theXObjectFactory) :
  -	m_xobjectFactory(theXObjectFactory),
  -	m_variablesStack(),
  -	m_createNewContextStack()
  -{
  -}
  -
  -
  -
  -StylesheetExecutionContextDefault::LiveVariablesStack::~LiveVariablesStack()
  -{
  -	clear();
  -}
  -
  -
  -
  -void
  -StylesheetExecutionContextDefault::LiveVariablesStack::pushVariable(const XObject*	theVariable)
  -{
  -	assert(m_createNewContextStack.size() != 0);
  -
  -	// Check to see if we need to create a new context and do so if necessary...
  -	if (m_createNewContextStack.back() == true)
  -	{
  -		m_variablesStack.resize(m_variablesStack.size() + 1);
  -
  -		m_variablesStack.back().reserve(eDefaultVariablesCollectionSize);
  -
  -		m_createNewContextStack.back() = false;
  -	}
  -
  -	m_variablesStack.back().push_back(theVariable);
  -}
  -
  -
  -
  -void
  -StylesheetExecutionContextDefault::LiveVariablesStack::pushContext()
  -{
  -	if (m_createNewContextStack.size() == 0)
  -	{
  -		m_createNewContextStack.reserve(eDefaultCreateNewContextStackSize);
  -	}
  -
  -	m_createNewContextStack.push_back(true);
  -}
  -
  -
  -
  -void
  -StylesheetExecutionContextDefault::LiveVariablesStack::popContext()
  -{
  -	assert(m_createNewContextStack.size() != 0);
  -
  -	if (m_createNewContextStack.back() == false)
  -	{
  -#if !defined(XALAN_NO_NAMESPACES)
  -		using std::for_each;
  -#endif
  -
  -		assert(m_variablesStack.empty() == false);
  -
  -		// Clean up any XObjects we created...
  -		for_each(
  -				m_variablesStack.back().begin(),
  -				m_variablesStack.back().end(),
  -				XObjectFactory::DeleteXObjectFunctor(m_xobjectFactory));
  -
  -		// Pop the stack...
  -		m_variablesStack.pop_back();
  -	}
  -
  -	m_createNewContextStack.pop_back();
  -}
  -
  -
  -
  -void
  -StylesheetExecutionContextDefault::LiveVariablesStack::clear()
  -{
  -	while(m_variablesStack.empty() == false)
  -	{
  -		popContext();
  -	}
   }
  
  
  
  1.38      +10 -72    xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp
  
  Index: StylesheetExecutionContextDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- StylesheetExecutionContextDefault.hpp	2000/11/20 20:04:37	1.37
  +++ StylesheetExecutionContextDefault.hpp	2000/11/21 21:10:21	1.38
  @@ -216,7 +216,7 @@
   	getIndent() const;
   
   	// $$$ ToDo: Get rid of this!!!!
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	executeXPath(
   			const XalanDOMString&	str,
   			XalanNode*				contextNode,
  @@ -239,14 +239,14 @@
   	virtual void
   	pushTopLevelVariables(const ParamVectorType&	topLevelParams);
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	createVariable(
   			const ElemTemplateElement*	element,
   			const XPath&				xpath,
   			XalanNode*					contextNode,
   			const PrefixResolver&		resolver);
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	createVariable(
   			const ElemTemplateElement*	element,
   			const ElemTemplateElement&	templateChild,
  @@ -265,7 +265,7 @@
   	virtual void
   	pushVariable(
   			const QName&				name,
  -			const XObject*				var,
  +			const XObjectPtr			var,
   			const ElemTemplateElement*	element);
   
   	virtual void
  @@ -304,7 +304,7 @@
   			const QName&				mode,
   			const ElemTemplateElement*	targetTemplate);
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	getParamVariable(const QName&	theName) const;
   
   	virtual void
  @@ -361,22 +361,19 @@
   			bool		overrideStrip,
   			bool		shouldCloneAttributes);
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	createXResultTreeFrag(
   			const ElemTemplateElement&	templateChild,
   			XalanNode*					sourceTree,
   			XalanNode*					sourceNode);
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	createXResultTreeFrag(
   			const ElemTemplateElement&	templateChild,
   			XalanNode*					sourceTree,
   			XalanNode*					sourceNode,
   			const QName&				mode);
   
  -	virtual bool
  -	destroyXObject(const XObject*	theXObject) const;
  -
   	virtual void
   	outputToResultTree(const XObject&	xobj);
   
  @@ -579,7 +576,7 @@
   	virtual XObjectFactory&
   	getXObjectFactory() const;
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	createNodeSet(XalanNode&	theNode);
   
   	virtual bool
  @@ -634,7 +631,7 @@
   			const XalanDOMString&	theNamespace, 
   			const XalanDOMString&	functionName) const;
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	extFunction(
   			const XalanDOMString&			theNamespace,
   			const XalanDOMString&			functionName,
  @@ -680,7 +677,7 @@
   			const PrefixResolver&	resolver,
   			MutableNodeRefList&		nodelist);
   
  -	virtual const XObject*
  +	virtual const XObjectPtr
   	getVariable(const QName&	name) const;
   
   	virtual const PrefixResolver*
  @@ -777,63 +774,6 @@
   		XSLTEngineImpl&		m_xsltProcessor;
   	};
   
  -	class LiveVariablesStack
  -	{
  -	public:
  -
  -#if defined(XALAN_NO_NAMESPACES)
  -			typedef vector<bool>							BoolVectorType;
  -			typedef vector<const XObject*>					VariablesCollectionType;
  -			typedef deque<VariablesCollectionType>			LiveVariablesStackType;
  -#else
  -			typedef std::vector<bool>						BoolVectorType;
  -			typedef std::vector<const XObject*>				VariablesCollectionType;
  -			typedef std::deque<VariablesCollectionType>		LiveVariablesStackType;
  -#endif
  -
  -		LiveVariablesStack(XObjectFactory&	theXObjectFactory);
  -
  -		~LiveVariablesStack();
  -
  -		void
  -		pushVariable(const XObject*		theVariable);
  -
  -		void
  -		pushContext();
  -
  -		void
  -		popContext();
  -
  -		void
  -		clear();
  -
  -		bool
  -		empty() const
  -		{
  -			return m_createNewContextStack.empty();
  -		}
  -
  -	private:
  -
  -		// not implemented
  -		LiveVariablesStack(const LiveVariablesStack&);
  -
  -		bool
  -		operator==(const LiveVariablesStack&) const;
  -
  -		LiveVariablesStack&
  -		operator=(const LiveVariablesStack&);
  -
  -		enum { eDefaultCreateNewContextStackSize = 100, eDefaultVariablesCollectionSize = 10 };
  -
  -
  -		XObjectFactory&			m_xobjectFactory;
  -
  -		LiveVariablesStackType	m_variablesStack;
  -
  -		BoolVectorType			m_createNewContextStack;
  -	};
  -
   private:
   
   	/**
  @@ -888,8 +828,6 @@
   	OutputStreamSetType					m_outputStreams;
   
   	const CollationCompareFunctor*		m_collationCompareFunctor;
  -
  -	LiveVariablesStack					m_liveVariablesStack;
   
   	/**
   	 * Holds all information about variables during execution.
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XSLT/TopLevelArg.cpp
  
  Index: TopLevelArg.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/TopLevelArg.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TopLevelArg.cpp	2000/08/22 20:21:29	1.2
  +++ TopLevelArg.cpp	2000/11/21 21:10:22	1.3
  @@ -74,8 +74,8 @@
   
   
   TopLevelArg::TopLevelArg(
  -		const QName&	name,
  -		const XObject*	variable) :
  +		const QName&		name,
  +		const XObjectPtr	variable) :
   	m_qname(name),
   	m_expression(),
   	m_xobject(variable)
  
  
  
  1.3       +6 -5      xml-xalan/c/src/XSLT/TopLevelArg.hpp
  
  Index: TopLevelArg.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/TopLevelArg.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TopLevelArg.hpp	2000/08/22 20:21:29	1.2
  +++ TopLevelArg.hpp	2000/11/21 21:10:22	1.3
  @@ -74,10 +74,11 @@
   
   
   #include <XPath/QName.hpp>
  +#include <XPath/XObject.hpp>
   
   
   
  -class XObject;
  +class XObjectPtr;
   
   
   
  @@ -105,8 +106,8 @@
   	 * @param variable	the XObject instance.
   	 */
   	TopLevelArg(
  -		const QName&	name = QName(),
  -		const XObject*	variable = 0);
  +		const QName&		name = QName(),
  +		const XObjectPtr	variable = XObjectPtr());
   
   	/**
   	 * Copy constructor
  @@ -147,7 +148,7 @@
   	 * 
   	 * @return pointer to the XObject instance
   	 */
  -	const XObject*
  +	const XObjectPtr
   	getXObject() const
   	{
   		return m_xobject;
  @@ -175,7 +176,7 @@
   
   	XalanDOMString		m_expression;
   
  -	const XObject*		m_xobject;
  +	const XObjectPtr	m_xobject;
   };
   
   
  
  
  
  1.7       +39 -23    xml-xalan/c/src/XSLT/VariablesStack.cpp
  
  Index: VariablesStack.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/VariablesStack.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- VariablesStack.cpp	2000/11/02 01:46:28	1.6
  +++ VariablesStack.cpp	2000/11/21 21:10:23	1.7
  @@ -285,7 +285,7 @@
   void
   VariablesStack::pushVariable(
   			const QName&				name,
  -			const XObject*				val,
  +			const XObjectPtr			val,
   			const ElemTemplateElement*	e)
   {
   	if(elementFrameAlreadyPushed(e) == false)
  @@ -315,23 +315,24 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   VariablesStack::findXObject(
   			const QName&	name,
   			bool			fSearchGlobalSpace) const
   {
  -	const XObject*		theXObject = 0;
  +	const StackEntry* const		theVariable =
  +		findVariable(name, fSearchGlobalSpace);
   
  -	const StackEntry*	theVariable = findVariable(name, fSearchGlobalSpace);
  -
  -	if (theVariable != 0)
  +	if (theVariable == 0)
  +	{
  +		return XObjectPtr();
  +	}
  +	else
   	{
   		assert(theVariable->getType() == StackEntry::eVariable);
   
  -		theXObject = theVariable->getVariable();
  +		return theVariable->getVariable();
   	}
  -
  -	return theXObject;
   }
   
   
  @@ -464,33 +465,42 @@
   
   
   VariablesStack::StackEntry::StackEntry() :
  -	m_type(eContextMarker)
  +	m_type(eContextMarker),
  +	m_qname(0),
  +	m_value(),
  +	m_element(0)
   {
   }
   
   
   
   VariablesStack::StackEntry::StackEntry(
  -		const QName*	name,
  -		const XObject*	val) :
  -	m_type(eVariable)
  +		const QName*		name,
  +		const XObjectPtr	val) :
  +	m_type(eVariable),
  +	m_qname(name),
  +	m_value(val),
  +	m_element(0)
   {
  -	variable.m_qname = name;
  -	variable.m_value = val;
   }
   
   
   
   VariablesStack::StackEntry::StackEntry(const ElemTemplateElement*	elem) :
  -	m_type(eElementFrameMarker)
  +	m_type(eElementFrameMarker),
  +	m_qname(0),
  +	m_value(),
  +	m_element(elem)
   {
  -	elementMarker.m_element = elem;
   }
   
   
   
   VariablesStack::StackEntry::StackEntry(const StackEntry&	theSource) :
  -	m_type(theSource.m_type)
  +	m_type(theSource.m_type),
  +	m_qname(0),
  +	m_value(),
  +	m_element(0)
   {
   	// Use operator=() to do the work...
   	*this = theSource;
  @@ -511,13 +521,19 @@
   
   	if (m_type == eVariable)
   	{
  -		variable.m_qname = theRHS.variable.m_qname;
  +		m_qname = theRHS.m_qname;
   
  -		variable.m_value = theRHS.variable.m_value;
  +		m_value = theRHS.m_value;
  +
  +		m_element = 0;
   	}
   	else if (m_type == eElementFrameMarker)
   	{
  -		elementMarker.m_element = theRHS.elementMarker.m_element;
  +		m_element = theRHS.m_element;
  +
  +		m_qname = 0;
  +
  +		m_value = XObjectPtr();
   	}
   
   	return *this;
  @@ -544,14 +560,14 @@
   		else if (m_type == eVariable)
   		{
   			// We only need to compare the variable pointer..
  -			if (variable.m_value == theRHS.variable.m_value)
  +			if (m_value == theRHS.m_value)
   			{
   				fResult = true;
   			}
   		}
   		else if (m_type == eElementFrameMarker)
   		{
  -			if (elementMarker.m_element == theRHS.elementMarker.m_element)
  +			if (m_element == theRHS.m_element)
   			{
   				fResult = true;
   			}
  
  
  
  1.5       +19 -26    xml-xalan/c/src/XSLT/VariablesStack.hpp
  
  Index: VariablesStack.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/VariablesStack.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- VariablesStack.hpp	2000/09/19 15:12:18	1.4
  +++ VariablesStack.hpp	2000/11/21 21:10:23	1.5
  @@ -70,6 +70,7 @@
   
   
   #include <XPath/QName.hpp>
  +#include <XPath/XObject.hpp>
   
   
   
  @@ -81,6 +82,7 @@
   class ElemTemplateElement;
   class StylesheetExecutionContext;
   class XObject;
  +class XObjectPtr;
   class XalanNode;
   
   
  @@ -140,9 +142,9 @@
   	popContextMarker();
   
   #if defined(XALAN_NO_NAMESPACES)
  -	typedef vector<pair<const QName*, const XObject*> >				ParamsVectorType;
  +	typedef vector<pair<const QName*,  XObjectPtr> >				ParamsVectorType;
   #else
  -	typedef std::vector<std::pair<const QName*, const XObject*> >	ParamsVectorType;
  +	typedef std::vector<std::pair<const QName*,  XObjectPtr> >	ParamsVectorType;
   #endif
   
   	/**
  @@ -164,7 +166,7 @@
   	 * @param theName name of variable
   	 * @return pointer to XObject for variable
   	 */
  -	const XObject*
  +	const XObjectPtr
   	getParamVariable(const QName& qname) const
   	{
   		return findXObject(qname, false);
  @@ -176,7 +178,7 @@
   	 * @param qname name of variable
   	 * @return pointer to the corresponding XObject
   	 */
  -	const XObject*
  +	const XObjectPtr
   	getVariable(const QName& 	name) const
   	{
   		return findXObject(name, true);
  @@ -194,7 +196,7 @@
   	void
   	pushVariable(
   			const QName&				name,
  -			const XObject*				val,
  +			const XObjectPtr			val,
   			const ElemTemplateElement*	e);
   
   	/**
  @@ -337,8 +339,8 @@
   		 * Construct a variable.
   		 */
   		StackEntry(
  -			const QName*	name,
  -			const XObject*	val);
  +			const QName*		name,
  +			const XObjectPtr	val);
   
   		/**
   		 * Construct an element frame marker.
  @@ -375,7 +377,7 @@
   		const QName*
   		getName() const
   		{
  -			return variable.m_qname;
  +			return m_qname;
   		}
   
   		/**
  @@ -383,10 +385,10 @@
   		 * 
   		 * @return pointer to XObject
   		 */
  -		const XObject*
  +		const XObjectPtr
   		getVariable() const
   		{
  -			return variable.m_value;
  +			return m_value;
   		}
   
   		/**
  @@ -397,7 +399,7 @@
   		const ElemTemplateElement*
   		getElement() const
   		{
  -			return elementMarker.m_element;
  +			return m_element;
   		}
   
   		StackEntry&
  @@ -411,20 +413,11 @@
   		// Data members...
   		eStackEntryType				m_type;
   
  -		union
  -		{
  -			struct
  -			{
  -				const QName*				m_qname;
  -
  -				const XObject*				m_value;
  -			} variable;
  -
  -			struct
  -			{
  -				const ElemTemplateElement*	m_element;
  -			} elementMarker;
  -		};
  +		const QName*				m_qname;
  +
  +		XObjectPtr					m_value;
  +
  +		const ElemTemplateElement*	m_element;
   	};
   
   #if defined(XALAN_NO_NAMESPACES)
  @@ -436,7 +429,7 @@
   	enum { eDefaultStackSize = 100 };
   
   
  -	const XObject*
  +	const XObjectPtr
   	findXObject(
   			const QName&	name,
   			bool			fSearchGlobalSpace) const;
  
  
  
  1.70      +13 -21    xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp
  
  Index: XSLTEngineImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- XSLTEngineImpl.cpp	2000/11/20 20:04:38	1.69
  +++ XSLTEngineImpl.cpp	2000/11/21 21:10:24	1.70
  @@ -704,10 +704,8 @@
   															0,
   															&theProxy);
   
  -		const XObjectGuard		xobj(
  -						m_xobjectFactory,
  -						evalXPathStr(ds, theExecutionContext));
  -		assert(xobj.get() != 0);
  +		const XObjectPtr	xobj(evalXPathStr(ds, theExecutionContext));
  +		assert(xobj.null() == false);
   
   		MutableNodeRefList	nl(xobj->nodeset());
   
  @@ -721,10 +719,8 @@
   
   			theExecutionContext.setContextNodeList(theEmptyList);
   
  -			const XObjectGuard		xobj(
  -						m_xobjectFactory,
  -						evalXPathStr(ds, theExecutionContext));
  -			assert(xobj.get() != 0);
  +			const XObjectPtr	xobj(evalXPathStr(ds, theExecutionContext));
  +			assert(xobj.null() == false);
   
   			nl = xobj->nodeset();
   
  @@ -736,10 +732,8 @@
   
   				theExecutionContext.setContextNodeList(theEmptyList);
   
  -				const XObjectGuard		xobj(
  -							m_xobjectFactory,
  -							evalXPathStr(ds, theExecutionContext));
  -				assert(xobj.get() != 0);
  +				const XObjectPtr	xobj(evalXPathStr(ds, theExecutionContext));
  +				assert(xobj.null() == false);
   
   				nl = xobj->nodeset();
   
  @@ -748,10 +742,8 @@
   					// Well, hell, maybe it's an XPath...
   					theExecutionContext.setContextNodeList(theEmptyList);
   
  -					const XObjectGuard		xobj(
  -								m_xobjectFactory,
  -								evalXPathStr(fragID, theExecutionContext));
  -					assert(xobj.get() != 0);
  +					const XObjectPtr	xobj(evalXPathStr(fragID, theExecutionContext));
  +					assert(xobj.null() == false);
   
   					nl = xobj->nodeset();
   				}
  @@ -2357,7 +2349,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XSLTEngineImpl::evalXPathStr(
   			const XalanDOMString&	str,
   			XPathExecutionContext&	executionContext)
  @@ -2379,7 +2371,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XSLTEngineImpl::evalXPathStr(
   			const XalanDOMString&	str,
   			XalanNode*				contextNode,
  @@ -2401,7 +2393,7 @@
   
   
   
  -const XObject*
  +const XObjectPtr
   XSLTEngineImpl::evalXPathStr(
   			const XalanDOMString&	str,
   			XalanNode*				contextNode,
  @@ -2573,7 +2565,7 @@
   										{
   											// Proper close of attribute template.
   											// Evaluate the expression.
  -											const XObject* const	xobj =
  +											const XObjectPtr const	xobj =
   												evalXPathStr(expression, contextNode, namespaceContext, executionContext);
   
   											const XalanDOMString			exprResult(xobj->str());
  @@ -2960,7 +2952,7 @@
   void
   XSLTEngineImpl::setStylesheetParam(
   			const XalanDOMString&	theName,
  -			XObject*				theValue)
  +			XObjectPtr				theValue)
   {
   	const QName		qname(theName, 0, m_xpathEnvSupport, m_xpathSupport);
   
  
  
  
  1.53      +4 -4      xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp
  
  Index: XSLTEngineImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- XSLTEngineImpl.hpp	2000/11/20 20:04:38	1.52
  +++ XSLTEngineImpl.hpp	2000/11/21 21:10:25	1.53
  @@ -291,7 +291,7 @@
   	virtual void
   	setStylesheetParam(
   			const XalanDOMString&	key,
  -			XObject*				value);
  +			XObjectPtr				value);
   
   	virtual bool
   	shouldStripSourceNode(
  @@ -922,7 +922,7 @@
   	 * @param executionContext current execution context
   	 * @return pointer to XObject result
   	 */
  -	const XObject*
  +	const XObjectPtr
   	evalXPathStr(
   			const XalanDOMString&	str,
   			XPathExecutionContext&	executionContext);
  @@ -936,7 +936,7 @@
   	 * @param executionContext current execution context
   	 * @return pointer to XObject result
   	 */
  -	const XObject*
  +	const XObjectPtr
   	evalXPathStr(
   			const XalanDOMString&	str,
   			XalanNode* 				contextNode,
  @@ -952,7 +952,7 @@
   	 * @param executionContext current execution context
   	 * @return pointer to XObject result
   	 */
  -	const XObject*
  +	const XObjectPtr
   	evalXPathStr(
   			const XalanDOMString&	str,
   			XalanNode* 				contextNode,
  
  
  
  1.15      +2 -1      xml-xalan/c/src/XSLT/XSLTProcessor.hpp
  
  Index: XSLTProcessor.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessor.hpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XSLTProcessor.hpp	2000/08/10 18:43:12	1.14
  +++ XSLTProcessor.hpp	2000/11/21 21:10:26	1.15
  @@ -91,6 +91,7 @@
   class XalanNode;
   class XMLParserLiaison;
   class XObject;
  +class XObjectPtr;
   class XPathExecutionContext;
   class XSLTInputSource;
   class XSLTResultTarget;
  @@ -333,7 +334,7 @@
      virtual void
      setStylesheetParam(
   			const XalanDOMString&	key,
  -			XObject*				value) = 0;
  +			XObjectPtr				value) = 0;
     
     /**
   	* Push a top-level stylesheet parameter.  This value can be evaluated via
  
  
  
  1.8       +1 -1      xml-xalan/c/src/XSLT/XSLTProcessorEnvSupport.hpp
  
  Index: XSLTProcessorEnvSupport.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupport.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSLTProcessorEnvSupport.hpp	2000/08/14 22:08:08	1.7
  +++ XSLTProcessorEnvSupport.hpp	2000/11/21 21:10:27	1.8
  @@ -116,7 +116,7 @@
   			const XalanDOMString&	theNamespace, 
   			const XalanDOMString&	functionName) const = 0;
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	extFunction(
   			XPathExecutionContext&			executionContext,
   			const XalanDOMString&			theNamespace,
  
  
  
  1.18      +1 -1      xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp
  
  Index: XSLTProcessorEnvSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- XSLTProcessorEnvSupportDefault.cpp	2000/11/02 01:46:28	1.17
  +++ XSLTProcessorEnvSupportDefault.cpp	2000/11/21 21:10:28	1.18
  @@ -272,7 +272,7 @@
   
   
   
  -XObject*
  +XObjectPtr
   XSLTProcessorEnvSupportDefault::extFunction(
   			XPathExecutionContext&			executionContext,
   			const XalanDOMString&			theNamespace,
  
  
  
  1.15      +1 -1      xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.hpp
  
  Index: XSLTProcessorEnvSupportDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.hpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XSLTProcessorEnvSupportDefault.hpp	2000/09/19 15:12:21	1.14
  +++ XSLTProcessorEnvSupportDefault.hpp	2000/11/21 21:10:29	1.15
  @@ -185,7 +185,7 @@
   			const XalanDOMString&	theNamespace, 
   			const XalanDOMString&	functionName) const;
   
  -	virtual XObject*
  +	virtual XObjectPtr
   	extFunction(
   			XPathExecutionContext&			executionContext,
   			const XalanDOMString&			theNamespace,