dbertoni    00/05/01 08:13:13

  Modified:    c/src/XSLT Constants.cpp Constants.hpp ElemLiteralResult.cpp
                        ElemNumber.cpp ElemNumber.hpp ElemUse.cpp
                        Stylesheet.cpp Stylesheet.hpp
                        StylesheetConstructionContext.hpp
                        StylesheetConstructionContextDefault.cpp
                        StylesheetConstructionContextDefault.hpp
                        StylesheetExecutionContext.hpp
                        StylesheetExecutionContextDefault.cpp
                        StylesheetExecutionContextDefault.hpp
                        StylesheetHandler.cpp XSLTEngineImpl.cpp
                        XSLTEngineImpl.hpp XSLTProcessorEnvSupport.hpp
                        XSLTProcessorEnvSupportDefault.cpp
                        XSLTProcessorEnvSupportDefault.hpp
  Log:
  Added better support for installing external functions, and fixed a few 
inconsistencies with the XSLT namespace URI.
  
  Revision  Changes    Path
  1.7       +3 -0      xml-xalan/c/src/XSLT/Constants.cpp
  
  Index: Constants.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Constants.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Constants.cpp     2000/04/27 15:12:06     1.6
  +++ Constants.cpp     2000/05/01 15:13:09     1.7
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   
   #include "Constants.hpp"
  @@ -138,6 +140,7 @@
   const XalanDOMString         
Constants::ATTRNAME_USE(XALAN_STATIC_UCODE_STRING("use"));
   const XalanDOMString         
Constants::ATTRNAME_USEATTRIBUTESETS(XALAN_STATIC_UCODE_STRING("use-attribute-sets"));
   const XalanDOMString         
Constants::ATTRNAME_VALUE(XALAN_STATIC_UCODE_STRING("value"));
  +const XalanDOMString         
Constants::ATTRNAME_VERSION(XALAN_STATIC_UCODE_STRING("version"));
   const XalanDOMString         
Constants::ATTRNAME_XMLNS(XALAN_STATIC_UCODE_STRING("xmlns:"));
   const XalanDOMString         
Constants::ATTRNAME_XMLNSDEF(XALAN_STATIC_UCODE_STRING("xmlns"));
   const XalanDOMString         
Constants::ATTRNAME_XMLSPACE(XALAN_STATIC_UCODE_STRING("xml:space"));
  
  
  
  1.9       +4 -1      xml-xalan/c/src/XSLT/Constants.hpp
  
  Index: Constants.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Constants.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Constants.hpp     2000/04/27 15:12:07     1.8
  +++ Constants.hpp     2000/05/01 15:13:09     1.9
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   #if !defined(XALAN_CONSTANTS_HEADER_GUARD)
   #define XALAN_CONSTANTS_HEADER_GUARD
  @@ -304,11 +306,12 @@
        static const XalanDOMString     ATTRNAME_USE;
        static const XalanDOMString     ATTRNAME_USEATTRIBUTESETS;
        static const XalanDOMString     ATTRNAME_VALUE;
  +     static const XalanDOMString     ATTRNAME_VERSION;
        static const XalanDOMString     ATTRNAME_XMLNS;
        static const XalanDOMString     ATTRNAME_XMLNSDEF;
        static const XalanDOMString     ATTRNAME_XMLSPACE;
        static const XalanDOMString     ATTRNAME_ZERODIGIT;
  -   static const XalanDOMString       ATTRNAME_STYLESHEET_PREFIX;
  +     static const XalanDOMString     ATTRNAME_STYLESHEET_PREFIX;
    
          // Atributes on the functions element
        static const XalanDOMString     ATTRNAME_NS;
  
  
  
  1.11      +12 -2     xml-xalan/c/src/XSLT/ElemLiteralResult.cpp
  
  Index: ElemLiteralResult.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemLiteralResult.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ElemLiteralResult.cpp     2000/04/20 16:47:34     1.10
  +++ ElemLiteralResult.cpp     2000/05/01 15:13:09     1.11
  @@ -122,12 +122,22 @@
                        {
                                XalanDOMString  ns = 
getNamespaceForPrefix(prefix);
   
  -                             if(startsWith(ns, 
constructionContext.getXSLNameSpaceURLPre()))
  +                             if(equals(ns, 
stylesheetTree.getXSLTNamespaceURI()))
                                {
                                        const XalanDOMString localName = 
substring(aname,indexOfNSSep + 1);
  -             processPrefixControl(localName, atts.getValue(i));
  +
  +                                     processPrefixControl(localName, 
atts.getValue(i));
  +
                                        if(0 != m_excludeResultPrefixes.size())
  +                                     {
                                                needToProcess = false;
  +                                     }
  +                                     else if (equals(localName, 
Constants::ATTRNAME_VERSION) == true)
  +                                     {
  +                                             const XalanDOMChar*     const   
value = atts.getValue(i);
  +
  +                                             
stylesheetTree.setXSLTVerDeclared(DOMStringToDouble(value));
  +                                     }
                                }
                        }
                        else
  
  
  
  1.14      +73 -56    xml-xalan/c/src/XSLT/ElemNumber.cpp
  
  Index: ElemNumber.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemNumber.cpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ElemNumber.cpp    2000/04/20 16:47:34     1.13
  +++ ElemNumber.cpp    2000/05/01 15:13:10     1.14
  @@ -69,7 +69,6 @@
   #include <PlatformSupport/DOMStringHelper.hpp>
   #include <PlatformSupport/NumberFormat.hpp>
   
  -#include <DOMSupport/DOMServices.hpp>
   
   
   #include <XPath/XPath.hpp>
  @@ -232,10 +231,11 @@
                        StylesheetExecutionContext&             
executionContext,
                        const XPath*                                    
fromMatchPattern,
                        const XPath*                                    
countMatchPattern,
  -                     const XalanNode* const                  context,
  +                     XalanNode*                                              
