dbertoni    00/08/27 18:15:41

  Modified:    c/src/XPath FunctionLocalName.hpp
  Log:
  Filter out certain types of nodes.
  
  Revision  Changes    Path
  1.8       +13 -3     xml-xalan/c/src/XPath/FunctionLocalName.hpp
  
  Index: FunctionLocalName.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionLocalName.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionLocalName.hpp     2000/06/26 19:50:04     1.7
  +++ FunctionLocalName.hpp     2000/08/28 01:15:40     1.8
  @@ -121,8 +121,6 @@
                        {
                                executionContext.error("The local-name() 
function requires a non-null context node!");
                        }
  -
  -                     theData = executionContext.getLocalNameOfNode(*context);
                }
                else
                {
  @@ -131,8 +129,20 @@
                        const NodeRefListBase&  theNodeList = 
args[0]->nodeset();
   
                        if (theNodeList.getLength() > 0)
  +                     {
  +                             context = theNodeList.item(0);
  +                     }
  +             }
  +
  +             if (context != 0)
  +             {
  +                     const XalanNode::NodeType       theType = 
context->getNodeType();
  +
  +                     if(theType == XalanNode::ATTRIBUTE_NODE ||
  +                             theType == XalanNode::ELEMENT_NODE ||
  +                             theType == 
XalanNode::PROCESSING_INSTRUCTION_NODE)
                        {
  -                             theData = 
executionContext.getLocalNameOfNode(*theNodeList.item(0));
  +                             theData = 
executionContext.getLocalNameOfNode(*context);
                        }
                }
   
  
  
  

Reply via email to