sboag 00/06/22 20:43:15
Modified: src/org/apache/xalan/xpath FuncLocalPart.java
Log:
Fixed problem with names being returned for text() and comment() nodes.
Revision Changes Path
1.7 +20 -1 xml-xalan/src/org/apache/xalan/xpath/FuncLocalPart.java
Index: FuncLocalPart.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xpath/FuncLocalPart.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FuncLocalPart.java 2000/03/06 20:13:27 1.6
+++ FuncLocalPart.java 2000/06/23 03:43:15 1.7
@@ -86,7 +86,26 @@
NodeList nl = ((XObject)args.elementAt(0)).nodeset();
context = (nl.getLength() > 0) ? nl.item(0) : null;
}
- return new XString((context != null)
+ XObject val;
+ if(null != context)
+ {
+ int ntype = context.getNodeType();
+ if((ntype == Node.ATTRIBUTE_NODE) || (ntype == Node.ELEMENT_NODE)
+ || (ntype == Node.PROCESSING_INSTRUCTION_NODE))
+ {
+ val = new XString((context != null)
? execContext.getLocalNameOfNode(context) : "");
+ }
+ else
+ {
+ val = new XString("");
+ }
+ }
+ else
+ {
+ val = new XString("");
+ }
+
+ return val;
}
}