context,
                        const XalanElement*                             /* 
namespaceContext */) const
   {
  -     XalanNode*      contextCopy = const_cast<XalanNode*>(context);
  +     XalanNode*      contextCopy = context;
  +
        while(contextCopy != 0)
        {
                if(0 != fromMatchPattern)
  @@ -267,13 +267,14 @@
   
   XalanNode*
   ElemNumber::findPrecedingOrAncestorOrSelf(
  -                     StylesheetExecutionContext&     executionContext,
  -                     const XPath*                                            
fromMatchPattern,
  -                     const XPath*                                            
countMatchPattern,
  -                     const XalanNode* const                  context,
  +                     StylesheetExecutionContext&             
executionContext,
  +                     const XPath*                                    
fromMatchPattern,
  +                     const XPath*                                    
countMatchPattern,
  +                     XalanNode*                                              
context,
                        const XalanElement*                             /* 
namespaceContext */) const
   {  
  -     XalanNode*      contextCopy = const_cast<XalanNode*>(context);
  +     XalanNode*      contextCopy = context;
  +
        while(contextCopy != 0)
        {
                if(0 != fromMatchPattern)
  @@ -317,7 +318,7 @@
   const XPath*
   ElemNumber::getCountMatchPattern(
                        StylesheetExecutionContext&             
executionContext,
  -                     const XalanNode* const                          
contextNode) const
  +                     XalanNode*                                              
contextNode) const
   {
        const XPath*    countMatchPattern = m_countMatchPattern;
        if(0 == countMatchPattern)
  @@ -390,32 +391,39 @@
        {
                if(Constants::NUMBERLEVEL_ANY == m_level)
                {
  -                     numberList.push_back(ctable.countNode(executionContext, 
  -                     const_cast<ElemNumber*>(this), sourceNode));
  +                     numberList.push_back(ctable.countNode(
  +                                             executionContext, 
  +                                             this,
  +                                             sourceNode));
                }
                else
                {
                        MutableNodeRefList ancestors = 
getMatchingAncestors(executionContext, sourceNode,
  -                                     Constants.NUMBERLEVEL_SINGLE == 
m_level);
  -                     int lastIndex = ancestors.getLength();
  +                             Constants::NUMBERLEVEL_SINGLE == m_level);
  +
  +                     const unsigned int      lastIndex = 
ancestors.getLength();
  +
                        if(lastIndex > 0)
                        {
  -                             for(int i = 0; i < lastIndex; i++)
  +                             for(unsigned int i = 0; i < lastIndex; i++)
                                {
  -                                     const XalanNode* target = 
ancestors.item(lastIndex - i -1);
  -                                     
numberList.push_back(ctable.countNode(executionContext,
  -                                                     
const_cast<ElemNumber*>(this), target));
  +                                     XalanNode* const target = 
ancestors.item(lastIndex - i -1);
  +                                     numberList.push_back(ctable.countNode(
  +                                             executionContext,
  +                                             this,
  +                                             target));
                                }
                        }
                }
        }
  +
        return numberList.size() > 0 ? formatNumberList(executionContext, 
numberList, sourceNode) : XalanDOMString();
   }
   
   XalanNode*
   ElemNumber::getPreviousNode(
                StylesheetExecutionContext&             executionContext,
  -             XalanNode* pos)
  +             XalanNode* pos) const
   {    
        const XPath* countMatchPattern = getCountMatchPattern(executionContext, 
pos);
        if(Constants::NUMBERLEVEL_ANY == m_level)
  @@ -486,8 +494,8 @@
   
   XalanNode*
   ElemNumber::getTargetNode(
  -             StylesheetExecutionContext& executionContext,
  -             const XalanNode* const sourceNode)
  +             StylesheetExecutionContext&             executionContext,
  +             XalanNode*                                              
sourceNode) const
   {
        XalanNode* target = 0;
        const XPath* countMatchPattern =
  @@ -554,7 +562,7 @@
   } // end getMatchingAncestors method
   
   
  -#if ! defined(__GNUC__)
  +#if !defined(XALAN_NO_LOCALES)
   
   std::locale
   ElemNumber::getLocale(
  @@ -749,7 +757,7 @@
                                // Start at lower case Greek letters in entity 
reference table in
                                // FormatterToHTML
                                s_elalphaCountTable += 962;
  -                             for (int i=1, j=938; i<25; i++, j++)
  +                             for (unsigned short i = 1, j=938; i < 25; i++, 
j++)
                                        s_elalphaCountTable += j;
                        }
                        formattedNumber += int2alphaCount(listElement, 
s_elalphaCountTable);
  @@ -858,16 +866,16 @@
                        break;
   
                // put out the next character of output
  -             buf[charPos--] = static_cast<XalanDOMChar>(charAt(table, 
lookupIndex));
  +             buf[charPos--] = charAt(table, lookupIndex);
        }
        while (val > 0);
   
  -     XalanDOMString retStr(buf + charPos + 1, (buflen - charPos - 1));
  +     const XalanDOMString    retStr(buf + charPos + 1, (buflen - charPos - 
1));
   
        return retStr;
   }
   
  -XalanDOMString ElemNumber::tradAlphaCount(int val)
  +XalanDOMString ElemNumber::tradAlphaCount(int        /* val */)
   {
   //   @@ JMD: We don't do languages yet, so this is just a placeholder
        assert(0);
  @@ -1020,19 +1028,19 @@
    *                                   CountersTable Class Implementation
    */
   
  -ElemNumber::CounterVectorType& 
ElemNumber::CountersTable::getCounters(ElemNumber* numberElem)
  +ElemNumber::CounterVectorType& ElemNumber::CountersTable::getCounters(const 
ElemNumber* numberElem)
   {
  -     Ptr2CounterVectorMapType::iterator it = m_hashTable.find(numberElem);
  -     return (m_hashTable.end() == it) ? putElemNumber(numberElem) : 
(*it).second;
  +     const ElemToCounterVectorMapType::const_iterator        it =
  +             m_counterMap.find(numberElem);
  +
  +     return (m_counterMap.end() == it) ? putElemNumber(numberElem) : 
(*it).second;
   }
   
  -ElemNumber::CounterVectorType& 
ElemNumber::CountersTable::putElemNumber(ElemNumber*  numberElem)
  +ElemNumber::CounterVectorType& 
ElemNumber::CountersTable::putElemNumber(const ElemNumber*    numberElem)
   {
  -#if !defined(XALAN_NO_NAMESPACES)
  -     using std::make_pair;
  -#endif
  -     m_hashTable.insert(make_pair(numberElem, CounterVectorType()));
  -     return (*m_hashTable.find(numberElem)).second;
  +     m_counterMap.insert(ElemToCounterVectorMapType::value_type(numberElem, 
CounterVectorType()));
  +
  +     return m_counterMap.find(numberElem)->second;
   }
   
   void ElemNumber::CountersTable::appendBtoFList(MutableNodeRefList& flist, 
MutableNodeRefList& blist)
  @@ -1050,21 +1058,25 @@
    * @node The node to count.
    * @return The node count, or 0 if not found.
    */
  -int ElemNumber::CountersTable::countNode(
  -             StylesheetExecutionContext& support,
  -             ElemNumber*              numberElem,
  -             const XalanNode* const node)
  -{
  -     int count = 0;
  -     CounterVectorType& counters = getCounters(numberElem);
  -     int nCounters = counters.size();
  +int
  +ElemNumber::CountersTable::countNode(
  +                     StylesheetExecutionContext&             support,
  +                     const ElemNumber*                               
numberElem,
  +                     XalanNode*                                              
node)
  +{
  +     int             count = 0;
  +
  +     CounterVectorType&      counters = getCounters(numberElem);
  +
  +     const CounterVectorType::size_type      nCounters = counters.size();
  +
  +     XalanNode*      target = numberElem->getTargetNode(support, node);
   
  -     XalanNode* target = numberElem->getTargetNode(support, node);
        if(0 != target)
        {
  -             for(int i = 0; i < nCounters; i++)
  +             for(CounterVectorType::size_type i = 0; i < nCounters; i++)
                {    
  -                     Counter counter = counters[i];
  +                     const Counter&  counter = counters[i];
   
                        count = counter.getPreviouslyCounted(support, target);
                        if(count > 0)
  @@ -1086,14 +1098,16 @@
                        // block above.
                        if(0 != count)  
                        {
  -                             for(int i = 0; i < nCounters; i++)
  -                             {    
  -                                     Counter counter = counters[i];
  -                                     int cacheLen = 
counter.m_countNodes.getLength();
  +                             for(CounterVectorType::size_type i = 0; i < 
nCounters; i++)
  +                             {
  +                                     Counter&        counter = counters[i];
  +
  +                                     const unsigned int      cacheLen = 
counter.m_countNodes.getLength();
  +
                                        if((cacheLen > 0) &&
                                                        
(counter.m_countNodes.item(cacheLen-1) == target))
                                        {
  -                                             count += 
(cacheLen+counter.m_countNodesStartCount);
  +                                             count += cacheLen + 
counter.m_countNodesStartCount;
                                                if(cacheLen > 0)
                                                        
appendBtoFList(counter.m_countNodes, m_newFound);
                                                m_newFound.clear();
  @@ -1121,11 +1135,12 @@
    */
       
   int ElemNumber::Counter::getPreviouslyCounted(
  -             StylesheetExecutionContext& /*support */,
  -             const XalanNode* const node)
  +             StylesheetExecutionContext&             support,
  +             const XalanNode*                                node) const
   {
        int n = m_countNodes.getLength();
  -     m_countResult = 0;
  +     int result = 0;
  +
        for(int i = n-1;i >= 0; i--)
        {
                const XalanNode* countedNode = m_countNodes.item(i);
  @@ -1133,15 +1148,17 @@
                {
                        // Since the list is in backwards order, the count is 
                        // how many are in the rest of the list.
  -                     m_countResult = i+1+m_countNodesStartCount;
  +                     result = i + 1 + m_countNodesStartCount;
                        break;
                }
  +
                // Try to see if the given node falls after the counted node...
                // if it does, don't keep searching backwards.
  -             if(DOMServices::isNodeAfter(*countedNode, *node))
  +             if(support.isNodeAfter(*countedNode, *node))
                        break;
        }
  -     return m_countResult;
  +
  +     return result;
   }
   
   XalanNode* ElemNumber::Counter::getLast()
  
  
  
  1.11      +58 -64    xml-xalan/c/src/XSLT/ElemNumber.hpp
  
  Index: ElemNumber.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemNumber.hpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ElemNumber.hpp    2000/04/20 11:44:30     1.10
  +++ ElemNumber.hpp    2000/05/01 15:13:10     1.11
  @@ -58,7 +58,7 @@
   #define XALAN_ELEMNUMBER_HEADER_GUARD 
   
   /**
  - * $Id: ElemNumber.hpp,v 1.10 2000/04/20 11:44:30 jdonohue Exp $
  + * $Id: ElemNumber.hpp,v 1.11 2000/05/01 15:13:10 dbertoni Exp $
    * 
    * $State: Exp $
    * 
  @@ -109,13 +109,13 @@
   #else
   #     define XALAN_STD std::
   #endif
  -     typedef XALAN_STD vector<int> IntArrayType;
  -     typedef XALAN_STD vector<Counter> CounterVectorType;
  -     typedef XALAN_STD map<ElemNumber*, 
CounterVectorType>Ptr2CounterVectorMapType;
  -#    if ! defined(__GNUC__)
  +     typedef XALAN_STD vector<int>           IntArrayType;
  +     typedef XALAN_STD vector<Counter>       CounterVectorType;
  +     typedef XALAN_STD map<const ElemNumber*,        CounterVectorType>      
ElemToCounterVectorMapType;
  +#    if !defined(XALAN_NO_LOCALES)
        typedef XALAN_STD locale LocaleType;
   #    endif
  -#undef XALAN_STD     
  +#undef XALAN_STD
   
        /**
         * Construct an object corresponding to an "xsl:number" element
  @@ -130,7 +130,7 @@
        ElemNumber(
                        StylesheetConstructionContext&  constructionContext,
                        Stylesheet&                                             
stylesheetTree,
  -                     const XalanDOMString&                           name,
  +                     const XalanDOMString&                   name,
                        const AttributeList&                    atts,
                        int                                                     
        lineNumber,
                        int                                                     
        columnNumber);
  @@ -160,10 +160,10 @@
         */
        XalanNode*
        findAncestor(
  -                     StylesheetExecutionContext&     executionContext,
  -                     const XPath*                                            
fromMatchPattern,
  -                     const XPath*                                            
countMatchPattern,
  -                     const XalanNode* const                  context,
  +                     StylesheetExecutionContext&             
executionContext,
  +                     const XPath*                                    
fromMatchPattern,
  +                     const XPath*                                    
countMatchPattern,
  +                     XalanNode*                                              
context,
                        const XalanElement*                             
namespaceContext) const;
   
          /**
  @@ -177,10 +177,10 @@
           */
        XalanNode*
        findPrecedingOrAncestorOrSelf(
  -                     StylesheetExecutionContext&     executionContext,
  -                     const XPath*                                            
fromMatchPattern,
  -                     const XPath*                                            
countMatchPattern,
  -                     const XalanNode* const                  context,
  +                     StylesheetExecutionContext&             
executionContext,
  +                     const XPath*                                    
fromMatchPattern,
  +                     const XPath*                                    
countMatchPattern,
  +                     XalanNode*                                              
context,
                        const XalanElement*                             
namespaceContext) const;
   
        /**
  @@ -189,7 +189,7 @@
        const XPath*
        getCountMatchPattern(
                        StylesheetExecutionContext&             
executionContext,
  -                     const XalanNode* const                          
contextNode) const;
  +                     XalanNode*                                              
contextNode) const;
   
        /**
         * Given an XML source node, get the count according to the 
  @@ -198,22 +198,22 @@
        XalanDOMString
        getCountString(
                        StylesheetExecutionContext&             
executionContext,
  -                     XalanNode*                                              
        sourceTree, 
  -                     XalanNode*                                              
        sourceNode) const;
  +                     XalanNode*                                              
sourceTree, 
  +                     XalanNode*                                              
sourceNode) const;
   
        /**
         * Get the previous node to be counted.
         */
        XalanNode* getPreviousNode(
                        StylesheetExecutionContext&             
executionContext,
  -                     XalanNode* pos);
  +                     XalanNode*                                              
pos) const;
   
        /**
         * Get the target node that will be counted..
         */
        XalanNode* getTargetNode(
  -                     StylesheetExecutionContext& executionContext,
  -                     const XalanNode* const sourceNode);
  +                     StylesheetExecutionContext&             
executionContext,
  +                     XalanNode*                                              
sourceNode) const;
   
        /**
         * Get the ancestors, up to the root, that match the
  @@ -225,10 +225,10 @@
         */
        MutableNodeRefList getMatchingAncestors(
                        StylesheetExecutionContext&             
executionContext,
  -                     XalanNode* node, 
  -                     bool stopAtFirstFound) const;
  +                     XalanNode*                                              
node, 
  +                     bool                                                    
stopAtFirstFound) const;
   
  -#if ! defined(__GNUC__)
  +#if !defined(XALAN_NO_LOCALES)
        /**
         * Get the locale we should be using.
         */
  @@ -374,7 +374,7 @@
                         * @param theStr string to tokenize
                         */
                        explicit
  -                             NumberFormatStringTokenizer(const DOMString&    
theStr = DOMString());
  +                             NumberFormatStringTokenizer(const 
XalanDOMString&       theStr = XalanDOMString());
   
                        /**
                         * Sets the string to tokenize.
  @@ -382,7 +382,7 @@
                         * @param theString  new string to tokenize
                         */
                        void
  -                             setString(const DOMString&      theString);
  +                             setString(const XalanDOMString& theString);
   
                        /**
                         * Reset tokenizer so that nextToken() starts from the 
beginning.
  @@ -399,7 +399,7 @@
                         * 
                         * @return next token string
                         */
  -                     DOMString
  +                     XalanDOMString
                                nextToken();
   
                        /**
  @@ -423,9 +423,9 @@
   
                private:
   
  -                     int                     m_currentPosition;
  -                     int                     m_maxPosition;
  -                     DOMString       m_str;
  +                     int                             m_currentPosition;
  +                     int                             m_maxPosition;
  +                     XalanDOMString  m_str;
        }; // end NumberFormatStringTokenizer
   
        /**
  @@ -454,10 +454,11 @@
                         * @node The node to count.
                         * @return The node count, or 0 if not found.
                         */
  -                     int CountersTable::countNode(
  -                                     StylesheetExecutionContext& support,
  -                                     ElemNumber*              numberElem,
  -                                     const XalanNode* const node);
  +                     int
  +                     CountersTable::countNode(
  +                                     StylesheetExecutionContext&             
support,
  +                                     const ElemNumber*                       
        numberElem,
  +                                     XalanNode*                              
                node);
   
                private:
   
  @@ -465,14 +466,14 @@
                         * Get the list of counters that corresponds to 
                         * the given ElemNumber object.
                         */
  -                     CounterVectorType& getCounters(ElemNumber*              
 numberElem);
  +                     CounterVectorType& getCounters(const ElemNumber*        
numberElem);
   
   
                        /**
                         * Put a counter into the table and create an empty 
                         * vector as it's value.
                         */
  -                     CounterVectorType& putElemNumber(ElemNumber*            
 numberElem);
  +                     CounterVectorType& putElemNumber(const ElemNumber*      
numberElem);
   
                        /**
                         * Add a list of counted nodes that were built in 
backwards document 
  @@ -489,8 +490,7 @@
                        // For diagnostics
                        int m_countersMade;
   
  -                     // Since we're not really a hash table like in java, we 
need this
  -                     Ptr2CounterVectorMapType m_hashTable;
  +                     ElemToCounterVectorMapType      m_counterMap;
   
        }; // end CountersTable
   
  @@ -511,53 +511,46 @@
                 * in the m_countNodes vector is node position + 
                 * m_countNodesStartCount.
                 */
  -             int m_countNodesStartCount;
  +             int                                                     
m_countNodesStartCount;
   
                /**
                 * A vector of all nodes counted so far.
                 */
  -             MutableNodeRefList m_countNodes;
  +             MutableNodeRefList                      m_countNodes;
   
                /**
                 * The node from where the counting starts.  This is needed to 
                 * find a counter if the node being counted is not immediatly
                 * found in the m_countNodes vector.
                 */
  -             XalanNode* m_fromNode;
  +             const XalanNode*                        m_fromNode;
   
                /**
                 * The owning xsl:number element.
                 */
  -             ElemNumber* m_numberElem;
  +             const ElemNumber*                       m_numberElem;
   
                /**
  -              * Value to store result of last getCount call, for benifit
  -              * of returning val from CountersTable.getCounterByCounted, 
  -              * who calls getCount.
  -              */
  -             int m_countResult;
  -
  -             /**
                 * Construct a counter object.
                 */
  -             Counter(ElemNumber* numberElem, MutableNodeRefList& countNodes) 
:
  +             Counter(
  +                             const ElemNumber*               numberElem,
  +                             MutableNodeRefList&             countNodes) :
                        m_countNodesStartCount(0),
  -             m_countNodes(countNodes),
  -             m_fromNode(0),
  -             m_numberElem(numberElem),
  -             m_countResult(0)
  +                     m_countNodes(countNodes),
  +                     m_fromNode(0),
  +                     m_numberElem(numberElem)
                {
                }
   
                /**
                 * Construct a counter object.
                 */
  -             Counter(ElemNumber* numberElem) :
  +             Counter(const ElemNumber*       numberElem) :
                        m_countNodesStartCount(0),
  -             m_countNodes(),
  -             m_fromNode(0),
  -             m_numberElem(numberElem),
  -             m_countResult(0)
  +                     m_countNodes(),
  +                     m_fromNode(0),
  +                     m_numberElem(numberElem)
                {
                }
   
  @@ -567,15 +560,16 @@
                 * @param node The node to be counted.
                 * @returns The count of the node, or -1 if not found.
                 */
  -             int getPreviouslyCounted(
  -                             StylesheetExecutionContext& support,
  -                             const XalanNode* const node);
  +             int
  +             getPreviouslyCounted(
  +                             StylesheetExecutionContext&             support,
  +                             const XalanNode*                                
node) const;
   
                /**
                 * Get the last node in the list.
                 */
  -             XalanNode* getLast();
  -
  +             XalanNode*
  +             getLast();
        }; // end Counter
   
        friend struct Counter;
  
  
  
  1.4       +2 -2      xml-xalan/c/src/XSLT/ElemUse.cpp
  
  Index: ElemUse.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemUse.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ElemUse.cpp       2000/04/11 15:09:26     1.3
  +++ ElemUse.cpp       2000/05/01 15:13:10     1.4
  @@ -135,8 +135,8 @@
                const QName             qname(attrName, 
getStylesheet().getNamespaces());
   
                isUAS = ((equals(qname.getNamespace(),
  -                     constructionContext.getXSLNameSpaceURL())) &&
  -                     
(equals(qname.getLocalPart(),Constants::ATTRNAME_USEATTRIBUTESETS)));
  +                     constructionContext.getXSLTNamespaceURI())) &&
  +                     (equals(qname.getLocalPart(), 
Constants::ATTRNAME_USEATTRIBUTESETS)));
        }
        else
        {
  
  
  
  1.14      +2 -1      xml-xalan/c/src/XSLT/Stylesheet.cpp
  
  Index: Stylesheet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.cpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Stylesheet.cpp    2000/04/25 19:46:19     1.13
  +++ Stylesheet.cpp    2000/05/01 15:13:10     1.14
  @@ -133,6 +133,7 @@
        m_firstTemplate(0),
        m_includeStack(),
        m_defaultSpace(true),
  +     m_XSLTNamespaceURI(constructionContext.getXSLTNamespaceURI()),
        m_whitespacePreservingElements(),
        m_whitespaceStrippingElements(),
        m_namedTemplates(),
  @@ -332,7 +333,7 @@
                        const XalanDOMString    prefix = substring(attrName, 0, 
indexOfNSSep);
                        const XalanDOMString    ns = 
getNamespaceForPrefixFromStack(prefix);
   
  -                     attrOK = indexOf(ns, 
constructionContext.getXSLNameSpaceURLPre()) < length(ns);
  +                     attrOK = indexOf(ns, 
constructionContext.getXSLTNamespaceURI()) < length(ns);
                }
                else
                        attrOK = true;
  
  
  
  1.10      +19 -1     xml-xalan/c/src/XSLT/Stylesheet.hpp
  
  Index: Stylesheet.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Stylesheet.hpp    2000/04/12 19:41:01     1.9
  +++ Stylesheet.hpp    2000/05/01 15:13:10     1.10
  @@ -1047,6 +1047,18 @@
        virtual XalanDOMString
        getURI() const;
   
  +     const XalanDOMString&
  +     getXSLTNamespaceURI() const
  +     {
  +             return m_XSLTNamespaceURI;
  +     }
  +
  +     void
  +     setXSLTNamespaceURI(const XalanDOMString&       theURI)
  +     {
  +             m_XSLTNamespaceURI = theURI;
  +     }
  +
   protected:
   
     /**
  @@ -1069,6 +1081,12 @@
   private:     
   
        /**
  +      * The full XSLT Namespace URI.  To be replaced by the one actually
  +      * found.
  +      */
  +     XalanDOMString                                          
