dbertoni    00/10/03 08:27:07

  Modified:    c/src/XPath XPath.cpp XPath.hpp XPathExpression.hpp
                        XPathProcessorImpl.cpp XPathProcessorImpl.hpp
  Log:
  Fixed bug where variable name was an NCName rather than a QName.
  
  Revision  Changes    Path
  1.30      +5 -3      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.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- XPath.cpp 2000/09/19 14:56:33     1.29
  +++ XPath.cpp 2000/10/03 15:27:00     1.30
  @@ -1153,11 +1153,13 @@
   {
        assert(executionContext.getPrefixResolver() != 0);
   
  -     const XObject&  varName = 
m_expression.m_tokenQueue[m_expression.m_opMap[opPos + 2]];
  +     const XObject&  ns = 
m_expression.m_tokenQueue[m_expression.m_opMap[opPos + 2]];
   
  +     const XObject&  varName = 
m_expression.m_tokenQueue[m_expression.m_opMap[opPos + 3]];
  +
        // $$$ ToDo: I don't this will be parsed right in the first place...
  -     const QName             qname(varName.str(),
  -                                               
*executionContext.getPrefixResolver());
  +     const QName             qname(ns.str(),
  +                                               varName.str());
   
        const XObject*  result = 0;
   
  
  
  
  1.17      +1 -1      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XPath.hpp 2000/08/31 19:43:03     1.16
  +++ XPath.hpp 2000/10/03 15:27:01     1.17
  @@ -713,7 +713,7 @@
                        XPathExecutionContext&  executionContext) const;
     
        /**
  -      * Get a literal value.
  +      * Get the value of a variable.
         * @param context The current source tree context node.
         * @param opPos The current position in the m_opMap array.
         * @return an XObject object.
  
  
  
  1.10      +25 -3     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XPathExpression.hpp       2000/09/19 14:56:39     1.9
  +++ XPathExpression.hpp       2000/10/03 15:27:02     1.10
  @@ -586,10 +586,8 @@
                eMATCH_ANY_ANCESTOR = 95,
                eMATCH_IMMEDIATE_ANCESTOR = 96,
                eMATCH_ANY_ANCESTOR_WITH_PREDICATE = 97,
  -             // Always add _before_ this one.
   
  -             // $$$ ToDo: Determine if these specific numbers mean
  -             // anything vis-a-vis the parser and xpath code.
  +             // Always add _before_ this one.
                eOpCodeNextAvailable
        };      // enum eOpCodes
   
  @@ -1214,6 +1212,30 @@
        pushToken(double        theToken)
        {
                m_tokenQueue.push_back(XToken(theToken));
  +     }
  +
  +     /**
  +      * Insert a token onto the token queue at the
  +      * current position.
  +      *
  +      * @param theToken the string value to push
  +      */
  +     void
  +     insertToken(const XalanDOMString&       theToken)
  +     {
  +             m_tokenQueue.insert(m_tokenQueue.begin() + (m_currentPosition - 
1), XToken(theToken));
  +     }
  +
  +     /**
  +      * Insert a token onto the token queue at the
  +      * current position.
  +      *
  +      * @param theToken the string value to push
  +      */
  +     void
  +     insertToken(double      theToken)
  +     {
  +             m_tokenQueue.insert(m_tokenQueue.begin() + (m_currentPosition - 
1), XToken(theToken));
        }
   
        /**
  
  
  
  1.23      +21 -9     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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- XPathProcessorImpl.cpp    2000/09/19 14:56:41     1.22
  +++ XPathProcessorImpl.cpp    2000/10/03 15:27:02     1.23
  @@ -635,8 +635,8 @@
   
   bool
   XPathProcessorImpl::lookahead(
  -                     char    c,
  -                     int     n) const
  +                     XalanDOMChar    c,
  +                     int                     n) const
   {
        const XalanDOMString    tok =
                getTokenRelative(n - 1);
  @@ -1493,10 +1493,10 @@
   
                m_expression->appendOpCode(XPathExpression::eOP_VARIABLE);
   
  -             NCName();
  +             QName();
   
                m_expression->updateOpCodeLength(XPathExpression::eOP_VARIABLE,
  -                                                                             
 opPos);
  +                                                                             
         opPos);
        }
        else if(m_tokenChar == XalanUnicode::charLeftParenthesis)
        {
  @@ -1906,7 +1906,7 @@
                        nextToken();
   
                        m_expression->appendOpCode((*i).second);
  -             
  +
                        consumeExpected(XalanUnicode::charLeftParenthesis);
   
                        if(XPathExpression::eNODETYPE_PI == (*i).second)
  @@ -2008,7 +2008,7 @@
        m_expression->updateOpCodeLength(XPathExpression::eOP_PREDICATE,
                                                                         opPos);
   }
  -  
  +
   
   
   void
  @@ -2017,11 +2017,23 @@
        assert(m_xpath != 0);
        assert(m_expression != 0);
   
  -     m_expression->pushCurrentTokenOnOpCodeMap();
  +     // If there is no prefix, we have to fake things out...
  +     if (lookahead(':', 1) == false)
  +     {
  +             m_expression->insertToken(XalanDOMString());
   
  -     nextToken();
  +             m_expression->pushCurrentTokenOnOpCodeMap();
   
  -     consumeExpected(XalanUnicode::charColon);
  +             nextToken();
  +     }
  +     else
  +     {
  +             m_expression->pushCurrentTokenOnOpCodeMap();
  +
  +             nextToken();
  +
  +             consumeExpected(XalanUnicode::charColon);
  +     }
   
        m_expression->pushCurrentTokenOnOpCodeMap();
   
  
  
  
  1.12      +2 -2      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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XPathProcessorImpl.hpp    2000/09/19 14:56:42     1.11
  +++ XPathProcessorImpl.hpp    2000/10/03 15:27:02     1.12
  @@ -281,8 +281,8 @@
         */
        bool
        lookahead(
  -                     char    c,
  -                     int             n) const;
  +                     XalanDOMChar    c,
  +                     int                             n) const;
   
        /**
         * Lookahead of the current token in order to 
  
  
  

Reply via email to