dbertoni    00/05/31 09:23:42

  Modified:    c/src/XPath XPathProcessorImpl.cpp
  Log:
  Fixed problem in match pattern with relative location path following id() or 
key(). (idky03)
  
  Revision  Changes    Path
  1.12      +22 -4     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XPathProcessorImpl.cpp    2000/05/24 19:36:05     1.11
  +++ XPathProcessorImpl.cpp    2000/05/31 16:23:42     1.12
  @@ -2146,7 +2146,7 @@
   
   void
   XPathProcessorImpl::LocationPathPattern()
  -{     
  +{
        assert(m_xpath != 0);
        assert(m_expression != 0);
   
  @@ -2161,9 +2161,27 @@
                                  tokenIs(FUNC_KEY_STRING) == true)
        {
                IdKeyPattern();
  -     }
  +
  +             if(tokenIs('/') == true && lookahead('/', 1) == true)
  +             {
  +                     const int       newOpPos = 
m_expression->opCodeMapLength();
  +
  +                     XPathExpression::OpCodeMapValueVectorType       
theArgs(1);
  +
  +                     // Tell how long the step is without the predicate
  +                     theArgs[0] = 4;
   
  -     if(tokenIs('/') == true)
  +                     
m_expression->appendOpCode(XPathExpression::eMATCH_ANY_ANCESTOR,
  +                                                                        
theArgs);
  +
  +                     
m_expression->appendOpCode(XPathExpression::eNODETYPE_ROOT);
  +
  +                     m_expression->updateOpCodeLength(newOpPos);
  +
  +                     nextToken();
  +             }
  +     }
  +     else if(tokenIs('/') == true)
        {
                const int       newOpPos = m_expression->opCodeMapLength();
   
  @@ -2174,7 +2192,7 @@
   
                if(lookahead('/', 1) == true)
                {
  -                     
m_expression->appendOpCode(XPathExpression::eMATCH_ANY_ANCESTOR_WITH_PREDICATE,
  +                     
m_expression->appendOpCode(XPathExpression::eMATCH_ANY_ANCESTOR,
                                                                           
theArgs);
                }
                else
  
  
  

Reply via email to