m_XSLTNamespaceURI;
  +
  +     /**
         * A lookup table of all space preserving elements.
         */
        XPathVectorType                                         
m_whitespacePreservingElements;
  @@ -1175,7 +1193,7 @@
         * in the XSL DOM tree. Initialized in initMacroLookupTable, and used in
         * findNamedTemplate.
         */
  -  ElemTemplateElementMapType m_namedTemplates;
  +     ElemTemplateElementMapType      m_namedTemplates;
     
        /**
         * Table for defined constants, keyed on the names.
  
  
  
  1.5       +4 -11     xml-xalan/c/src/XSLT/StylesheetConstructionContext.hpp
  
  Index: StylesheetConstructionContext.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetConstructionContext.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StylesheetConstructionContext.hpp 2000/04/25 19:54:13     1.4
  +++ StylesheetConstructionContext.hpp 2000/05/01 15:13:10     1.5
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   #if !defined(STYLESHEETCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680)
   #define STYLESHEETCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680
  @@ -168,22 +170,13 @@
                        const XalanDOMString&   base) = 0;
   
        /**
  -      * Retrieve the prefix for XSL namespace URI's, for example,
  +      * Retrieve the URI for the current XSLT namespace, for example,
         * "http://www.w3.org/1999/XSL/Transform"; 
         * 
  -      * @return prefix string
  -      */
  -     virtual const XalanDOMString&
  -     getXSLNameSpaceURLPre() const = 0;
  -
  -     /**
  -      * Retrieve the URI for the current XSL namespace, for example,
  -      * "http://www.w3.org/1999/XSL/Transform/1.0"; 
  -      * 
         * @return URI string
         */
        virtual const XalanDOMString&
  -     getXSLNameSpaceURL() const = 0;
  +     getXSLTNamespaceURI() const = 0;
   
        /**
         * Create and initialize an xpath for a match pattern and return it. 
This
  
  
  
  1.4       +4 -10     
xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.cpp
  
  Index: StylesheetConstructionContextDefault.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StylesheetConstructionContextDefault.cpp  2000/04/25 19:54:14     1.3
  +++ StylesheetConstructionContextDefault.cpp  2000/05/01 15:13:10     1.4
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   
   #include "StylesheetConstructionContextDefault.hpp"
  @@ -222,17 +224,9 @@
   
   
   const XalanDOMString&
  -StylesheetConstructionContextDefault::getXSLNameSpaceURLPre() const
  +StylesheetConstructionContextDefault::getXSLTNamespaceURI() const
   {
  -     return m_processor.getXSLNameSpaceURLPre();
  -}
  -
  -
  -
  -const XalanDOMString&
  -StylesheetConstructionContextDefault::getXSLNameSpaceURL() const
  -{
  -     return m_processor.getXSLNameSpaceURL();
  +     return XSLTEngineImpl::getXSLNameSpaceURL();
   }
   
   
  
  
  
  1.5       +3 -4      
xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.hpp
  
  Index: StylesheetConstructionContextDefault.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XSLT/StylesheetConstructionContextDefault.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StylesheetConstructionContextDefault.hpp  2000/04/25 19:54:14     1.4
  +++ StylesheetConstructionContextDefault.hpp  2000/05/01 15:13:10     1.5
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   #if !defined(STYLESHEETCONSTRUCTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680)
   #define STYLESHEETCONSTRUCTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
  @@ -146,11 +148,8 @@
                        const XalanDOMString&   urlString,
                        const XalanDOMString&   base);
   
  -     virtual const XalanDOMString&
  -     getXSLNameSpaceURLPre() const;
  -
        virtual const XalanDOMString&
  -     getXSLNameSpaceURL() const;
  +     getXSLTNamespaceURI() const;
   
        virtual XPath*
        createMatchPattern(
  
  
  
  1.10      +9 -271    xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp
  
  Index: StylesheetExecutionContext.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- StylesheetExecutionContext.hpp    2000/04/27 15:14:15     1.9
  +++ StylesheetExecutionContext.hpp    2000/05/01 15:13:10     1.10
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   #if !defined(STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680)
   #define STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680
  @@ -914,212 +916,85 @@
   
        // These interfaces are inherited from XPathExecutionContext...
   
  -     /**
  -      * Retrieve the node currently being executed.
  -      * 
  -      * @return current node
  -      */
        virtual XalanNode*
        getCurrentNode() const = 0;
   
  -     /**
  -      * Change the node currently being executed.
  -      * 
  -      * @param theCurrentNode new current node
  -      */
        virtual void
        setCurrentNode(XalanNode*       theCurrentNode) = 0;
   
  -     /**
  -      * Retrieve the factory object for creating XObjects.
  -      * 
  -      * @return factory object instance
  -      */
        virtual XObjectFactory&
        getXObjectFactory() const = 0;
   
  -     /**
  -      * Retrieve namespace corresponding to a DOM node.
  -      * 
  -      * @param n DOM node queried
  -      * @return namespace string corresponding to 'n'
  -      */
        virtual XalanDOMString
        getNamespaceOfNode(const XalanNode&             n) const = 0;
   
  -     /**
  -      * Returns the local name of the given node.
  -      * 
  -      * @param n node queried
  -      * @return local name string corresponding to 'n'
  -      */
        virtual XalanDOMString
        getLocalNameOfNode(const XalanNode&             n) const = 0;
   
  -     /**
  -      * Returns the parent of the given node.
  -      * 
  -      * @param n DOM node queried
  -      * @return parent node for 'n'
  -      */
        virtual XalanNode*
        getParentOfNode(const XalanNode&        n) const = 0;
   
  -     /**
  -      * Get node data recursively.
  -      * (Note whitespace issues.)
  -      * 
  -      * @param n DOM node queried
  -      * @return string of data for node 'n'
  -      */
  +     virtual bool
  +     isNodeAfter(
  +                     const XalanNode&        node1,
  +                     const XalanNode&        node2) const = 0;
  +
        virtual XalanDOMString
        getNodeData(const XalanNode&    n) const = 0;
   
  -     /**
  -      * Given a valid element id, return the corresponding element.
  -      *
  -      * @param id  string representing ID
  -      * @param doc document to search
  -      * @return element for ID
  -      */
        virtual XalanElement*
        getElementByID(
                        const XalanDOMString&           id,
                        const XalanDocument&            doc) const = 0;
   
  -     /**
  -      * Retrieve node list for current context.
  -      * 
  -      * @return node list
  -      */
        virtual const NodeRefListBase&
        getContextNodeList() const = 0;
   
  -     /**
  -      * Set node list for current context.
  -      * 
  -      * @param theList new node list
  -      */
        virtual void    
        setContextNodeList(const NodeRefListBase&       theList) = 0;
   
  -     /*
  -      * Get the count of nodes in the current context node list.
  -      *
  -      * @return length of list
  -      */
        virtual int
        getContextNodeListLength() const = 0;
   
  -     /*
  -      * Get the position of the node in the current context node list.
  -      *
  -      * @return position in list
  -      */
        virtual int
        getContextNodeListPosition(const XalanNode&             contextNode) 
