commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r554383 - in /jakarta/commons/proper/jxpath/trunk/src: java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java test/org/apache/commons/jxpath/ri/compiler/CoreFunctionTest.java
Date Sun, 08 Jul 2007 16:28:38 GMT
Author: mbenson
Date: Sun Jul  8 09:28:37 2007
New Revision: 554383

URL: http://svn.apache.org/viewvc?view=rev&rev=554383
Log:
remove accidentally-implemented XSLT 2.0 key() extension

Modified:
    jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
    jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/compiler/CoreFunctionTest.java

Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java?view=diff&rev=554383&r1=554382&r2=554383
==============================================================================
--- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
(original)
+++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
Sun Jul  8 09:28:37 2007
@@ -347,7 +347,7 @@
     }
 
     protected Object functionKey(EvalContext context) {
-        assertArgRange(2, 3);
+        assertArgCount(2);
         String key = InfoSetUtil.stringValue(getArg1().computeValue(context));
         Object value = getArg2().compute(context);
         EvalContext ec = null;
@@ -360,16 +360,6 @@
             }
         }
         JXPathContext jxpathContext = context.getJXPathContext();
-        if (getArgumentCount() == 3) {
-            Object arg3 = getArg3().computeValue(context);
-            if (arg3 instanceof EvalContext) {
-                arg3 = ((EvalContext) arg3).getCurrentNodePointer();
-            }
-            if (!(arg3 instanceof NodePointer)) {
-                throw new JXPathException("invalid third key() argument: " + arg3);
-            }
-            jxpathContext = jxpathContext.getRelativeContext((NodePointer) arg3);
-        }
         NodeSet nodeSet = jxpathContext.getNodeSetByKey(key, value);
         if (ec != null && ec.hasNext()) {
             BasicNodeSet accum = new BasicNodeSet();

Modified: jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/compiler/CoreFunctionTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/compiler/CoreFunctionTest.java?view=diff&rev=554383&r1=554382&r2=554383
==============================================================================
--- jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/compiler/CoreFunctionTest.java
(original)
+++ jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/compiler/CoreFunctionTest.java
Sun Jul  8 09:28:37 2007
@@ -188,8 +188,6 @@
         assertXPathValueIterator(context, "key('a', /list[position() < 4])", list("53",
"64", "53", "64", "53", "64"));
         context.getVariables().declareVariable("ints", new int[] { 0, 0 });
         assertXPathValueIterator(context, "key('a', $ints)", list("53", "64", "53", "64"));
-        assertXPathValueIterator(context, "key('a', 'b', /list)", list("53", "64"));
-        assertXPathValueIterator(context, "key('a', $ints, /list)", list("53", "64", "53",
"64"));
     }
 
     public void testFormatNumberFunction() {



---------------------------------------------------------------------
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