dbertoni    00/06/01 09:27:25

  Modified:    c/src/XPath FunctionName.hpp XPathExecutionContext.hpp
                        XPathExecutionContextDefault.cpp
                        XPathExecutionContextDefault.hpp XPathSupport.hpp
                        XPathSupportDefault.cpp XPathSupportDefault.hpp
  Log:
  Added support for DOMServices::getNameOfNode().  Fixes conformance test pos76.
  
  Revision  Changes    Path
  1.6       +7 -39     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FunctionName.hpp  2000/04/20 16:28:31     1.5
  +++ FunctionName.hpp  2000/06/01 16:27:23     1.6
  @@ -68,14 +68,14 @@
   
   
   
  -#include <XalanDOM/XalanNode.hpp>
  -#include <XalanDOM/XalanAttr.hpp>
  -#include <XalanDOM/XalanDOMString.hpp>
  +// Base class header file...
  +#include <XPath/Function.hpp>
   
   
   
  -// Base class header file...
  -#include <XPath/Function.hpp>
  +#include <XalanDOM/XalanNode.hpp>
  +#include <XalanDOM/XalanAttr.hpp>
  +#include <XalanDOM/XalanDOMString.hpp>
   
   
   
  @@ -119,7 +119,7 @@
                        }
                        else
                        {
  -                             theResult = getNameFromNode(*context);
  +                             theResult = 
executionContext.getNameOfNode(*context);
                        }
                }
                else if (theSize == 1)
  @@ -132,7 +132,7 @@
                        {
                                assert(theNodeList.item(0) != 0);
   
  -                             theResult = 
getNameFromNode(*theNodeList.item(0));
  +                             theResult = 
executionContext.getNameOfNode(*theNodeList.item(0));
                        }
                }
                else
  @@ -152,38 +152,6 @@
        clone() const
        {
                return new FunctionName(*this);
  -     }
  -
  -protected:
  -
  -     /**
  -      * Retrieve the name of the first element in the nodelist
  -      * 
  -      * @param theNodeList node list
  -      * @return name string of node, or an empty string if node list is empty
  -      */
  -     virtual XalanDOMString
  -     getNameFromNode(const XalanNode&        theNode) const
  -     {
  -             XalanDOMString  theResult;
  -
  -             const XalanNode::NodeType       theNodeType =
  -                             theNode.getNodeType();
  -
  -             if (theNodeType == XalanNode::ATTRIBUTE_NODE)
  -             {
  -                     const XalanAttr&        theAttributeNode =
  -                                     reinterpret_cast<const 
XalanAttr&>(theNode);
  -
  -                     theResult = theAttributeNode.getName();
  -             }
  -             else if (theNodeType == XalanNode::ELEMENT_NODE ||
  -                              theNodeType == 
XalanNode::PROCESSING_INSTRUCTION_NODE)
  -             {
  -                     theResult = theNode.getNodeName();
  -             }
  -
  -             return theResult;
        }
   
   private:
  
  
  
  1.14      +11 -0     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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XPathExecutionContext.hpp 2000/05/24 19:36:05     1.13
  +++ XPathExecutionContext.hpp 2000/06/01 16:27:23     1.14
  @@ -172,6 +172,17 @@
        getNamespaceOfNode(const XalanNode&             n) const = 0;
   
        /**
  +      * Retrieve the name of the node, taking into
  +      * account the differences between the DOM and
  +      * XSLT data models.
  +      * 
  +      * @param node  DOM node whose name is returned
  +      * @return name of the node
  +      */
  +     virtual XalanDOMString
  +     getNameOfNode(const XalanNode&  n) const = 0;
  +
  +     /**
         * Returns the local name of the given node.
         * 
         * @param n node queried
  
  
  
  1.10      +8 -0      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XPathExecutionContextDefault.cpp  2000/05/24 19:36:05     1.9
  +++ XPathExecutionContextDefault.cpp  2000/06/01 16:27:23     1.10
  @@ -129,6 +129,14 @@
   
   
   XalanDOMString
  +XPathExecutionContextDefault::getNameOfNode(const XalanNode& n) const
  +{
  +     return m_xpathSupport.getNameOfNode(n);
  +}
  +
  +
  +
  +XalanDOMString
   XPathExecutionContextDefault::getLocalNameOfNode(const XalanNode&    n) const
   {
        return m_xpathSupport.getLocalNameOfNode(n);
  
  
  
  1.12      +3 -0      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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XPathExecutionContextDefault.hpp  2000/05/24 19:36:05     1.11
  +++ XPathExecutionContextDefault.hpp  2000/06/01 16:27:23     1.12
  @@ -125,6 +125,9 @@
        getNamespaceOfNode(const XalanNode&             n) const;
   
        virtual XalanDOMString
  +     getNameOfNode(const XalanNode&  n) const;
  +
  +     virtual XalanDOMString
        getLocalNameOfNode(const XalanNode&             n) const;
   
        virtual XalanNode*
  
  
  
  1.7       +11 -0     xml-xalan/c/src/XPath/XPathSupport.hpp
  
  Index: XPathSupport.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathSupport.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XPathSupport.hpp  2000/04/11 14:46:22     1.6
  +++ XPathSupport.hpp  2000/06/01 16:27:23     1.7
  @@ -122,6 +122,17 @@
        getNamespaceOfNode(const XalanNode&             n) const = 0;
   
        /**
  +      * Retrieve the name of the node, taking into
  +      * account the differences between the DOM and
  +      * XSLT data models.
  +      * 
  +      * @param node  DOM node whose name is returned
  +      * @return name of the node
  +      */
  +     virtual XalanDOMString
  +     getNameOfNode(const XalanNode&  n) const = 0;
  +
  +     /**
         * Retrieve local name of node
         * 
         * @param node  DOM node whose name is returned
  
  
  
  1.9       +8 -0      xml-xalan/c/src/XPath/XPathSupportDefault.cpp
  
  Index: XPathSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathSupportDefault.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XPathSupportDefault.cpp   2000/05/15 15:54:31     1.8
  +++ XPathSupportDefault.cpp   2000/06/01 16:27:23     1.9
  @@ -130,6 +130,14 @@
   
   
   XalanDOMString
  +XPathSupportDefault::getNameOfNode(const XalanNode&          n) const
  +{
  +     return DOMServices::getNameOfNode(n);
  +}
  +
  +
  +
  +XalanDOMString
   XPathSupportDefault::getLocalNameOfNode(const XalanNode&     n) const
   {
        return DOMServices::getLocalNameOfNode(n);
  
  
  
  1.7       +3 -0      xml-xalan/c/src/XPath/XPathSupportDefault.hpp
  
  Index: XPathSupportDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathSupportDefault.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XPathSupportDefault.hpp   2000/05/15 15:54:31     1.6
  +++ XPathSupportDefault.hpp   2000/06/01 16:27:23     1.7
  @@ -97,6 +97,9 @@
        getNamespaceOfNode(const XalanNode&             n) const;
   
        virtual XalanDOMString
  +     getNameOfNode(const XalanNode&  n) const;
  +
  +     virtual XalanDOMString
        getLocalNameOfNode(const XalanNode&             n) const;
   
        virtual XalanDOMString
  
  
  

Reply via email to