const = 0;
   
  -     /**
  -      * Determine if an external element is available.
  -      *
  -      * @param theNamespace  namespace for the element
  -      * @param extensionName name of extension element
  -      * @return whether the given element is available or not
  -      */
        virtual bool
        elementAvailable(
                        const XalanDOMString&   theNamespace, 
                        const XalanDOMString&   extensionName) const = 0;
   
  -     /**
  -      * Determine if an external function is available.
  -      *
  -      * @param theNamespace  namespace for the function
  -      * @param extensionName name of extension function
  -      * @return whether the given function is available or not
  -      */
        virtual bool
        functionAvailable(
                        const XalanDOMString&   theNamespace, 
                        const XalanDOMString&   extensionName) const = 0;
   
  -     /**
  -      * Handle an extension function.
  -      * 
  -      * @param theNamespace  namespace of function    
  -      * @param extensionName extension function name
  -      * @param argVec        vector of arguments to function
  -      * @return pointer to XObject result
  -      */
        virtual XObject*
        extFunction(
                        const XalanDOMString&                   theNamespace,
  -                     const XalanDOMString&                   extensionName, 
  +                     const XalanDOMString&                   extensionName,
  +                     XalanNode*                                              
context,
                        const XObjectArgVectorType&             argVec) = 0;
   
  -     /**
  -      * Get an XLocator provider keyed by node.  This gets the association
  -      * based on the root of the tree that is the node's parent.
  -      *
  -      * @param node node for locator
  -      * @return pointer to locator
  -      */
        virtual XLocator*
        getXLocatorFromNode(const XalanNode*    node) const = 0;
   
  -     /**
  -      * Associate an XLocator provider to a node.  This makes the association
  -      * based on the root of the tree that is the node's parent.
  -      *
  -      * @param node     node for association
  -      * @param xlocator locator to associate with node
  -      */
        virtual void
        associateXLocatorToNode(
                        const XalanNode*        node,
                        XLocator*                       xlocator) = 0;
   
  -     /**
  -      * Provides support for XML parsing service.
  -      *
  -      * @param urlString location of the XML
  -      * @param base base location for URI
  -      * @return parsed document
  -      */
        virtual XalanDocument*
        parseXML(
                        const XalanDOMString&   urlString,
                        const XalanDOMString&   base) const = 0;
   
  -     /**
  -      * Create a MutableNodeRefList with the appropriate context.
  -      *
  -      * @return node list created
  -      */
        virtual MutableNodeRefList
        createMutableNodeRefList() const = 0;
   
  -     /**
  -      * Tells if namespaces should be supported.  For optimization purposes.
  -      *
  -      * @return true if namespaces supported
  -      */
        virtual bool
        getProcessNamespaces() const = 0;
   
  -     /**
  -      * Given a valid element key, return the corresponding node list.
  -      *
  -      * @param doc              source document
  -      * @param name             name of the key, which must match the 'name'
  -      *                         attribute on xsl:key
  -      * @param ref              value that must match the value found by the
  -      *                         'match' attribute on xsl:key
  -      * @param nscontext        context node for namespace resolution
  -      * @return if the name was not declared with xsl:key, this will return
  -      *         null, if the identifier is not found, it will return an empty
  -      *         node set, otherwise it will return a nodeset of nodes.
  -      */
        virtual const NodeRefListBase*
        getNodeSetByKey(
                        const XalanNode&                doc,
  @@ -1127,37 +1002,12 @@
                        const XalanDOMString&   ref,
                        const XalanElement&             nscontext) = 0;
   
  -     /**
  -      * Given a valid element key, return the corresponding node list.
  -      *
  -      * @param doc              source document
  -      * @param name             name of the key, which must match the 'name'
  -      *                         attribute on xsl:key
  -      * @param ref              value that must match the value found by the
  -      *                         'match' attribute on xsl:key
  -      * @return if the name was not declared with xsl:key, this will return
  -      *         null, if the identifier is not found, it will return an empty
  -      *         node set, otherwise it will return a nodeset of nodes.
  -      */
        virtual const NodeRefListBase*
        getNodeSetByKey(
                        const XalanNode&                doc,
                        const XalanDOMString&   name,
                        const XalanDOMString&   ref) = 0;
   
  -     /**
  -      * Given a valid element key, return the corresponding node list.
  -      *
  -      * @param doc              source document
  -      * @param name             name of the key, which must match the 'name'
  -      *                         attribute on xsl:key
  -      * @param ref              value that must match the value found by the
  -      *                         'match' attribute on xsl:key
  -      * @param resolver         resolver for namespace resolution
  -      * @return if the name was not declared with xsl:key, this will return
  -      *         null, if the identifier is not found, it will return an empty
  -      *         node set, otherwise it will return a nodeset of nodes.
  -      */
        virtual const NodeRefListBase*
        getNodeSetByKey(
                        const XalanNode&                doc,
  @@ -1165,173 +1015,61 @@
                        const XalanDOMString&   ref,
                        const PrefixResolver&   resolver) = 0;
   
  -     /**
  -      * Given a name, locate a variable in the current context, and return 
  -      * a pointer to the object.
  -      *
  -      * @param theName name of variable
  -      * @return pointer to an XObject if the variable was found, 0 if it was 
not
  -      */
        virtual XObject*
        getVariable(const QName&        name) const = 0;
   
  -     /**
  -      * Retrieve the resolver for namespaces.
  -      * 
  -      * @return object for namespace resolution
  -      */
        virtual const PrefixResolver*
        getPrefixResolver() const = 0;
   
  -     /**
  -      * Change the resolver for namespaces.
  -      * 
  -      * @param thePrefixResolver new object for namespace resolution
  -      */
        virtual void
        setPrefixResolver(const PrefixResolver*         thePrefixResolver) = 0;
   
  -     /**
  -      * Retrieve the URI corresponding to a namespace prefix
  -      * 
  -      * @param prefix prefix for a namespace
  -      * @return URI corresponding to namespace
  -      */
        virtual XalanDOMString
        getNamespaceForPrefix(const XalanDOMString&             prefix) const = 
