commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmi...@apache.org
Subject cvs commit: jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/compiler CoreFunction.java
Date Thu, 05 Feb 2004 00:22:30 GMT
dmitri      2004/02/04 16:22:30

  Modified:    jxpath/src/java/org/apache/commons/jxpath/ri/compiler
                        CoreFunction.java
  Log:
  Fixed name(), local-name() and namespace-uri() without arguments
  
  Revision  Changes    Path
  1.14      +11 -7     jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
  
  Index: CoreFunction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CoreFunction.java	9 Oct 2003 21:31:39 -0000	1.13
  +++ CoreFunction.java	5 Feb 2004 00:22:30 -0000	1.14
  @@ -398,7 +398,9 @@
   
       protected Object functionNamespaceURI(EvalContext context) {
           if (getArgumentCount() == 0) {
  -            return context.getCurrentNodePointer();
  +            NodePointer ptr = context.getCurrentNodePointer();
  +            String str = ptr.getNamespaceURI();
  +            return str == null ? "" : str;
           }
           assertArgCount(1);
           Object set = getArg1().compute(context);
  @@ -415,7 +417,8 @@
   
       protected Object functionLocalName(EvalContext context) {
           if (getArgumentCount() == 0) {
  -            return context.getCurrentNodePointer();
  +            NodePointer ptr = context.getCurrentNodePointer();
  +            return ptr.getName().getName();
           }
           assertArgCount(1);
           Object set = getArg1().compute(context);
  @@ -431,7 +434,8 @@
   
       protected Object functionName(EvalContext context) {
           if (getArgumentCount() == 0) {
  -            return context.getCurrentNodePointer();
  +            NodePointer ptr = context.getCurrentNodePointer();
  +            return ptr.getExpandedName().toString();
           }
           assertArgCount(1);
           Object set = getArg1().compute(context);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message