sboag       99/12/12 23:48:51

  Modified:    src/org/apache/xalan/xpath FuncQname.java
  Log:
  Only return a name for attributes, elements, and PIs, otherwise return empty 
string.
  
  Revision  Changes    Path
  1.4       +12 -3     xml-xalan/src/org/apache/xalan/xpath/FuncQname.java
  
  Index: FuncQname.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xpath/FuncQname.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FuncQname.java    1999/11/28 10:26:15     1.3
  +++ FuncQname.java    1999/12/13 07:48:50     1.4
  @@ -88,9 +88,18 @@
       XObject val;
       if(null != context)
       {
  -      String qname = (Node.ATTRIBUTE_NODE == context.getNodeType()) ?
  -                     ((Attr)context).getName() : context.getNodeName();
  -      val = new XString(qname);
  +      int ntype = context.getNodeType();
  +      if((ntype == Node.ATTRIBUTE_NODE) || (ntype == Node.ELEMENT_NODE) 
  +         || (ntype == Node.PROCESSING_INSTRUCTION_NODE))
  +      {
  +        String qname = (Node.ATTRIBUTE_NODE == ntype) ?
  +                       ((Attr)context).getName() : context.getNodeName();
  +        val = new XString(qname);
  +      }
  +      else
  +      {
  +        val = new XString("");
  +      }
       }
       else
       {
  
  
  

Reply via email to