0;
   
  -     /**
  -      * Given a DOM Document, tell what URI was used to parse it. Needed for
  -      * relative resolution.
  -      *
  -      * @param owner source document
  -      * @return document URI
  -      */
        virtual XalanDOMString
        findURIFromDoc(const XalanDocument*             owner) const = 0;
   
  -     /**
  -      * The getUnparsedEntityURI function returns the URI of the unparsed
  -      * entity with the specified name in the same document as the context
  -      * node (see [3.3 Unparsed Entities]). It returns the empty string if
  -      * there is no such entity.
  -      *
  -      * @param theName     name of entity
  -      * @param theDocument document containing entity
  -      * @return URI for the entity
  -      */
        virtual XalanDOMString
        getUnparsedEntityURI(
                        const XalanDOMString&   theName,
                        const XalanDocument&    theDocument) 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 textNode text node from the source tree
  -      * @return true if the text node should be stripped of extra whitespace
  -      */
        virtual bool
        shouldStripSourceNode(const XalanNode&  node) const = 0;
   
  -     /**
  -      * Tells if FoundIndex should be thrown if index is found. This is an
  -      * optimization for match patterns, and is used internally by the XPath
  -      * engine.
  -      *
  -      * @return true to throw FoundIndex
  -      */
        virtual bool
        getThrowFoundIndex() const = 0;
   
  -     /**
  -      * Changes whether FoundIndex should be thrown if index is found. This 
is an
  -      * optimization for match patterns, and is used internally by the XPath
  -      * engine.
  -      *
  -      * @param fThrow true to throw FoundIndex
  -      */
        virtual void
        setThrowFoundIndex(bool         fThrow) = 0;
   
  -     /**
  -      * Sets the current match pattern.
  -      *
  -      * @param thePattern new match pattern
  -      */
        virtual void
        setCurrentPattern(const XalanDOMString&         thePattern) = 0;
   
  -     /**
  -      * Retrieve the current match pattern.
  -      *
  -      * @return current match pattern
  -      */
        virtual XalanDOMString
        getCurrentPattern() const = 0;
   
        virtual XalanDocument*
        getSourceDocument(const XalanDOMString&         theURI) const = 0;
   
  -     /**
  -      * Associate a document with a given URI.
  -      *
  -      * @param theURI      document URI
  -      * @param theDocument source document
  -      */
        virtual void
        setSourceDocument(
                        const XalanDOMString&   theURI,
                        XalanDocument*                  theDocument) = 0;
   
   
  -     /**
  -      * Retrieve the DecimalFormatSymbols instance associated with
  -      * the name.
  -      *
  -      * @param name the name for the lookup
  -      * @return a pointer to the matching instance, or 0 if none was found
  -      */
        virtual const DecimalFormatSymbols*
        getDecimalFormatSymbols(const XalanDOMString&   name) = 0;
   
  -     /**
  -      * Create a PrintWriter to represent the supplied TextOutputStream.
  -      * The StylesheetExecutionContext owns the PrintWriter, and will
  -      * delete it when reset(), or during destruction.
  -      *
  -      * @param theOutputStream the output stream.
  -      * @return the new PrintWriter instance.
  -      */
        virtual PrintWriter*
        createPrintWriter(TextOutputStream*             theTextOutputStream) = 
