dbertoni    01/12/19 09:56:57

  Modified:    c/src/XPath XPathProcessorImpl.cpp
  Log:
  Make sure missing local-name doesn't cause an error.
  
  Revision  Changes    Path
  1.48      +20 -8     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.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- XPathProcessorImpl.cpp    2001/12/19 06:11:45     1.47
  +++ XPathProcessorImpl.cpp    2001/12/19 17:56:57     1.48
  @@ -633,15 +633,25 @@
   
                addToTokenQueue(DOMServices::s_XMLNamespaceSeparatorString);
   
  -             const XalanDOMString    s = substring(pat, posOfNSSep + 1, 
posOfScan);
  -       
  -             if(XalanQName::isValidNCName(s) == false)
  -             {
  -                     error(XalanDOMString("'") + s + XalanDOMString("' is 
not a valid NCName"));
  -             }
  -             else
  +             // If there's no local part, then don't bother.  We need to 
check
  +             // this because '*' tokenizes separately, which means "ns:*" 
tokenizes
  +             // differently from "ns:foo".  In the first case, '*' will be 
tokenized
  +             // _after_ this code, in the second 'ns:foo' will be split into 
tokens
  +             // here...
  +             if(posOfNSSep + 1 < posOfScan)
                {
  -                     addToTokenQueue(s);
  +                     const XalanDOMString    s = substring(pat, posOfNSSep + 
1, posOfScan);
  +
  +                     assert(length(s) > 0);
  +
  +                     if (XalanQName::isValidNCName(s) == false)
  +                     {
  +                             error(XalanDOMString("'") + s + 
XalanDOMString("' is not a valid NCName"));
  +                     }
  +                     else
  +                     {
  +                             addToTokenQueue(s);
  +                     }
                }
        }
   
  @@ -2615,6 +2625,7 @@
   static XalanDOMString        s_childString;
   
   
  +
   const XalanDOMString XPathProcessorImpl::s_emptyString;
   
   
  @@ -2643,6 +2654,7 @@
   const XalanDOMString&        XPathProcessorImpl::s_attributeString = 
::s_attributeString;
   
   const XalanDOMString&        XPathProcessorImpl::s_childString = 
::s_childString;
  +
   
   
   static XPathProcessorImpl::KeywordsMapType           s_keywords;
  
  
  

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

Reply via email to