dbertoni    01/06/14 12:12:50

  Modified:    c/src/XPath ResultTreeFrag.cpp ResultTreeFrag.hpp
                        ResultTreeFragBase.hpp XNodeSet.cpp XNodeSet.hpp
                        XPath.cpp XPath.hpp XPathEnvSupport.hpp
                        XPathEnvSupportDefault.cpp
                        XPathEnvSupportDefault.hpp XPathEvaluator.cpp
                        XPathExecutionContextDefault.cpp
                        XPathExpression.cpp XPathExpression.hpp
                        XPathProcessor.hpp XPathProcessorImpl.cpp
                        XPathProcessorImpl.hpp XResultTreeFrag.cpp
                        XResultTreeFrag.hpp XStringBase.cpp
  Added:       c/src/XPath NodeRefListResultTreeFragProxy.cpp
                        NodeRefListResultTreeFragProxy.hpp XNodeSetBase.cpp
                        XNodeSetBase.hpp XNodeSetResultTreeFragProxy.cpp
                        XNodeSetResultTreeFragProxy.hpp
  Log:
  Performance improvements and code cleanup.
  
  Revision  Changes    Path
  1.12      +3 -15     xml-xalan/c/src/XPath/ResultTreeFrag.cpp
  
  Index: ResultTreeFrag.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/ResultTreeFrag.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ResultTreeFrag.cpp        2001/01/16 02:31:28     1.11
  +++ ResultTreeFrag.cpp        2001/06/14 19:12:00     1.12
  @@ -72,10 +72,9 @@
   
   
   
  -ResultTreeFrag::ResultTreeFrag(XalanDocument*        theOwnerDocument) :
  +ResultTreeFrag::ResultTreeFrag() :
        ResultTreeFragBase(),
  -     XalanNodeList(),
  -     m_document(theOwnerDocument)
  +     XalanNodeList()
   {
   }
   
  @@ -85,7 +84,6 @@
                                                           bool                 
                        deepClone) :
        ResultTreeFragBase(theSource),
        XalanNodeList(),
  -     m_document(theSource.m_document),
        m_children(deepClone == false ? theSource.m_children : NodeVectorType())
   {
        if (deepClone == true)
  @@ -119,16 +117,6 @@
   
   
   
  -void
  -ResultTreeFrag::setOwnerDocument(XalanDocument*              
theOwnerDocument)
  -{
  -     m_document = theOwnerDocument;
  -
  -     clear();
  -}
  -
  -
  -
   const XalanDOMString&
   ResultTreeFrag::getNodeName() const
   {
  @@ -215,7 +203,7 @@
   XalanDocument*
   ResultTreeFrag::getOwnerDocument() const
   {
  -     return m_document;
  +     return 0;
   }
   
   
  
  
  
  1.13      +1 -9      xml-xalan/c/src/XPath/ResultTreeFrag.hpp
  
  Index: ResultTreeFrag.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/ResultTreeFrag.hpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ResultTreeFrag.hpp        2001/01/16 02:31:28     1.12
  +++ ResultTreeFrag.hpp        2001/06/14 19:12:01     1.13
  @@ -86,10 +86,8 @@
   
        /**
         * Construct a result tree fragment object from a DOM document.
  -      * 
  -      * @param theOwnerDocument The document used to construct result tree 
fragment
         */
  -     ResultTreeFrag(XalanDocument*   theOwnerDocument = 0);
  +     ResultTreeFrag();
   
        /**
         * Construct a result tree fragment object from another.
  @@ -109,10 +107,6 @@
        virtual void
        clear();
   
  -     virtual void
  -     setOwnerDocument(XalanDocument*         theOwnerDocument);
  -
  -
        // These interfaces are inherited from XalanDocumentFragment...
   
        virtual const XalanDOMString&
  @@ -227,8 +221,6 @@
        bool
        operator==(const ResultTreeFrag&        theRHS) const;
   
  -
  -     XalanDocument*                                  m_document;
   
   #if defined(XALAN_NO_NAMESPACES)
        typedef vector<XalanNode*>                      NodeVectorType;
  
  
  
  1.11      +1 -13     xml-xalan/c/src/XPath/ResultTreeFragBase.hpp
  
  Index: ResultTreeFragBase.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/ResultTreeFragBase.hpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ResultTreeFragBase.hpp    2001/01/16 02:31:28     1.10
  +++ ResultTreeFragBase.hpp    2001/06/14 19:12:02     1.11
  @@ -82,9 +82,7 @@
   public:
   
        /**
  -      * Construct a result tree fragment object from a DOM document.
  -      * 
  -      * @param theOwnerDocument document used to construct result tree 
fragment
  +      * Construct a result tree fragment object.
         */
        ResultTreeFragBase();
   
  @@ -104,16 +102,6 @@
         */
        virtual void
        clear() = 0;
  -
  -     /**
  -      * Set the owner document for the result tree fragment.  This will
  -      * cause all of the children to be cleared as well.
  -      *
  -      * @param theOwnerDocument The new owner document instance.
  -      */
  -     virtual void
  -     setOwnerDocument(XalanDocument*         theOwnerDocument) = 0;
  -
   
        // These interfaces are inherited from XalanDocumentFragment...
        virtual const XalanDOMString&
  
  
  
  1.24      +18 -152   xml-xalan/c/src/XPath/XNodeSet.cpp
  
  Index: XNodeSet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XNodeSet.cpp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- XNodeSet.cpp      2001/06/06 21:49:00     1.23
  +++ XNodeSet.cpp      2001/06/14 19:12:04     1.24
  @@ -84,11 +84,8 @@
   
   
   XNodeSet::XNodeSet(BorrowReturnMutableNodeRefList&   value) :
  -     XObject(eTypeNodeSet),
  -     m_value(value),
  -     m_resultTreeFrag(),
  -     m_cachedStringValue(),
  -     m_cachedNumberValue(theBogusNumberValue)
  +     XNodeSetBase(),
  +     m_value(value)
   {
   }
   
  @@ -96,13 +93,8 @@
   
   XNodeSet::XNodeSet(const XNodeSet&   source,
                                   bool                         deepClone) :
  -     XObject(source),
  -     m_value(source.m_value.clone()),
  -     m_resultTreeFrag(source.m_resultTreeFrag.get() == 0 ?
  -                                             0 :
  -                                             
source.m_resultTreeFrag->clone(deepClone)),
  -     m_cachedStringValue(source.m_cachedStringValue),
  -     m_cachedNumberValue(source.m_cachedNumberValue)
  +     XNodeSetBase(source),
  +     m_value(source.m_value.clone())
   {
   }
   
  @@ -126,128 +118,6 @@
   
   
   
  -XalanDOMString
  -XNodeSet::getTypeString() const
  -{
  -     return XALAN_STATIC_UCODE_STRING("#NODESET");
  -}
  -
  -
  -
  -double
  -XNodeSet::num() const
  -{
  -     if (DoubleSupport::equal(m_cachedNumberValue, theBogusNumberValue) == 
true)
  -     {
  -#if defined(XALAN_NO_MUTABLE)
  -             ((XNodeSet*)this)->m_cachedNumberValue = 
DoubleSupport::toDouble(str());
  -#else
  -             m_cachedNumberValue = DoubleSupport::toDouble(str());
  -#endif
  -     }
  -
  -     return m_cachedNumberValue;
  -}
  -
  -
  -
  -bool
  -XNodeSet::boolean() const
  -{
  -     return m_value->getLength() > 0 ? true : false;
  -}
  -
  -
  -
  -const XalanDOMString&
  -XNodeSet::str() const
  -{
  -     if (isEmpty(m_cachedStringValue) == true &&
  -             m_value->getLength() > 0)
  -     {
  -             const XalanNode* const  theNode = m_value->item(0);
  -             assert(theNode != 0);
  -
  -#if defined(XALAN_NO_MUTABLE)
  -             DOMServices::getNodeData(*theNode, 
((XNodeSet*)this)->m_cachedStringValue);
  -#else
  -             DOMServices::getNodeData(*theNode, m_cachedStringValue);
  -#endif
  -     }
  -
  -     return m_cachedStringValue;
  -}
  -
  -
  -
  -void
  -XNodeSet::str(
  -                     FormatterListener&      formatterListener,
  -                     MemberFunctionPtr       function) const
  -{
  -     if (isEmpty(m_cachedStringValue) == false)
  -     {
  -             (formatterListener.*function)(c_wstr(m_cachedStringValue), 
length(m_cachedStringValue));
  -     }
  -     else if (m_value->getLength() > 0)
  -     {
  -             const XalanNode* const  theNode = m_value->item(0);
  -             assert(theNode != 0);
  -
  -             DOMServices::getNodeData(*theNode, formatterListener, function);
  -     }
  -}
  -
  -
  -
  -void
  -XNodeSet::str(XalanDOMString&        theBuffer) const
  -{
  -     if (isEmpty(m_cachedStringValue) == false)
  -     {
  -             append(theBuffer, m_cachedStringValue);
  -     }
  -     else if (m_value->getLength() > 0)
  -     {
  -             const XalanNode* const  theNode = m_value->item(0);
  -             assert(theNode != 0);
  -
  -             DOMServices::getNodeData(*theNode, theBuffer);
  -     }
  -}
  -
  -
  -
  -const ResultTreeFragBase&
  -XNodeSet::rtree(XPathExecutionContext&       executionContext) const
  -{
  -     if (m_resultTreeFrag.get() == 0)
  -     {
  -             XalanDocument* const    theFactory = 
executionContext.getDOMFactory();
  -             assert(theFactory != 0);
  -
  -             ResultTreeFrag* const   theFrag =
  -                     new ResultTreeFrag(theFactory);
  -
  -             const int       nNodes = m_value->getLength();
  -
  -             for(int i = 0; i < nNodes; i++)
  -             {
  -                     theFrag->appendChild(m_value->item(i));
  -             }
  -
  -#if defined(XALAN_NO_MUTABLE)
  -             ((XNodeSet*)this)->m_resultTreeFrag.reset(theFrag);
  -#else
  -         m_resultTreeFrag.reset(theFrag);
  -#endif
  -     }
  -
  -     return *m_resultTreeFrag.get();
  -}
  -
  -
  -
   const NodeRefListBase&
   XNodeSet::nodeset() const
   {
  @@ -257,39 +127,35 @@
   
   
   void
  -XNodeSet::ProcessXObjectTypeCallback(XObjectTypeCallback&    
theCallbackObject)
  +XNodeSet::release()
   {
  -     theCallbackObject.NodeSet(*this,
  -                                                       nodeset());
  +     m_value.release();
  +
  +     clearCachedValues();
   }
   
   
   
   void
  -XNodeSet::ProcessXObjectTypeCallback(XObjectTypeCallback&    
theCallbackObject) const
  +XNodeSet::set(BorrowReturnMutableNodeRefList&        value)
   {
  -     theCallbackObject.NodeSet(*this,
  -                                                       nodeset());
  +     release();
  +
  +     m_value = value;
   }
   
   
   
  -void
  -XNodeSet::release()
  +XalanNode*
  +XNodeSet::item(unsigned int  index) const
   {
  -     m_value.release();
  -
  -     m_cachedNumberValue = theBogusNumberValue;
  -
  -     clear(m_cachedStringValue);
  +     return m_value->item(index);
   }
   
   
   
  -void
  -XNodeSet::set(BorrowReturnMutableNodeRefList&        value)
  +unsigned int
  +XNodeSet::getLength() const
   {
  -     release();
  -
  -     m_value = value;
  +     return m_value->getLength();
   }
  
  
  
  1.21      +8 -51     xml-xalan/c/src/XPath/XNodeSet.hpp
  
  Index: XNodeSet.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XNodeSet.hpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- XNodeSet.hpp      2001/06/06 21:49:01     1.20
  +++ XNodeSet.hpp      2001/06/14 19:12:05     1.21
  @@ -64,31 +64,19 @@
   
   
   
  -#if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
  -#include <XPath/ResultTreeFragBase.hpp>
  -#endif
  -
  -
  -
  -#include <Include/XalanAutoPtr.hpp>
  -
  -
  -
   // Base class header file.
  -#include <XPath/XObject.hpp>
  -#include <XPath/XPathExecutionContext.hpp>
  +#include <XPath/XNodeSetBase.hpp>
   
   
   
  -class ResultTreeFragBase;
  -class XalanNode;
  +#include <XPath/XPathExecutionContext.hpp>
   
   
   
   /**
    * Class to hold XPath return types.
    */
  -class XALAN_XPATH_EXPORT XNodeSet : public XObject
  +class XALAN_XPATH_EXPORT XNodeSet : public XNodeSetBase
   {
   public:
   
  @@ -114,7 +102,7 @@
        virtual
        ~XNodeSet();
   
  -     // These methods are inherited from XObject ...
  +     // These methods are inherited from XNodeSetBase...
   
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
        virtual XObject*
  @@ -123,37 +111,14 @@
   #endif
        clone(void*             theAddress = 0) const;
   
  -     virtual XalanDOMString
  -     getTypeString() const;
  -
  -     virtual double
  -     num() const;
  -
  -     virtual bool
  -     boolean() const;
  -
  -     virtual const XalanDOMString&
  -     str() const;
  -
  -     virtual void
  -     str(
  -                     FormatterListener&      formatterListener,
  -                     MemberFunctionPtr       function) const;
  -
  -     virtual void
  -     str(XalanDOMString&     theBuffer) const;
  -
  -     virtual const ResultTreeFragBase&
  -     rtree(XPathExecutionContext&    executionContext) const;
  -
        virtual const NodeRefListBase&
        nodeset() const;
   
  -     virtual void
  -     ProcessXObjectTypeCallback(XObjectTypeCallback&         
theCallbackObject);
  +     virtual XalanNode*
  +     item(unsigned int       index) const;
   
  -     virtual void
  -     ProcessXObjectTypeCallback(XObjectTypeCallback&         
theCallbackObject) const;
  +     virtual unsigned int
  +     getLength() const;
   
        /**
         * Release the node set held by the instance.
  @@ -176,15 +141,7 @@
        operator=(const XNodeSet&);
   
        // Data members...
  -
  -
        BorrowReturnMutableNodeRefList                          m_value;
  -
  -     mutable XalanAutoPtr<ResultTreeFragBase>        m_resultTreeFrag;
  -
  -     mutable XalanDOMString                                          
m_cachedStringValue;
  -
  -     mutable double                                                          
m_cachedNumberValue;
   };
   
   
  
  
  
  1.53      +0 -72     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.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- XPath.cpp 2001/05/17 16:12:17     1.52
  +++ XPath.cpp 2001/06/14 19:12:06     1.53
  @@ -261,18 +261,10 @@
                return mod(context, opPos, executionContext);
                break;
   
  -     case XPathExpression::eOP_QUO:
  -             return quo(context, opPos, executionContext);
  -             break;
  -
        case XPathExpression::eOP_NEG:
                return neg(context, opPos, executionContext);
                break;
   
  -     case XPathExpression::eOP_STRING:
  -             return string(context, opPos, executionContext);
  -             break;
  -
        case XPathExpression::eOP_BOOL:
                return boolean(context, opPos, executionContext);
                break;
  @@ -407,22 +399,6 @@
   
   
   
  -double
  -XPath::nodeTest(
  -                     XalanNode*                              context,
  -                     int                                             /* 
opPos */,
  -                     int                                             /* 
argLen */,
  -                     int                                             /* 
stepType */,
  -                     XPathExecutionContext&  executionContext) const
  -{
  -     executionContext.warn(TranscodeFromLocalCodePage("XPath needs a derived 
object to implement nodeTest!"),
  -                                               context);
  -
  -    return s_MatchScoreNone;
  -}
  -
  -
  -
   void
   XPath::getTargetElementStrings(TargetElementStringsVectorType&       
targetStrings) const
   {
  @@ -539,17 +515,6 @@
   
   
   const XObjectPtr
  -XPath::xpath(
  -                     XalanNode*                              context,
  -                     int                                             opPos,
  -                     XPathExecutionContext&  executionContext) const
  -{
  -     return executeMore(context, opPos + 2, executionContext);
  -}
  -
  -
  -
  -const XObjectPtr
   XPath::matchPattern(
                        XalanNode*                              context,
                        int                                             opPos,
  @@ -902,20 +867,6 @@
   
   
   const XObjectPtr
  -XPath::quo(
  -                     XalanNode*                              context,
  -                     int                                             opPos,
  -                     XPathExecutionContext&  executionContext) const
  -{
  -     // Actually, this is no longer supported by xpath...
  -     executionContext.warn(TranscodeFromLocalCodePage("Old syntax: quo(...) 
is no longer defined in XPath."));
  -
  -     return div(context, opPos, executionContext);
  -}
  -
  -
  -
  -const XObjectPtr
   XPath::neg(
                        XalanNode*                              context,
                        int                                             opPos,
  @@ -925,29 +876,6 @@
        assert(expr1.get() != 0);
   
        return 
executionContext.getXObjectFactory().createNumber(DoubleSupport::negative(expr1->num()));
  -}
  -
  -
  -
  -const XObjectPtr
  -XPath::string(
  -                     XalanNode*                              context,
  -                     int                                             opPos,
  -                     XPathExecutionContext&  executionContext) const
  -{
  -     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;
  -     }
  -     else
  -     {
  -             return 
executionContext.getXObjectFactory().createStringAdapter(expr1);
  -     }
   }
   
   
  
  
  
  1.24      +0 -45     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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- XPath.hpp 2001/04/18 14:46:11     1.23
  +++ XPath.hpp 2001/06/14 19:12:09     1.24
  @@ -304,26 +304,6 @@
                        XPathExecutionContext&  executionContext) const;
   
        /**
  -      * Test a node.  This should be implemented by a derived class.
  -      * Returns s_MatchScoreNone by default.
  -      *
  -      * @param context  current source tree context node
  -      * @param opPos    current position in the m_opMap array
  -      * @param argLen   argument length
  -      * @param stepType type of step
  -      * @param executionContext current execution context
  -      * @return      one of s_MatchScoreNone, s_MatchScoreNodeTest,
  -      *              s_MatchScoreQName
  -      */
  -     virtual double
  -     nodeTest(
  -                     XalanNode*                              context,
  -                     int                                             opPos,
  -                     int                                             argLen,
  -                     int                                             
stepType,
  -                     XPathExecutionContext&  executionContext) const;
  -
  -     /**
         * Evaluate a predicate.
         *
         * @param context          current source tree context node
  @@ -445,18 +425,6 @@
        createXLocatorHandler() const;
   
        /**
  -      * Execute from the beginning of the xpath.
  -      * @param context The current source tree context node.
  -      * @param opPos The current position in the m_opMap array.
  -      * @return The result of the expression.
  -      */
  -     virtual const XObjectPtr
  -     xpath(
  -                     XalanNode*                              context,
  -                     int                                             opPos,
  -                     XPathExecutionContext&  executionContext) const;
  -
  -     /**
         * Computes the union of its operands which must be node-sets.
         * @param context The current source tree context node.
         * @param opPos The current position in the m_opMap array.
  @@ -652,19 +620,6 @@
                        int                                             opPos,
                        XPathExecutionContext&  executionContext) const;
   
  -     /**
  -      * Return the remainder from a truncating division.
  -      * (Quo is no longer supported by xpath).
  -      * @param context The current source tree context node.
  -      * @param opPos The current position in the m_opMap array.
  -      * @return arg1 mod arg2.
  -      */
  -     const XObjectPtr
  -     quo(
  -                     XalanNode*                              context,
  -                     int                                             opPos,
  -                     XPathExecutionContext&  executionContext) const;
  -     
        /**
         * Return the negation of a number.
         * @param context The current source tree context node.
  
  
  
  1.14      +0 -16     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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XPathEnvSupport.hpp       2001/03/29 22:16:05     1.13
  +++ XPathEnvSupport.hpp       2001/06/14 19:12:10     1.14
  @@ -202,22 +202,6 @@
                        XalanNode*                                              
context,
                        const XObjectArgVectorType&             argVec) const = 
0;
   
  -     /**
  -      * Tells, through the combination of the default-space attribute on
  -      * xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the 
xml:space
  -      * attribute, whether or not extra whitespace should be stripped from 
the
  -      * node.  Literal elements from template elements should <em>not</em> be
  -      * tested with this function.
  -      *
  -      * @param executionContext  current execution context
  -      * @param node text node from the source tree
  -      * @return true if the text node should be stripped of extra whitespace
  -      */
  -     virtual bool
  -     shouldStripSourceNode(
  -                     XPathExecutionContext&  executionContext,
  -                     const XalanNode&                node) const = 0;
  -
        enum eSource { eXMLParser               = 1,
                                   eXSLTProcessor       = 2,
                                   eXPATHParser         = 3,
  
  
  
  1.26      +0 -10     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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- XPathEnvSupportDefault.cpp        2001/04/30 18:11:01     1.25
  +++ XPathEnvSupportDefault.cpp        2001/06/14 19:12:11     1.26
  @@ -464,16 +464,6 @@
   
   
   bool
  -XPathEnvSupportDefault::shouldStripSourceNode(
  -                     XPathExecutionContext&  /* executionContext */,
  -                     const XalanNode&                /* node */) const
  -{
  -     return false;
  -}
  -
  -
  -
  -bool
   XPathEnvSupportDefault::problem(
                        eSource                                 /* where */,
                        eClassification                 classification,
  
  
  
  1.20      +0 -5      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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XPathEnvSupportDefault.hpp        2001/03/29 22:18:12     1.19
  +++ XPathEnvSupportDefault.hpp        2001/06/14 19:12:12     1.20
  @@ -207,11 +207,6 @@
                        const XObjectArgVectorType&             argVec) const;
   
        virtual bool
  -     shouldStripSourceNode(
  -                     XPathExecutionContext&  executionContext,
  -                     const XalanNode&                node) const;
  -
  -     virtual bool
        problem(
                        eSource                                 where,
                        eClassification                 classification,
  
  
  
  1.3       +1 -2      xml-xalan/c/src/XPath/XPathEvaluator.cpp
  
  Index: XPathEvaluator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathEvaluator.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XPathEvaluator.cpp        2001/03/29 22:40:40     1.2
  +++ XPathEvaluator.cpp        2001/06/14 19:12:14     1.3
  @@ -255,8 +255,7 @@
       theProcessor.initXPath(
                        theXPath,
                        XalanDOMString(xpathString),
  -                     prefixResolver,
  -                     envSupport);
  +                     prefixResolver);
   
        // Set up the connections between the execution context and
        // the provided support objects...
  
  
  
  1.38      +1 -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.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- XPathExecutionContextDefault.cpp  2001/05/14 01:01:16     1.37
  +++ XPathExecutionContextDefault.cpp  2001/06/14 19:12:15     1.38
  @@ -449,9 +449,7 @@
   bool
   XPathExecutionContextDefault::shouldStripSourceNode(const XalanNode& node)
   {
  -     assert(m_xpathEnvSupport != 0);
  -
  -     return m_xpathEnvSupport->shouldStripSourceNode(*this, node);
  +     return false;
   }
   
   
  
  
  
  1.31      +0 -2      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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- XPathExpression.cpp       2001/06/06 21:50:43     1.30
  +++ XPathExpression.cpp       2001/06/14 19:12:16     1.31
  @@ -847,9 +847,7 @@
        theMap[eOP_MULT] = 1 + s__opCodeMapLengthIndex;
        theMap[eOP_DIV] = 1 + s__opCodeMapLengthIndex;
        theMap[eOP_MOD] = 1 + s__opCodeMapLengthIndex;
  -     theMap[eOP_QUO] = 1 + s__opCodeMapLengthIndex;
        theMap[eOP_NEG] = 1 + s__opCodeMapLengthIndex;
  -     theMap[eOP_STRING] = 1 + s__opCodeMapLengthIndex;
        theMap[eOP_BOOL] = 1 + s__opCodeMapLengthIndex;
        theMap[eOP_NUMBER] = 1 + s__opCodeMapLengthIndex;
        theMap[eOP_UNION] = 1 + s__opCodeMapLengthIndex;
  
  
  
  1.19      +4 -2      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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- XPathExpression.hpp       2001/06/06 21:50:43     1.18
  +++ XPathExpression.hpp       2001/06/14 19:12:18     1.19
  @@ -305,7 +305,8 @@
                 * returns: 
                 *      XNumber
                 */
  -             eOP_QUO = 15,
  +// No longer supported...
  +//           eOP_QUO = 15,
   
                /**
                 * [OP_NEG]
  @@ -325,7 +326,8 @@
                 * returns: 
                 *      XString
                 */
  -             eOP_STRING = 17,
  +// No longer supported...
  +//           eOP_STRING = 17,
   
                /**
                 * [OP_BOOL] (cast operation)
  
  
  
  1.6       +2 -7      xml-xalan/c/src/XPath/XPathProcessor.hpp
  
  Index: XPathProcessor.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathProcessor.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XPathProcessor.hpp        2000/08/10 18:37:39     1.5
  +++ XPathProcessor.hpp        2001/06/14 19:12:19     1.6
  @@ -72,7 +72,6 @@
   class Function;
   class PrefixResolver;
   class XPath;
  -class XPathEnvSupport;
   
   
   
  @@ -100,8 +99,7 @@
        initXPath(
                        XPath&                                  pathObj,
                        const XalanDOMString&   expression,
  -                     const PrefixResolver&   resolver,
  -                     const XPathEnvSupport&  envSupport) = 0;
  +                     const PrefixResolver&   resolver) = 0;
   
        /**
         * Given a string, create an XSLT Match Pattern object.
  @@ -109,15 +107,12 @@
         * @param pathObj        XPath object to be initialized
         * @param expression     expression that will be evaluated
         * @param resolver       prefix resolver to use
  -      * @param xobjectFactory factory class instance for XObjects
  -      * @param envSupport     XPath environment support class instance
         */
        virtual void
        initMatchPattern(
                        XPath&                                  pathObj,
                        const XalanDOMString&   expression,
  -                     const PrefixResolver&   resolver,
  -                     const XPathEnvSupport&  envSupport) = 0;
  +                     const PrefixResolver&   resolver) = 0;
   
        /**
         * Given a string, and a reference to a function object, install the
  
  
  
  1.41      +7 -85     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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- XPathProcessorImpl.cpp    2001/06/06 21:51:24     1.40
  +++ XPathProcessorImpl.cpp    2001/06/14 19:12:20     1.41
  @@ -86,7 +86,6 @@
        m_xpath(0),
        m_expression(0),
        m_prefixResolver(0),
  -     m_envSupport(0),
        m_requireLiterals(false)
   {
   }
  @@ -103,16 +102,15 @@
   XPathProcessorImpl::initXPath(
                        XPath&                                          pathObj,
                        const XalanDOMString&           expression,
  -                     const PrefixResolver&           prefixResolver,
  -                     const XPathEnvSupport&          envSupport)
  +                     const PrefixResolver&           prefixResolver)
   {
        m_requireLiterals = false;
   
        m_xpath = &pathObj;
  +
        m_expression = &m_xpath->getExpression();
   
        m_prefixResolver = &prefixResolver;
  -     m_envSupport = &envSupport;
   
        tokenize(expression);
   
  @@ -130,7 +128,6 @@
        m_xpath = 0;
        m_expression = 0;
        m_prefixResolver = 0;
  -     m_envSupport = 0;
   }
   
   
  @@ -139,14 +136,14 @@
   XPathProcessorImpl::initMatchPattern(
                        XPath&                                  pathObj,
                        const XalanDOMString&   expression,
  -                     const PrefixResolver&   prefixResolver,
  -                     const XPathEnvSupport&  envSupport)
  +                     const PrefixResolver&   prefixResolver)
   {
        m_xpath = &pathObj;
  +
        m_expression = &m_xpath->getExpression();
   
        m_prefixResolver = &prefixResolver;
  -     m_envSupport = &envSupport;
  +
        m_expression->reset();
   
        tokenize(expression);
  @@ -170,7 +167,6 @@
        m_xpath = 0;
        m_expression = 0;
        m_prefixResolver = 0;
  -     m_envSupport = 0;
   }
   
   
  @@ -895,40 +891,6 @@
   
   
   void
  -XPathProcessorImpl::warn(
  -                     const XalanDOMString&   msg,
  -                     XalanNode*                              sourceNode) 
const
  -{
  -     assert(m_envSupport != 0);
  -
  -     const bool      shouldThrow =
  -             m_envSupport->problem(XPathEnvSupport::eXPATHParser, 
  -                                                       
XPathEnvSupport::eWarning,
  -                                                       m_prefixResolver, 
  -                                                       sourceNode,
  -                                                       msg,
  -                                                       0,
  -                                                       0);
  -
  -     if(shouldThrow == true)
  -     {
  -       throw XPathParserException(msg);
  -     }
  -}
  - 
  -
  -
  -void
  -XPathProcessorImpl::warn(
  -                     const char*             msg,
  -                     XalanNode*              sourceNode) const
  -{
  -     warn(TranscodeFromLocalCodePage(msg), sourceNode);
  -}
  -
  -
  -
  -void
   XPathProcessorImpl::error(
                        const XalanDOMString&   msg,
                        XalanNode*                              sourceNode) 
const
  @@ -963,22 +925,8 @@
                // Ask the expression to dump the remaining tokens...
                m_expression->dumpRemainingTokenQueue(thePrintWriter);
        }
  -
  -     assert(m_envSupport != 0);
  -
  -     const bool      shouldThrow =
  -             m_envSupport->problem(XPathEnvSupport::eXPATHParser, 
  -                                                       
XPathEnvSupport::eError,
  -                                                       m_prefixResolver, 
  -                                                       sourceNode,
  -                                                       emsg,
  -                                                       0,
  -                                                       0);
   
  -     if(shouldThrow == true)
  -     {
  -             throw XPathParserException(emsg);
  -     }
  +     throw XPathParserException(emsg);
   }
   
   
  @@ -1323,10 +1271,6 @@
                {
                        theOpCode = XPathExpression::eOP_MOD;
                }
  -             else if(tokenIs(s_quoString) == true)
  -             {
  -                     theOpCode = XPathExpression::eOP_QUO;
  -             }
   
                if (theOpCode != XPathExpression::eENDOP)
                {
  @@ -1399,22 +1343,6 @@
   
   
   void
  -XPathProcessorImpl::StringExpr()
  -{
  -     const int       opPos = m_expression->opCodeMapLength();
  -
  -     m_expression->appendOpCode(XPathExpression::eOP_STRING);
  -
  -     Expr();
  -
  -     // $$$ ToDo: Is this really necessary?
  -     m_expression->updateOpCodeLength(XPathExpression::eOP_STRING,
  -                                                                      opPos);
  -}
  -
  -
  -
  -void
   XPathProcessorImpl::BooleanExpr()
   {
        const int       opPos = m_expression->opCodeMapLength();
  @@ -1727,7 +1655,7 @@
        {
                if (isValidFunction(m_token) == false)
                {
  -                     warn(TranscodeFromLocalCodePage("Could not find 
function: ") +
  +                     error(TranscodeFromLocalCodePage("Could not find 
function: ") +
                                 m_token +
                                 TranscodeFromLocalCodePage("()"));
                }
  @@ -2554,8 +2482,6 @@
   
   static XalanDOMString        s_modString;
   
  -static XalanDOMString        s_quoString;
  -
   static XalanDOMString        s_dotString;
   
   static XalanDOMString        s_dotDotString;
  @@ -2582,8 +2508,6 @@
   
   const XalanDOMString&        XPathProcessorImpl::s_modString = ::s_modString;
   
  -const XalanDOMString&        XPathProcessorImpl::s_quoString = ::s_quoString;
  -
   const XalanDOMString&        XPathProcessorImpl::s_dotString = ::s_dotString;
   
   const XalanDOMString&        XPathProcessorImpl::s_dotDotString = 
::s_dotDotString;
  @@ -2623,7 +2547,6 @@
        ::s_andString = XALAN_STATIC_UCODE_STRING("and");
        ::s_divString = XALAN_STATIC_UCODE_STRING("div");
        ::s_modString = XALAN_STATIC_UCODE_STRING("mod");
  -     ::s_quoString = XALAN_STATIC_UCODE_STRING("quo");
        ::s_dotString = XALAN_STATIC_UCODE_STRING(".");
        ::s_dotDotString = XALAN_STATIC_UCODE_STRING("..");
        ::s_axisString = XALAN_STATIC_UCODE_STRING("::");
  @@ -2647,7 +2570,6 @@
        releaseMemory(::s_andString);
        releaseMemory(::s_divString);
        releaseMemory(::s_modString);
  -     releaseMemory(::s_quoString);
        releaseMemory(::s_dotString);
        releaseMemory(::s_dotDotString);
        releaseMemory(::s_axisString);
  
  
  
  1.15      +4 -36     xml-xalan/c/src/XPath/XPathProcessorImpl.hpp
  
  Index: XPathProcessorImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathProcessorImpl.hpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XPathProcessorImpl.hpp    2001/06/06 21:51:24     1.14
  +++ XPathProcessorImpl.hpp    2001/06/14 19:12:22     1.15
  @@ -147,15 +147,13 @@
        initXPath(
                        XPath&                                  pathObj,
                        const XalanDOMString&   expression,
  -                     const PrefixResolver&   prefixResolver,
  -                     const XPathEnvSupport&  envSupport);
  +                     const PrefixResolver&   prefixResolver);
   
        virtual void
        initMatchPattern(
                        XPath&                                  pathObj,
                        const XalanDOMString&   expression,
  -                     const PrefixResolver&   prefixResolver,
  -                     const XPathEnvSupport&  envSupport);
  +                     const PrefixResolver&   prefixResolver);
   
   private:
   
  @@ -390,33 +388,15 @@
        isCurrentLiteral() const;
   
        /**
  -      * Warn the user of an problem.
  +      * Throw an exception using the provided message text.
         */
        void
  -     warn(
  -                     const XalanDOMString&   msg,
  -                     XalanNode*                              sourceNode = 0) 
const;
  -
  -     /**
  -      * Warn the user of an problem.
  -      */
  -     void
  -     warn(
  -                     const char*             msg,
  -                     XalanNode*              sourceNode = 0) const;
  -
  -     /**
  -      * Tell the user of an error, and probably throw an 
  -      * exception.
  -      */
  -     void
        error(
                        const XalanDOMString&   msg,
                        XalanNode*                              sourceNode = 0) 
const;
   
        /**
  -      * Tell the user of an error, and probably throw an 
  -      * exception.
  +      * Throw an exception using the provided message text.
         */
        void
        error(
  @@ -531,14 +511,6 @@
         */
        void
        UnaryExpr();
  -  
  -     /**
  -      * 
--------------------------------------------------------------------------------
  -      StringExpr  ::=        Expr   
  -      * 
--------------------------------------------------------------------------------
  -      */
  -     void
  -     StringExpr();
   
        /**
         * 
  @@ -832,8 +804,6 @@
         */
        const PrefixResolver*                   m_prefixResolver;
   
  -     const XPathEnvSupport*                  m_envSupport;
  -
        bool                                                    
m_requireLiterals;
   
        enum eDummy
  @@ -858,8 +828,6 @@
        static const XalanDOMString&    s_divString;
   
        static const XalanDOMString&    s_modString;
  -
  -     static const XalanDOMString&    s_quoString;
   
        static const XalanDOMString&    s_dotString;
   
  
  
  
  1.23      +18 -3     xml-xalan/c/src/XPath/XResultTreeFrag.cpp
  
  Index: XResultTreeFrag.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XResultTreeFrag.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- XResultTreeFrag.cpp       2001/06/06 21:49:03     1.22
  +++ XResultTreeFrag.cpp       2001/06/14 19:12:24     1.23
  @@ -274,6 +274,7 @@
   unsigned int
   XResultTreeFrag::getLength() const
   {
  +     return 1;
        assert(m_value.get() != 0);
   
        unsigned int    theLength = 0;
  @@ -336,7 +337,14 @@
   XalanNode*
   XResultTreeFrag::NodeRefListBaseProxy::item(unsigned int     index) const
   {
  -     return m_xresultTreeFrag.item(index);
  +     if (index == 0)
  +     {
  +             return m_xresultTreeFrag.m_value.get();
  +     }
  +     else
  +     {
  +             return 0;
  +     }
   }
   
   
  @@ -344,7 +352,7 @@
   unsigned int
   XResultTreeFrag::NodeRefListBaseProxy::getLength() const
   {
  -     return m_xresultTreeFrag.getLength();
  +     return 1;
   }
   
   
  @@ -352,7 +360,14 @@
   unsigned int
   XResultTreeFrag::NodeRefListBaseProxy::indexOf(const XalanNode*      
theNode) const
   {
  -     return m_xresultTreeFrag.indexOf(theNode);
  +     if (theNode == m_xresultTreeFrag.m_value.get())
  +     {
  +             return 0;
  +     }
  +     else
  +     {
  +             return NodeRefListBase::npos;
  +     }
   }
   
   
  
  
  
  1.24      +3 -1      xml-xalan/c/src/XPath/XResultTreeFrag.hpp
  
  Index: XResultTreeFrag.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XResultTreeFrag.hpp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- XResultTreeFrag.hpp       2001/06/06 21:49:04     1.23
  +++ XResultTreeFrag.hpp       2001/06/14 19:12:25     1.24
  @@ -178,7 +178,9 @@
        void
        set(BorrowReturnResultTreeFrag& theValue);
   
  -     class  NodeRefListBaseProxy : public NodeRefListBase
  +     // This is a proxy class for result tree fragment to node-set
  +     // conversion.
  +     class XALAN_XPATH_EXPORT NodeRefListBaseProxy : public NodeRefListBase
        {
        public:
   
  
  
  
  1.3       +9 -8      xml-xalan/c/src/XPath/XStringBase.cpp
  
  Index: XStringBase.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XStringBase.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XStringBase.cpp   2001/01/16 02:32:39     1.2
  +++ XStringBase.cpp   2001/06/14 19:12:26     1.3
  @@ -139,17 +139,18 @@
   {
        if (m_resultTreeFrag.get() == 0)
        {
  -             XalanDocument* const    theFactory = 
executionContext.getDOMFactory();
  -             assert(theFactory != 0);
  +             ResultTreeFrag* const   theFrag = new ResultTreeFrag;
   
  -             ResultTreeFrag* const   theFrag =
  -                     new ResultTreeFrag(theFactory);
  +             XalanDocument* const    theFactory = 
executionContext.getDOMFactory();
   
  -             XalanNode* const        textNode =
  -                     theFactory->createTextNode(str());
  -             assert(textNode != 0);
  +             if (theFactory != 0)
  +             {
  +                     XalanNode* const        textNode =
  +                             theFactory->createTextNode(str());
  +                     assert(textNode != 0);
   
  -             theFrag->appendChild(textNode);
  +                     theFrag->appendChild(textNode);
  +             }
   
   #if defined(XALAN_NO_MUTABLE)
                ((XStringBase*)this)->m_resultTreeFrag.reset(theFrag);
  
  
  
  1.1                  xml-xalan/c/src/XPath/NodeRefListResultTreeFragProxy.cpp
  
  Index: NodeRefListResultTreeFragProxy.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 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 [EMAIL PROTECTED]
   *
   * 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 header file.
  #include "NodeRefListResultTreeFragProxy.hpp"
  
  
  
  #include <XalanDOM/XalanDOMException.hpp>
  
  
  
  #include "NodeRefListBase.hpp"
  
  
  
  const XalanDOMString  NodeRefListResultTreeFragProxy::s_emptyString;
  
  
  
  NodeRefListResultTreeFragProxy::NodeRefListResultTreeFragProxy(const 
NodeRefListBase& theValue) :
        ResultTreeFragBase(),
        XalanNodeList(),
        m_value(theValue)
  {
  }
  
  
  
  NodeRefListResultTreeFragProxy::~NodeRefListResultTreeFragProxy()
  {
  }
  
  
  
  void
  NodeRefListResultTreeFragProxy::clear()
  {
        assert(false);
  }
  
  
  
  const XalanDOMString&
  NodeRefListResultTreeFragProxy::getNodeName() const
  {
        return s_emptyString;
  }
  
  
  
  const XalanDOMString&
  NodeRefListResultTreeFragProxy::getNodeValue() const
  {
        return s_emptyString;
  }
  
  
  
  NodeRefListResultTreeFragProxy::NodeType
  NodeRefListResultTreeFragProxy::getNodeType() const
  {
        return DOCUMENT_FRAGMENT_NODE;
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::getParentNode() const
  {
        return 0;
  }
  
  
  
  const XalanNodeList*
  NodeRefListResultTreeFragProxy::getChildNodes() const
  {
        return this;
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::getFirstChild() const
  {
        return m_value.getLength() == 0 ? 0 : m_value.item(0);
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::getLastChild() const
  {
        const unsigned int      theLength = m_value.getLength();
        
        return theLength == 0 ? 0 : m_value.item(theLength - 1);
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::getPreviousSibling() const
  {
        return 0;
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::getNextSibling() const
  {
        return 0;
  }
  
  
  
  const XalanNamedNodeMap*
  NodeRefListResultTreeFragProxy::getAttributes() const
  {
        return 0;
  }
  
  
  
  XalanDocument*
  NodeRefListResultTreeFragProxy::getOwnerDocument() const
  {
        return 0;
  }
  
  
  
  #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
  XalanNode*
  #else
  NodeRefListResultTreeFragProxy*
  #endif
  NodeRefListResultTreeFragProxy::cloneNode(bool        /* deep */) const
  {
        throw XalanDOMException(XalanDOMException::NOT_SUPPORTED_ERR);
  
        return 0;
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::insertBefore(
                        XalanNode*      /* newChild */,
                        XalanNode*      /* refChild */)
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  
        // Dummy return value...
        return 0;
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::replaceChild(
                        XalanNode*      /* newChild */,
                        XalanNode*      /* oldChild */)
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  
        // Dummy return value...
        return 0;
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::appendChild(XalanNode*        /* newChild */ )
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  
        // Dummy return value...
        return 0;
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::removeChild(XalanNode*        /* oldChild */)
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  
        // Dummy return value...
        return 0;
  }
  
  
  bool
  NodeRefListResultTreeFragProxy::hasChildNodes() const
  {
        return getLength() > 0 ? true : false;
  }
  
  
  
  void
  NodeRefListResultTreeFragProxy::setNodeValue(const XalanDOMString&    /* 
nodeValue */)
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  }
  
  
  
  void
  NodeRefListResultTreeFragProxy::normalize()
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  }
  
  
  
  bool
  NodeRefListResultTreeFragProxy::supports(
                        const XalanDOMString&   /* feature */,
                        const XalanDOMString&   /* version */) const
  {
        return false;
  }
  
  
  
  const XalanDOMString&
  NodeRefListResultTreeFragProxy::getNamespaceURI() const
  {
        return s_emptyString;
  }
  
  
  
  const XalanDOMString&
  NodeRefListResultTreeFragProxy::getPrefix() const
  {
        return s_emptyString;
  }
  
  
  
  const XalanDOMString&
  NodeRefListResultTreeFragProxy::getLocalName() const
  {
        return s_emptyString;
  }
  
  
  
  void
  NodeRefListResultTreeFragProxy::setPrefix(const XalanDOMString&               
/* prefix */)
  {
  }
  
  
  
  bool
  NodeRefListResultTreeFragProxy::isIndexed() const
  {
        return false;
  }
  
  
  
  unsigned long
  NodeRefListResultTreeFragProxy::getIndex() const
  {
        return 0;
  }
  
  
  
  #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
  ResultTreeFragBase*
  #else
  NodeRefListResultTreeFragProxy*
  #endif
  NodeRefListResultTreeFragProxy::clone(bool    /* deep */) const
  {
        assert(false);
  
        return 0;
  }
  
  
  
  XalanNode*
  NodeRefListResultTreeFragProxy::item(unsigned int     index) const
  {
        assert(index < m_value.getLength());
  
        return m_value.item(index);
  }
  
  
  
  unsigned int
  NodeRefListResultTreeFragProxy::getLength() const
  {
        return m_value.getLength();
  }
  
  
  
  1.1                  xml-xalan/c/src/XPath/NodeRefListResultTreeFragProxy.hpp
  
  Index: NodeRefListResultTreeFragProxy.hpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 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 [EMAIL PROTECTED]
   *
   * 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(NODEREFLISTRESULTTREEFRAGPROXY_HEADER_GUARD_1357924680)
  #define NODEREFLISTRESULTTREEFRAGPROXY_HEADER_GUARD_1357924680
  
  
  
  // Base include file.  Must be first.
  #include <XPath/XPathDefinitions.hpp>
  
  
  
  #include <XalanDOM/XalanNodeList.hpp>
  
  
  
  #include <XPath/ResultTreeFragBase.hpp>
  
  
  
  class NodeRefListBase;
  
  
  
  class XALAN_XPATH_EXPORT NodeRefListResultTreeFragProxy : public 
ResultTreeFragBase, private XalanNodeList
  {
  public:
  
        NodeRefListResultTreeFragProxy(const NodeRefListBase&   value);
  
        virtual
        ~NodeRefListResultTreeFragProxy();
  
        // These interfaces are inherited from ResultTreeFragBase...
  
        virtual void
        clear();
  
        virtual const XalanDOMString&
        getNodeName() const;
  
        virtual const XalanDOMString&
        getNodeValue() const;
  
        virtual NodeType
        getNodeType() const;
  
        virtual XalanNode*
        getParentNode() const;
  
        virtual const XalanNodeList*
        getChildNodes() const;
  
        virtual XalanNode*
        getFirstChild() const;
  
        virtual XalanNode*
        getLastChild() const;
  
        virtual XalanNode*
        getPreviousSibling() const;
  
        virtual XalanNode*
        getNextSibling() const;
  
        virtual const XalanNamedNodeMap*
        getAttributes() const;
  
        virtual XalanDocument*
        getOwnerDocument() const;
  
  #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
        virtual XalanNode*
  #else
        virtual ResultTreeFragBase*
  #endif
        cloneNode(bool deep) const;
  
        virtual XalanNode*
        insertBefore(
                        XalanNode*      newChild,
                        XalanNode*      refChild);
  
        virtual XalanNode*
        replaceChild(
                        XalanNode*      newChild,
                        XalanNode*      oldChild);
  
        virtual XalanNode*
        removeChild(XalanNode*  oldChild);
  
        virtual XalanNode*
        appendChild(XalanNode*  newChild);
  
        virtual bool
        hasChildNodes() const;
  
        virtual void
        setNodeValue(const XalanDOMString&      nodeValue);
  
        virtual void
        normalize();
  
        virtual bool
        supports(
                        const XalanDOMString&   feature,
                        const XalanDOMString&   version) const;
  
        virtual const XalanDOMString&
        getNamespaceURI() const;
  
        virtual const XalanDOMString&
        getPrefix() const;
  
        virtual const XalanDOMString&
        getLocalName() const;
  
        virtual void
        setPrefix(const XalanDOMString&         prefix);
  
        virtual bool
        isIndexed() const;
  
        virtual unsigned long
        getIndex() const;
  
        virtual ResultTreeFragBase*
        clone(bool      deep) const;
  
  private:
  
        // Not implemented...
        NodeRefListResultTreeFragProxy(const NodeRefListResultTreeFragProxy&    
theSource);
  
        NodeRefListResultTreeFragProxy&
        operator=(const NodeRefListResultTreeFragProxy& theRHS);
  
        bool
        operator==(const NodeRefListResultTreeFragProxy&        theRHS);
  
  
        // These methods are inherited from XalanNodeList...
  
        virtual XalanNode*
        item(unsigned int       index) const;
  
        virtual unsigned int
        getLength() const;
  
        // Data members...
        const NodeRefListBase&          m_value;
  
        static const XalanDOMString             s_emptyString;
  
  };
  
  
  
  #endif        // NODEREFLISTRESULTTREEFRAGPROXY_HEADER_GUARD_1357924680
  
  
  
  1.1                  xml-xalan/c/src/XPath/XNodeSetBase.cpp
  
  Index: XNodeSetBase.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 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 [EMAIL PROTECTED]
   *
   * 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 header file.
  #include "XNodeSetBase.hpp"
  
  
  
  #include <XalanDOM/XalanNode.hpp>
  
  
  
  #include <PlatformSupport/DOMStringHelper.hpp>
  #include <PlatformSupport/DoubleSupport.hpp>
  
  
  
  #include <DOMSupport/DOMServices.hpp>
  
  
  
  #include "ResultTreeFrag.hpp"
  #include "XObjectTypeCallback.hpp"
  #include "XPathExecutionContext.hpp"
  
  
  
  const double  theBogusNumberValue = 123456789;
  
  
  
  XNodeSetBase::XNodeSetBase() :
        XObject(eTypeNodeSet),
        m_proxy(*this),
        m_cachedStringValue(),
        m_cachedNumberValue(theBogusNumberValue)
  {
  }
  
  
  
  XNodeSetBase::XNodeSetBase(const XNodeSetBase&        source) :
        XObject(source),
        m_proxy(*this),
        m_cachedStringValue(source.m_cachedStringValue),
        m_cachedNumberValue(source.m_cachedNumberValue)
  {
  }
  
  
  
  XNodeSetBase::~XNodeSetBase()
  {
  }
  
  
  
  XalanDOMString
  XNodeSetBase::getTypeString() const
  {
        return XALAN_STATIC_UCODE_STRING("#NODESET");
  }
  
  
  
  double
  XNodeSetBase::num() const
  {
        if (DoubleSupport::equal(m_cachedNumberValue, theBogusNumberValue) == 
true)
        {
  #if defined(XALAN_NO_MUTABLE)
                ((XNodeSetBase*)this)->m_cachedNumberValue = 
DoubleSupport::toDouble(str());
  #else
                m_cachedNumberValue = DoubleSupport::toDouble(str());
  #endif
        }
  
        return m_cachedNumberValue;
  }
  
  
  
  bool
  XNodeSetBase::boolean() const
  {
        return getLength() > 0 ? true : false;
  }
  
  
  
  const XalanDOMString&
  XNodeSetBase::str() const
  {
        if (isEmpty(m_cachedStringValue) == true &&
                getLength() > 0)
        {
                const XalanNode* const  theNode = item(0);
                assert(theNode != 0);
  
  #if defined(XALAN_NO_MUTABLE)
                DOMServices::getNodeData(*theNode, 
((XNodeSetBase*)this)->m_cachedStringValue);
  #else
                DOMServices::getNodeData(*theNode, m_cachedStringValue);
  #endif
        }
  
        return m_cachedStringValue;
  }
  
  
  
  void
  XNodeSetBase::str(
                        FormatterListener&      formatterListener,
                        MemberFunctionPtr       function) const
  {
        if (isEmpty(m_cachedStringValue) == false)
        {
                (formatterListener.*function)(c_wstr(m_cachedStringValue), 
length(m_cachedStringValue));
        }
        else if (getLength() > 0)
        {
                const XalanNode* const  theNode = item(0);
                assert(theNode != 0);
  
                DOMServices::getNodeData(*theNode, formatterListener, function);
        }
  }
  
  
  
  void
  XNodeSetBase::str(XalanDOMString&     theBuffer) const
  {
        if (isEmpty(m_cachedStringValue) == false)
        {
                append(theBuffer, m_cachedStringValue);
        }
        else if (getLength() > 0)
        {
                const XalanNode* const  theNode = item(0);
                assert(theNode != 0);
  
                DOMServices::getNodeData(*theNode, theBuffer);
        }
  }
  
  
  
  const ResultTreeFragBase&
  XNodeSetBase::rtree(XPathExecutionContext&    /* executionContext */) const
  {
        return m_proxy;
  }
  
  
  
  void
  XNodeSetBase::ProcessXObjectTypeCallback(XObjectTypeCallback& 
theCallbackObject)
  {
        theCallbackObject.NodeSet(*this,
                                                          nodeset());
  }
  
  
  
  void
  XNodeSetBase::ProcessXObjectTypeCallback(XObjectTypeCallback& 
theCallbackObject) const
  {
        theCallbackObject.NodeSet(*this,
                                                          nodeset());
  }
  
  
  
  void
  XNodeSetBase::clearCachedValues()
  {
        m_cachedNumberValue = theBogusNumberValue;
  
        clear(m_cachedStringValue);
  }
  
  
  
  1.1                  xml-xalan/c/src/XPath/XNodeSetBase.hpp
  
  Index: XNodeSetBase.hpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 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 [EMAIL PROTECTED]
   *
   * 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(XNODESETBASE_HEADER_GUARD_1357924680)
  #define XNODESETBASE_HEADER_GUARD_1357924680
  
  
  
  // Base include file.  Must be first.
  #include <XPath/XPathDefinitions.hpp>
  
  
  
  // Base class header file.
  #include <XPath/XObject.hpp>
  
  
  
  #include <XPath/XNodeSetResultTreeFragProxy.hpp>
  
  
  
  /**
   * Class to hold XPath return types.
   */
  class XALAN_XPATH_EXPORT XNodeSetBase : public XObject
  {
  public:
  
        /**
         * Create an XNodeSetBase
         */
        XNodeSetBase();
  
        /**
         * Create an XNodeSetBase from another.
         *
         * @param source    object to copy
         */
        XNodeSetBase(const XNodeSetBase&        source);
  
        virtual
        ~XNodeSetBase();
  
        // These methods are inherited from XObject ...
  
  #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
        virtual XObject*
  #else
        virtual XNodeSetBase*
  #endif
        clone(void*             theAddress = 0) const = 0;
  
        virtual XalanDOMString
        getTypeString() const;
  
        virtual double
        num() const;
  
        virtual bool
        boolean() const;
  
        virtual const XalanDOMString&
        str() const;
  
        virtual void
        str(
                        FormatterListener&      formatterListener,
                        MemberFunctionPtr       function) const;
  
        virtual void
        str(XalanDOMString&     theBuffer) const;
  
        virtual const ResultTreeFragBase&
        rtree(XPathExecutionContext&    executionContext) const;
  
        virtual const NodeRefListBase&
        nodeset() const = 0;
  
        virtual void
        ProcessXObjectTypeCallback(XObjectTypeCallback&         
theCallbackObject);
  
        virtual void
        ProcessXObjectTypeCallback(XObjectTypeCallback&         
theCallbackObject) const;
  
        virtual XalanNode*
        item(unsigned int       index) const = 0;
  
        virtual unsigned int
        getLength() const = 0;
  
  protected:
  
        void
        clearCachedValues();
  
  private:
  
        // Not implemented...
        XNodeSetBase&
        operator=(const XNodeSetBase&);
  
        // Data members...
        XNodeSetResultTreeFragProxy                                     m_proxy;
  
        mutable XalanDOMString                                          
m_cachedStringValue;
  
        mutable double                                                          
m_cachedNumberValue;
  };
  
  
  
  #endif        // XNODESETBASE_HEADER_GUARD_1357924680
  
  
  
  1.1                  xml-xalan/c/src/XPath/XNodeSetResultTreeFragProxy.cpp
  
  Index: XNodeSetResultTreeFragProxy.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 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 [EMAIL PROTECTED]
   *
   * 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 header file.
  #include "XNodeSetResultTreeFragProxy.hpp"
  
  
  
  #include <XalanDOM/XalanDOMException.hpp>
  
  
  
  #include "NodeRefListBase.hpp"
  #include "XNodeSetBase.hpp"
  
  
  
  const XalanDOMString  XNodeSetResultTreeFragProxy::s_emptyString;
  
  
  
  XNodeSetResultTreeFragProxy::XNodeSetResultTreeFragProxy(const XNodeSetBase&  
theValue) :
        ResultTreeFragBase(),
        XalanNodeList(),
        m_value(theValue)
  {
  }
  
  
  
  XNodeSetResultTreeFragProxy::~XNodeSetResultTreeFragProxy()
  {
  }
  
  
  
  void
  XNodeSetResultTreeFragProxy::clear()
  {
        assert(false);
  }
  
  
  
  const XalanDOMString&
  XNodeSetResultTreeFragProxy::getNodeName() const
  {
        return s_emptyString;
  }
  
  
  
  const XalanDOMString&
  XNodeSetResultTreeFragProxy::getNodeValue() const
  {
        return s_emptyString;
  }
  
  
  
  XNodeSetResultTreeFragProxy::NodeType
  XNodeSetResultTreeFragProxy::getNodeType() const
  {
        return DOCUMENT_FRAGMENT_NODE;
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::getParentNode() const
  {
        return 0;
  }
  
  
  
  const XalanNodeList*
  XNodeSetResultTreeFragProxy::getChildNodes() const
  {
        return this;
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::getFirstChild() const
  {
        return m_value.getLength() == 0 ? 0 : m_value.item(0);
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::getLastChild() const
  {
        const unsigned int      theLength = m_value.getLength();
        
        return theLength == 0 ? 0 : m_value.item(theLength - 1);
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::getPreviousSibling() const
  {
        return 0;
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::getNextSibling() const
  {
        return 0;
  }
  
  
  
  const XalanNamedNodeMap*
  XNodeSetResultTreeFragProxy::getAttributes() const
  {
        return 0;
  }
  
  
  
  XalanDocument*
  XNodeSetResultTreeFragProxy::getOwnerDocument() const
  {
        return 0;
  }
  
  
  
  #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
  XalanNode*
  #else
  XNodeSetResultTreeFragProxy*
  #endif
  XNodeSetResultTreeFragProxy::cloneNode(bool   /* deep */) const
  {
        throw XalanDOMException(XalanDOMException::NOT_SUPPORTED_ERR);
  
        return 0;
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::insertBefore(
                        XalanNode*      /* newChild */,
                        XalanNode*      /* refChild */)
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  
        // Dummy return value...
        return 0;
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::replaceChild(
                        XalanNode*      /* newChild */,
                        XalanNode*      /* oldChild */)
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  
        // Dummy return value...
        return 0;
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::appendChild(XalanNode*   /* newChild */ )
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  
        // Dummy return value...
        return 0;
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::removeChild(XalanNode*   /* oldChild */)
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  
        // Dummy return value...
        return 0;
  }
  
  
  bool
  XNodeSetResultTreeFragProxy::hasChildNodes() const
  {
        return getLength() > 0 ? true : false;
  }
  
  
  
  void
  XNodeSetResultTreeFragProxy::setNodeValue(const XalanDOMString&       /* 
nodeValue */)
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  }
  
  
  
  void
  XNodeSetResultTreeFragProxy::normalize()
  {
        throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  }
  
  
  
  bool
  XNodeSetResultTreeFragProxy::supports(
                        const XalanDOMString&   /* feature */,
                        const XalanDOMString&   /* version */) const
  {
        return false;
  }
  
  
  
  const XalanDOMString&
  XNodeSetResultTreeFragProxy::getNamespaceURI() const
  {
        return s_emptyString;
  }
  
  
  
  const XalanDOMString&
  XNodeSetResultTreeFragProxy::getPrefix() const
  {
        return s_emptyString;
  }
  
  
  
  const XalanDOMString&
  XNodeSetResultTreeFragProxy::getLocalName() const
  {
        return s_emptyString;
  }
  
  
  
  void
  XNodeSetResultTreeFragProxy::setPrefix(const XalanDOMString&          /* 
prefix */)
  {
  }
  
  
  
  bool
  XNodeSetResultTreeFragProxy::isIndexed() const
  {
        return false;
  }
  
  
  
  unsigned long
  XNodeSetResultTreeFragProxy::getIndex() const
  {
        return 0;
  }
  
  
  
  #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
  ResultTreeFragBase*
  #else
  XNodeSetResultTreeFragProxy*
  #endif
  XNodeSetResultTreeFragProxy::clone(bool       /* deep */) const
  {
        assert(false);
  
        return 0;
  }
  
  
  
  XalanNode*
  XNodeSetResultTreeFragProxy::item(unsigned int        index) const
  {
        assert(index < getLength());
  
        return m_value.nodeset().item(index);
  }
  
  
  
  unsigned int
  XNodeSetResultTreeFragProxy::getLength() const
  {
        return m_value.getLength();
  }
  
  
  
  1.1                  xml-xalan/c/src/XPath/XNodeSetResultTreeFragProxy.hpp
  
  Index: XNodeSetResultTreeFragProxy.hpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 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 [EMAIL PROTECTED]
   *
   * 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(XNODESETRESULTTREEFRAGPROXY_HEADER_GUARD_1357924680)
  #define XNODESETRESULTTREEFRAGPROXY_HEADER_GUARD_1357924680
  
  
  
  // Base include file.  Must be first.
  #include <XPath/XPathDefinitions.hpp>
  
  
  
  #include <XalanDOM/XalanNodeList.hpp>
  
  
  
  #include <XPath/ResultTreeFragBase.hpp>
  
  
  
  class XNodeSetBase;
  
  
  
  class XALAN_XPATH_EXPORT XNodeSetResultTreeFragProxy : public 
ResultTreeFragBase, private XalanNodeList
  {
  public:
  
        XNodeSetResultTreeFragProxy(const XNodeSetBase& value);
  
        virtual
        ~XNodeSetResultTreeFragProxy();
  
        // These interfaces are inherited from ResultTreeFragBase...
  
        virtual void
        clear();
  
        virtual const XalanDOMString&
        getNodeName() const;
  
        virtual const XalanDOMString&
        getNodeValue() const;
  
        virtual NodeType
        getNodeType() const;
  
        virtual XalanNode*
        getParentNode() const;
  
        virtual const XalanNodeList*
        getChildNodes() const;
  
        virtual XalanNode*
        getFirstChild() const;
  
        virtual XalanNode*
        getLastChild() const;
  
        virtual XalanNode*
        getPreviousSibling() const;
  
        virtual XalanNode*
        getNextSibling() const;
  
        virtual const XalanNamedNodeMap*
        getAttributes() const;
  
        virtual XalanDocument*
        getOwnerDocument() const;
  
  #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
        virtual XalanNode*
  #else
        virtual ResultTreeFragBase*
  #endif
        cloneNode(bool deep) const;
  
        virtual XalanNode*
        insertBefore(
                        XalanNode*      newChild,
                        XalanNode*      refChild);
  
        virtual XalanNode*
        replaceChild(
                        XalanNode*      newChild,
                        XalanNode*      oldChild);
  
        virtual XalanNode*
        removeChild(XalanNode*  oldChild);
  
        virtual XalanNode*
        appendChild(XalanNode*  newChild);
  
        virtual bool
        hasChildNodes() const;
  
        virtual void
        setNodeValue(const XalanDOMString&      nodeValue);
  
        virtual void
        normalize();
  
        virtual bool
        supports(
                        const XalanDOMString&   feature,
                        const XalanDOMString&   version) const;
  
        virtual const XalanDOMString&
        getNamespaceURI() const;
  
        virtual const XalanDOMString&
        getPrefix() const;
  
        virtual const XalanDOMString&
        getLocalName() const;
  
        virtual void
        setPrefix(const XalanDOMString&         prefix);
  
        virtual bool
        isIndexed() const;
  
        virtual unsigned long
        getIndex() const;
  
        virtual ResultTreeFragBase*
        clone(bool      deep) const;
  
  private:
  
        // Not implemented...
        XNodeSetResultTreeFragProxy(const XNodeSetResultTreeFragProxy&  
theSource);
  
        XNodeSetResultTreeFragProxy&
        operator=(const XNodeSetResultTreeFragProxy&    theRHS);
  
        bool
        operator==(const XNodeSetResultTreeFragProxy&   theRHS);
  
  
        // These methods are inherited from XalanNodeList...
  
        virtual XalanNode*
        item(unsigned int       index) const;
  
        virtual unsigned int
        getLength() const;
  
        // Data members...
        const XNodeSetBase&             m_value;
  
        static const XalanDOMString             s_emptyString;
  
  };
  
  
  
  #endif        // XNODESETRESULTTREEFRAGPROXY_HEADER_GUARD_1357924680
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to