0;
   
  -     /**
  -      * Create a PrintWriter to represent the supplied std::ostream.
  -      * The StylesheetExecutionContext owns the PrintWriter, and will
  -      * delete it when reset(), or during destruction.
  -      *
  -      * @param theFileName the name of the output file.
  -      * @param theEncoding the encoding to use.
  -      * @return the new PrintWriter instance.
  -      */
        virtual PrintWriter*
        createPrintWriter(
                        const XalanDOMString&           theFileName,
                        const XalanDOMString&           theEncoding) = 0;
   
  -     /**
  -      * Create a PrintWriter to represent the supplied std::ostream.
  -      * The StylesheetExecutionContext owns the PrintWriter, and will
  -      * delete it when reset(), or during destruction.
  -      *
  -      * @param theStream a reference to an ostream.
  -      * @return the new PrintWriter instance.
  -      */
        virtual PrintWriter*
   #if defined(XALAN_NO_NAMESPACES)
        createPrintWriter(ostream&                      theStream) = 0;
  
  
  
  1.8       +15 -2     
xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp
  
  Index: StylesheetExecutionContextDefault.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- StylesheetExecutionContextDefault.cpp     2000/04/25 19:54:15     1.7
  +++ StylesheetExecutionContextDefault.cpp     2000/05/01 15:13:10     1.8
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   
   #include "StylesheetExecutionContextDefault.hpp"
  @@ -770,6 +772,16 @@
   
   
   
  +bool
  +StylesheetExecutionContextDefault::isNodeAfter(
  +                     const XalanNode&        node1,
  +                     const XalanNode&        node2) const
  +{
  +     return m_xpathExecutionContextDefault.isNodeAfter(node1, node2);
  +}
  +
  +
  +
   XalanDOMString
   StylesheetExecutionContextDefault::getNodeData(const XalanNode&              
n) const
   {
  @@ -843,10 +855,11 @@
   XObject*
   StylesheetExecutionContextDefault::extFunction(
                        const XalanDOMString&                   theNamespace,
  -                     const XalanDOMString&                   extensionName, 
  +                     const XalanDOMString&                   extensionName,
  +                     XalanNode*                                              
context,
                        const XObjectArgVectorType&             argVec)
   {
  -     return m_xpathExecutionContextDefault.extFunction(theNamespace, 
extensionName, argVec);
  +     return m_xpathExecutionContextDefault.extFunction(theNamespace, 
extensionName, context, argVec);
   }
   
   
  
  
  
  1.9       +9 -1      
xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp
  
  Index: StylesheetExecutionContextDefault.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StylesheetExecutionContextDefault.hpp     2000/04/25 19:54:16     1.8
  +++ StylesheetExecutionContextDefault.hpp     2000/05/01 15:13:10     1.9
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   #if !defined(STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680)
   #define STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
  @@ -354,6 +356,11 @@
        virtual XalanNode*
        getParentOfNode(const XalanNode&        n) const;
   
  +     virtual bool
  +     isNodeAfter(
  +                     const XalanNode&        node1,
  +                     const XalanNode&        node2) const;
  +
        virtual XalanDOMString
        getNodeData(const XalanNode&    n) const;
   
  @@ -387,7 +394,8 @@
        virtual XObject*
        extFunction(
                        const XalanDOMString&                   theNamespace,
  -                     const XalanDOMString&                   extensionName, 
  +                     const XalanDOMString&                   extensionName,
  +                     XalanNode*                                              
context,
                        const XObjectArgVectorType&             argVec);
   
        virtual XLocator*
  
  
  
  1.22      +7 -7      xml-xalan/c/src/XSLT/StylesheetHandler.cpp
  
  Index: StylesheetHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- StylesheetHandler.cpp     2000/04/27 15:14:15     1.21
  +++ StylesheetHandler.cpp     2000/05/01 15:13:10     1.22
  @@ -278,10 +278,10 @@
   
                const unsigned  origStackSize = m_elemStack.size();
   
  -             if(startsWith(ns,m_processor.getXSLNameSpaceURLPre()))
  +             if(equals(ns, m_constructionContext.getXSLTNamespaceURI()))
                {
  -                     if(!isEmpty(m_processor.getXSLNameSpaceURL()))
  -                             m_processor.setXSLNameSpaceURL(ns);
  +                     if(!isEmpty(m_stylesheet.getXSLTNamespaceURI()))
  +                             m_stylesheet.setXSLTNamespaceURI(ns);
   
                        if(false == m_foundStylesheet)
                        {
  @@ -1102,7 +1102,7 @@
                                throw SAXException("Imports can only occur as 
the first elements in the stylesheet!");
                        }
                        
  -                     const XalanDOMString    saved_XSLNameSpaceURL = 
m_processor.getXSLNameSpaceURL();
  +                     const XalanDOMString    saved_XSLNameSpaceURL = 
m_stylesheet.getXSLTNamespaceURI();
   
                        const XalanDOMString    href = atts.getValue(i);
   
  @@ -1138,7 +1138,7 @@
   
                        importStack.pop_back();
                        
  -                     m_processor.setXSLNameSpaceURL(saved_XSLNameSpaceURL);
  +                     m_stylesheet.setXSLTNamespaceURI(saved_XSLNameSpaceURL);
                }
                else if(!isAttrOK(aname, atts, i))
                {
  @@ -1518,7 +1518,7 @@
        m_lastPopped(theHandler.m_lastPopped),
        m_inTemplate(theHandler.m_inTemplate),
        m_foundStylesheet(theHandler.m_foundStylesheet),
  -     m_XSLNameSpaceURL(theHandler.m_processor.getXSLNameSpaceURL()),
  +     m_XSLNameSpaceURL(theHandler.m_stylesheet.getXSLTNamespaceURI()),
        m_foundNotImport(theHandler.m_foundNotImport)
   {
        m_handler.m_elemStack.clear();
  @@ -1548,6 +1548,6 @@
        m_handler.m_lastPopped = m_lastPopped;
        m_handler.m_inTemplate = m_inTemplate;
        m_handler.m_foundStylesheet = m_foundStylesheet;
  -     m_handler.m_processor.setXSLNameSpaceURL(m_XSLNameSpaceURL);
  +     m_handler.m_stylesheet.setXSLTNamespaceURI(m_XSLNameSpaceURL);
        m_handler.m_foundNotImport = m_foundNotImport;
   }
  
  
  
  1.31      +17 -15    xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp
  
  Index: XSLTEngineImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- XSLTEngineImpl.cpp        2000/04/27 15:14:15     1.30
  +++ XSLTEngineImpl.cpp        2000/05/01 15:13:10     1.31
  @@ -149,8 +149,7 @@
   
   
   const double                 XSLTEngineImpl::s_XSLTVerSupported(1.0);
  -const XalanDOMString 
XSLTEngineImpl::s_DefaultXSLNameSpaceURL(XALAN_STATIC_UCODE_STRING("http://www.w3.org/1999/XSL/Transform/1.0";));
  -const XalanDOMString 
XSLTEngineImpl::s_XSLNameSpaceURLPre(XALAN_STATIC_UCODE_STRING("http://www.w3.org/1999/XSL/Transform";));
  +const XalanDOMString 
XSLTEngineImpl::s_XSLNameSpaceURL(XALAN_STATIC_UCODE_STRING("http://www.w3.org/1999/XSL/Transform";));
   const XalanDOMString 
XSLTEngineImpl::s_XSLT4JNameSpaceURL(XALAN_STATIC_UCODE_STRING("http://xml.apache.org/xslt";));
   
   /**
  @@ -210,7 +209,6 @@
        m_problemListener(new ProblemListenerDefault()),
        m_stylesheetRoot(0),
        m_stylesheetExecutionContext(0),
  -     m_XSLNameSpaceURL(s_DefaultXSLNameSpaceURL),
        m_XSLDirectiveLookup(),
        m_quietConflictWarnings(false),
        m_traceTemplateChildren(false),
  @@ -259,7 +257,7 @@
   XSLTEngineImpl::reset()
   {
        m_rootDoc = 0;
  -     m_XSLNameSpaceURL = s_DefaultXSLNameSpaceURL;
  +
        m_durationsTable.clear();
        m_stylesheetLocatorStack.clear();
        clear(m_pendingElementName);
  @@ -918,8 +916,7 @@
        const XalanDOMString    ns =
                        m_xpathSupport.getNamespaceOfNode(node);
   
  -     // was: toLowerCase
  -     if(equals(ns, m_XSLNameSpaceURL))
  +     if(equals(ns, s_XSLNameSpaceURL))
        {
                const XalanDOMString    localName =
                        m_xpathSupport.getLocalNameOfNode(node);
  @@ -1068,13 +1065,18 @@
    */
   XObject*
   XSLTEngineImpl::extFunction(
  -             XPathExecutionContext&                  executionContext,
  -             const XalanDOMString&                   theNamespace,
  -             const XalanDOMString&                   extensionName, 
  -             const XObjectArgVectorType&             argVec) const
  -{
  -     return m_xpathEnvSupport.extFunction( executionContext,
  -             theNamespace, extensionName, argVec);
  +                     XPathExecutionContext&                  
executionContext,
  +                     const XalanDOMString&                   theNamespace,
  +                     const XalanDOMString&                   extensionName,
  +                     XalanNode*                                              
context,
  +                     const XObjectArgVectorType&             argVec) const
  +{
  +     return m_xpathEnvSupport.extFunction(
  +                     executionContext,
  +                     theNamespace,
  +                     extensionName,
  +                     context,
  +                     argVec);
   }
   
   
  @@ -2384,7 +2386,7 @@
                                        /*
                                        @@ JMD: Not used anymore in java ...
                                        const bool                      isXSLNS 
=
  -                                             srcIsStylesheetTree && 
equalsIgnoreCase(srcURI, m_XSLNameSpaceURL)
  +                                             srcIsStylesheetTree && 
equalsIgnoreCase(srcURI, s_XSLNameSpaceURL)
                                                || 0 != 
m_stylesheetRoot->lookupExtensionNSHandler(srcURI)
                                                || srcIsStylesheetTree && 
equalsIgnoreCase(srcURI, s_XSLT4JNameSpaceURL);
   
  @@ -2823,7 +2825,7 @@
                        static_cast<const XalanAttr*>(attributes->item(i));
                assert(attr != 0);
   
  -             const XalanDOMString    theTemp(m_XSLNameSpaceURL + ":use");
  +             const XalanDOMString    theTemp(s_XSLNameSpaceURL + ":use");
   
                
if(equalsIgnoreCase(m_parserLiaison.getExpandedAttributeName(*attr), theTemp))
                {
  
  
  
  1.28      +8 -47     xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp
  
  Index: XSLTEngineImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- XSLTEngineImpl.hpp        2000/04/27 15:14:16     1.27
  +++ XSLTEngineImpl.hpp        2000/05/01 15:13:11     1.28
  @@ -621,7 +621,8 @@
        extFunction(
                        XPathExecutionContext&                  
executionContext,
                        const XalanDOMString&                   theNamespace,
  -                     const XalanDOMString&                   extensionName, 
  +                     const XalanDOMString&                   extensionName,
  +                     XalanNode*                                              
context,
                        const XObjectArgVectorType&             argVec) const;
   
        // This is public for class Stylesheet...
  @@ -670,27 +671,15 @@
        }
   
        /**
  -      * Retrieve the prefix for XSL namespace URI's, for example,
  -      * "http://www.w3.org/1999/XSL/Transform"; 
  -      * 
  -      * @return prefix string
  -      */
  -     static const XalanDOMString&
  -     getXSLNameSpaceURLPre()
  -     {
  -             return s_XSLNameSpaceURLPre;
  -     }
  -
  -     /**
         * Retrieve the URI for the current XSL namespace, for example,
  -      * "http://www.w3.org/1999/XSL/Transform/1.0"; 
  +      * "http://www.w3.org/1999/XSL/Transform";
         * 
         * @return URI string
         */
  -     const XalanDOMString&
  -     getXSLNameSpaceURL() const
  +     static const XalanDOMString&
  +     getXSLNameSpaceURL()
        {
  -             return m_XSLNameSpaceURL;
  +             return s_XSLNameSpaceURL;
        }
   
        /**
  @@ -705,17 +694,6 @@
        }
   
        /**
  -      * Set the full XSLT Namespace URI.
  -      *
  -      * @param theXSLNameSpaceURL XSLT namespace URI
  -      */
  -     void
  -     setXSLNameSpaceURL(const XalanDOMString&                
theXSLNameSpaceURL)
  -     {
  -             m_XSLNameSpaceURL = theXSLNameSpaceURL;
  -     }
  -
  -     /**
         * Retieve the latest XSLT version currently supported.
         *
         * @return XSLT version number
  @@ -2031,11 +2009,9 @@
        StylesheetExecutionContext*     m_stylesheetExecutionContext;
   
   /**
  - * The full XSLT Namespace URL.  To be replaced by the one actually 
  - * found.
  + * The namespace that we must match as a minimum for XSLT.
    */
  -     XalanDOMString                                  m_XSLNameSpaceURL;      
//"http://www.w3.org/1999/XSL/Transform/1.0";
  -
  +     static const XalanDOMString             s_XSLNameSpaceURL;      
//"http://www.w3.org/1999/XSL/Transform";
   
   
   /**
  @@ -2044,15 +2020,6 @@
        static const double s_XSLTVerSupported; // 1.0
   
   /**
  - * Out version of XSLT
  - */
  -     static const XalanDOMString s_DefaultXSLNameSpaceURL;
  -/**
  - * The namespace that we must match as a minimum for XSLT.
  - */
  -     static const    XalanDOMString  s_XSLNameSpaceURLPre;   // 
"http://www.w3.org/1999/XSL/Transform";
  -
  -/**
    * Special Xalan namespace for built-in extensions.
    */
        static const XalanDOMString s_XSLT4JNameSpaceURL; // 
"http://xml.apache.org/xslt";
  @@ -2062,12 +2029,6 @@
    * Hash table that can look up XSLT4J extensions element IDs via name.
    */
        static ElementKeysMapType               s_XSLT4JElementKeys;
  -
  -     /**
  -      * Init the XSLT hashtable.
  -      */
  -//   static void
  -//   initXSLTKeys();
   
        /**
         * Hash table of XSLT IDs for attribute names.
  
  
  
  1.3       +4 -1      xml-xalan/c/src/XSLT/XSLTProcessorEnvSupport.hpp
  
  Index: XSLTProcessorEnvSupport.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupport.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XSLTProcessorEnvSupport.hpp       2000/04/14 21:09:20     1.2
  +++ XSLTProcessorEnvSupport.hpp       2000/05/01 15:13:11     1.3
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   #if !defined(XSLTPROCESSORENVSUPPORT_HEADER_GUARD_1357924680)
   #define XSLTPROCESSORENVSUPPORT_HEADER_GUARD_1357924680
  @@ -142,7 +144,8 @@
        extFunction(
                        XPathExecutionContext&                  
executionContext,
                        const XalanDOMString&                   theNamespace,
  -                     const XalanDOMString&                   extensionName, 
  +                     const XalanDOMString&                   extensionName,
  +                     XalanNode*                                              
context,
                        const XObjectArgVectorType&             argVec) const = 
0;
   
        virtual XLocator*
  
  
  
  1.8       +46 -0     xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp
  
  Index: XSLTProcessorEnvSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSLTProcessorEnvSupportDefault.cpp        2000/04/14 21:09:20     1.7
  +++ XSLTProcessorEnvSupportDefault.cpp        2000/05/01 15:13:11     1.8
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   #include "XSLTProcessorEnvSupportDefault.hpp"
   
  @@ -106,6 +108,48 @@
   
   
   void
  +XSLTProcessorEnvSupportDefault::installExternalFunctionGlobal(
  +                     const XalanDOMString&   theNamespace,
  +                     const XalanDOMString&   extensionName,
  +                     const Function&                 function)
  +{
  +     XPathEnvSupportDefault::installExternalFunctionGlobal(theNamespace, 
extensionName, function);
  +}
  +
  +
  +
  +void
  +XSLTProcessorEnvSupportDefault::uninstallExternalFunctionGlobal(
  +                     const XalanDOMString&   theNamespace,
  +                     const XalanDOMString&   extensionName)
  +{
  +     XPathEnvSupportDefault::uninstallExternalFunctionGlobal(theNamespace, 
extensionName);
  +}
  +
  +
  +
  +void
  +XSLTProcessorEnvSupportDefault::installExternalFunctionLocal(
  +                     const XalanDOMString&   theNamespace,
  +                     const XalanDOMString&   extensionName,
  +                     const Function&                 function)
  +{
  +     m_defaultSupport.installExternalFunctionLocal(theNamespace, 
extensionName, function);
  +}
  +
  +
  +
  +void
  +XSLTProcessorEnvSupportDefault::uninstallExternalFunctionLocal(
  +                     const XalanDOMString&   theNamespace,
  +                     const XalanDOMString&   extensionName)
  +{
  +     m_defaultSupport.uninstallExternalFunctionLocal(theNamespace, 
extensionName);
  +}
  +
  +
  +
  +void
   XSLTProcessorEnvSupportDefault::reset()
   {
   #if !defined(XALAN_NO_NAMESPACES)
  @@ -320,11 +364,13 @@
                        XPathExecutionContext&                  
executionContext,
                        const XalanDOMString&                   theNamespace,
                        const XalanDOMString&                   extensionName,
  +                     XalanNode*                                              
context,
                        const XObjectArgVectorType&             argVec) const
   {
        return m_defaultSupport.extFunction(executionContext,
                                                                                
theNamespace,
                                                                                
extensionName,
  +                                                                             
context,
                                                                                
argVec);
   }
   
  
  
  
  1.8       +55 -1     xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.hpp
  
  Index: XSLTProcessorEnvSupportDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSLTProcessorEnvSupportDefault.hpp        2000/04/14 21:09:20     1.7
  +++ XSLTProcessorEnvSupportDefault.hpp        2000/05/01 15:13:11     1.8
  @@ -53,6 +53,8 @@
    * Business Machines, Inc., http://www.ibm.com.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  + *
  + * @author <a href="mailto:[email protected]";>David N. Bertoni</a>
    */
   #if !defined(XSLTPROCESSORENVSUPPORTDEFAULT_HEADER_GUARD_1357924680)
   #define XSLTPROCESSORENVSUPPORTDEFAULT_HEADER_GUARD_1357924680
  @@ -104,6 +106,57 @@
        }
   
   
  +     /**
  +      * Install an external function in the global space.
  +      *
  +      * @param theNamespace The namespace for the functionl
  +      * @param extensionName The name of the function.
  +      * @param function The function to install.
  +      */
  +     static void
  +     installExternalFunctionGlobal(
  +                     const XalanDOMString&   theNamespace,
  +                     const XalanDOMString&   extensionName,
  +                     const Function&                 function);
  +
  +     /**
  +      * Uninstall an external function from the global space.
  +      *
  +      * @param theNamespace The namespace for the functionl
  +      * @param extensionName The name of the function.
  +      */
  +     static void
  +     uninstallExternalFunctionGlobal(
  +                     const XalanDOMString&   theNamespace,
  +                     const XalanDOMString&   extensionName);
  +
  +     // Interfaces to install and uninstall external functions in this 
instance.
  +
  +     /**
  +      * Install an external function in the local space.
  +      *
  +      * @param theNamespace The namespace for the functionl
  +      * @param extensionName The name of the function.
  +      * @param function The function to install.
  +      */
  +     virtual void
  +     installExternalFunctionLocal(
  +                     const XalanDOMString&   theNamespace,
  +                     const XalanDOMString&   extensionName,
  +                     const Function&                 function);
  +
  +     /**
  +      * Uninstall an external function from the local space.
  +      *
  +      * @param theNamespace The namespace for the functionl
  +      * @param extensionName The name of the function.
  +      */
  +     virtual void
  +     uninstallExternalFunctionLocal(
  +                     const XalanDOMString&   theNamespace,
  +                     const XalanDOMString&   extensionName);
  +
  +
        // These interfaces are inherited from XSLTProcessorEnvSupport...
   
        virtual KeyTable*
  @@ -162,7 +215,8 @@
        extFunction(
                        XPathExecutionContext&                  
executionContext,
                        const XalanDOMString&                   theNamespace,
  -                     const XalanDOMString&                   extensionName, 
  +                     const XalanDOMString&                   extensionName,
  +                     XalanNode*                                              
context,
                        const XObjectArgVectorType&             argVec) const;
   
        virtual XLocator*
  
  
  

Reply via email to