dbertoni    2003/01/22 18:23:11

  Modified:    c/src/XPath XPath.cpp
  Log:
  Fix for bug 16276.
  
  Revision  Changes    Path
  1.89      +34 -1     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.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- XPath.cpp 14 Jan 2003 01:17:14 -0000      1.88
  +++ XPath.cpp 23 Jan 2003 02:23:10 -0000      1.89
  @@ -4306,6 +4306,9 @@
                                                argLen,
                                                stepType);
   
  +             NodeRefListBase::size_type      nNSFound = 0;
  +             bool                                            defaultNSFound 
= false;
  +
                do
                {
                        const XalanNamedNodeMap* const  attributeList =
  @@ -4335,7 +4338,37 @@
   
                                                if(score != eMatchScoreNone)
                                                {
  -                                                     
subQueryResults.addNode(attr);
  +                                                     const XalanDOMString&   
theNodeValue = attr->getNodeValue();
  +
  +                                                     bool                    
foundNSMatch = false;
  + 
  +                                                     // Need to check 
default NS slightly differently
  +                                                     if (theNodeName == 
DOMServices::s_XMLNamespace)
  +                                                     {
  +                                                             // If namespace 
is empty, don't add anything
  +                                                             // as under 
XPath an empty default is indicated
  +                                                             // by no node.
  + 
  +                                                             foundNSMatch = 
defaultNSFound ||
  +                                                                     
(theNodeValue == DOMServices::s_emptyString);
  +                                                             defaultNSFound 
= true;
  +                                                     }
  + 
  +                                                     for 
(NodeRefListBase::size_type lstIndex = 0; 
  +                                                              foundNSMatch 
== false && lstIndex < nNSFound;
  +                                                              ++lstIndex)
  +                                                     {
  +                                                             if 
(subQueryResults.item(lstIndex)->getNodeName() == theNodeName)
  +                                                             {
  +                                                                     
foundNSMatch = true;
  +                                                             }
  +                                                     }
  +
  +                                                     if (foundNSMatch == 
false) 
  +                                                     {
  +                                                             
subQueryResults.addNode(attr);
  +                                                             ++nNSFound;
  +                                                     }
                                                }
                                        }
                                }
  
  
  

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

Reply via email to