You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mu...@apache.org on 2023/07/27 12:27:06 UTC

[xalan-java] branch xalan-j_xslt3.0 updated: improving the xpath 3.1 parser implementation for the for, let and quantified expressions, and improvements to few other related areas of xalanj xslt 3.0 codebase as well. adding few new related working test cases as well.

This is an automated email from the ASF dual-hosted git repository.

mukulg pushed a commit to branch xalan-j_xslt3.0
in repository https://gitbox.apache.org/repos/asf/xalan-java.git


The following commit(s) were added to refs/heads/xalan-j_xslt3.0 by this push:
     new d0640523 improving the xpath 3.1 parser implementation for the for, let and quantified expressions, and improvements to few other related areas of xalanj xslt 3.0 codebase as well. adding few new related working test cases as well.
     new f343ada8 Merge pull request #37 from mukulga/xalan-j_xslt3.0_mukul
d0640523 is described below

commit d0640523b294ffccc0d3f914092d46b7a9844a0e
Author: Mukul Gandhi <ga...@gmail.com>
AuthorDate: Thu Jul 27 17:51:46 2023 +0530

    improving the xpath 3.1 parser implementation for the for, let and quantified expressions, and improvements to few other related areas of xalanj xslt 3.0 codebase as well. adding few new related working test cases as well.
---
 .../xalan/templates/XSConstructorFunctionUtil.java |  35 ++-----
 .../xslt/util/XslTransformEvaluationHelper.java    |  18 ++++
 src/org/apache/xpath/compiler/XPathParser.java     | 101 ++++++++++++++-------
 .../apache/xpath/functions/FuncExtFunction.java    |   2 +-
 src/org/apache/xpath/operations/StrConcat.java     |  11 ++-
 tests/for_expr/gold/test11.out                     |   1 +
 tests/for_expr/gold/test12.out                     |   5 +
 tests/for_expr/gold/test13.out                     |   1 +
 tests/for_expr/gold/test14.out                     |   5 +
 tests/for_expr/test11.xsl                          |  38 ++++++++
 tests/for_expr/test12.xsl                          |  46 ++++++++++
 tests/for_expr/test13.xsl                          |  36 ++++++++
 tests/for_expr/test14.xsl                          |  43 +++++++++
 tests/for_expr/test1_c.xml                         |  16 ++++
 tests/let_expr/gold/test10.out                     |   5 +
 tests/let_expr/gold/test9.out                      |   1 +
 tests/let_expr/test10.xsl                          |  46 ++++++++++
 tests/let_expr/test1_c.xml                         |  16 ++++
 tests/let_expr/test9.xsl                           |  37 ++++++++
 tests/org/apache/xalan/xpath3/ForExprTests.java    |  40 ++++++++
 tests/org/apache/xalan/xpath3/LetExprTests.java    |  20 ++++
 .../apache/xalan/xpath3/QuantifiedExprTests.java   |  40 ++++++++
 tests/quantified_expr/gold/test12.out              |   6 ++
 tests/quantified_expr/gold/test13.out              |   4 +
 tests/quantified_expr/gold/test14.out              |   4 +
 tests/quantified_expr/test11.xsl                   |  40 ++++++++
 tests/quantified_expr/test12.xsl                   |  42 +++++++++
 tests/quantified_expr/test13.xsl                   |  47 ++++++++++
 tests/quantified_expr/test14.xsl                   |  45 +++++++++
 tests/quantified_expr/test1_h.xml                  |  32 +++++++
 30 files changed, 718 insertions(+), 65 deletions(-)

diff --git a/src/org/apache/xalan/templates/XSConstructorFunctionUtil.java b/src/org/apache/xalan/templates/XSConstructorFunctionUtil.java
index 2dfdbb40..0b83cca4 100644
--- a/src/org/apache/xalan/templates/XSConstructorFunctionUtil.java
+++ b/src/org/apache/xalan/templates/XSConstructorFunctionUtil.java
@@ -19,6 +19,7 @@ package org.apache.xalan.templates;
 import javax.xml.XMLConstants;
 import javax.xml.transform.TransformerException;
 
+import org.apache.xalan.xslt.util.XslTransformEvaluationHelper;
 import org.apache.xpath.Expression;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.compiler.Keywords;
@@ -26,7 +27,6 @@ import org.apache.xpath.functions.FuncExtFunction;
 import org.apache.xpath.objects.ResultSequence;
 import org.apache.xpath.objects.XObject;
 import org.apache.xpath.operations.Operation;
-import org.apache.xpath.xs.types.XSAnyType;
 import org.apache.xpath.xs.types.XSBoolean;
 import org.apache.xpath.xs.types.XSDate;
 import org.apache.xpath.xs.types.XSDecimal;
@@ -69,7 +69,7 @@ public class XSConstructorFunctionUtil {
                     ResultSequence argSequence = new ResultSequence();
                     for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
                         XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
-                        argSequence.add(new XSDecimal(getSimpleStrVal(argVal)));
+                        argSequence.add(new XSDecimal(XslTransformEvaluationHelper.getStrVal(argVal)));
                     }
 
                     ResultSequence rSeq = (new XSDecimal()).constructor(argSequence);
@@ -79,7 +79,7 @@ public class XSConstructorFunctionUtil {
                     ResultSequence argSequence = new ResultSequence();
                     for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
                         XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
-                        argSequence.add(new XSFloat(getSimpleStrVal(argVal)));
+                        argSequence.add(new XSFloat(XslTransformEvaluationHelper.getStrVal(argVal)));
                     }
 
                     ResultSequence rSeq = (new XSFloat()).constructor(argSequence);
@@ -89,7 +89,7 @@ public class XSConstructorFunctionUtil {
                     ResultSequence argSequence = new ResultSequence();
                     for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
                         XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
-                        argSequence.add(new XSDouble(getSimpleStrVal(argVal)));
+                        argSequence.add(new XSDouble(XslTransformEvaluationHelper.getStrVal(argVal)));
                     }
 
                     ResultSequence rSeq = (new XSDouble()).constructor(argSequence);
@@ -99,7 +99,7 @@ public class XSConstructorFunctionUtil {
                     ResultSequence argSequence = new ResultSequence();
                     for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
                         XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
-                        argSequence.add(new XSInteger(getSimpleStrVal(argVal)));
+                        argSequence.add(new XSInteger(XslTransformEvaluationHelper.getStrVal(argVal)));
                     }
 
                     ResultSequence rSeq = (new XSInteger()).constructor(argSequence);
@@ -109,7 +109,7 @@ public class XSConstructorFunctionUtil {
                     ResultSequence argSequence = new ResultSequence();
                     for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
                         XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
-                        argSequence.add(new XSLong(getSimpleStrVal(argVal)));
+                        argSequence.add(new XSLong(XslTransformEvaluationHelper.getStrVal(argVal)));
                     }
 
                     ResultSequence rSeq = (new XSLong()).constructor(argSequence);
@@ -119,7 +119,7 @@ public class XSConstructorFunctionUtil {
                     ResultSequence argSequence = new ResultSequence();
                     for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
                         XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
-                        argSequence.add(new XSInt(getSimpleStrVal(argVal)));
+                        argSequence.add(new XSInt(XslTransformEvaluationHelper.getStrVal(argVal)));
                     }
 
                     ResultSequence rSeq = (new XSInt()).constructor(argSequence);
@@ -129,7 +129,7 @@ public class XSConstructorFunctionUtil {
                     ResultSequence argSequence = new ResultSequence();
                     for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
                         XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
-                        Boolean boolVal = Boolean.valueOf("0".equals(getSimpleStrVal(argVal)) ? 
+                        Boolean boolVal = Boolean.valueOf("0".equals(XslTransformEvaluationHelper.getStrVal(argVal)) ? 
                                                                                  "false" : "true");
                         argSequence.add(new XSBoolean(boolVal));
                     }
@@ -141,7 +141,7 @@ public class XSConstructorFunctionUtil {
                     ResultSequence argSequence = new ResultSequence();
                     for (int idx = 0; idx < funcExtFunction.getArgCount(); idx++) {
                         XObject argVal = (funcExtFunction.getArg(idx)).execute(xctxt);
-                        argSequence.add(XSDate.parseDate(getSimpleStrVal(argVal)));
+                        argSequence.add(XSDate.parseDate(XslTransformEvaluationHelper.getStrVal(argVal)));
                     }
 
                     ResultSequence rSeq = (new XSDate()).constructor(argSequence); 
@@ -165,22 +165,5 @@ public class XSConstructorFunctionUtil {
         return evalResult;
         
     }
-    
-    /*
-     * Given an XObject object reference, return the string value
-     * of this object. 
-     */
-    private static String getSimpleStrVal(XObject xObj) {
-       String strVal = null;
-       
-       if (xObj instanceof XSAnyType) {
-          strVal = ((XSAnyType)xObj).stringValue();    
-       }
-       else {
-          strVal = xObj.str();  
-       }
-       
-       return strVal;
-    }
 
 }
diff --git a/src/org/apache/xalan/xslt/util/XslTransformEvaluationHelper.java b/src/org/apache/xalan/xslt/util/XslTransformEvaluationHelper.java
index 7feef9b8..e1e6073f 100644
--- a/src/org/apache/xalan/xslt/util/XslTransformEvaluationHelper.java
+++ b/src/org/apache/xalan/xslt/util/XslTransformEvaluationHelper.java
@@ -18,6 +18,7 @@ package org.apache.xalan.xslt.util;
 
 import org.apache.xpath.objects.ResultSequence;
 import org.apache.xpath.objects.XObject;
+import org.apache.xpath.xs.types.XSAnyType;
 
 import java.util.List;
 
@@ -72,5 +73,22 @@ public class XslTransformEvaluationHelper {
        
        return replacedXPathExprStr; 
     }
+    
+    /**
+     * Given an XObject object reference, return the string value 
+     * of the object. 
+     */
+    public static String getStrVal(XObject xObj) {
+       String strVal = null;
+       
+       if (xObj instanceof XSAnyType) {
+          strVal = ((XSAnyType)xObj).stringValue();    
+       }
+       else {
+          strVal = xObj.str();  
+       }
+       
+       return strVal;
+    }
 
 }
diff --git a/src/org/apache/xpath/compiler/XPathParser.java b/src/org/apache/xpath/compiler/XPathParser.java
index ffb49f7c..57eff6bf 100644
--- a/src/org/apache/xpath/compiler/XPathParser.java
+++ b/src/org/apache/xpath/compiler/XPathParser.java
@@ -102,7 +102,7 @@ public class XPathParser
   
   private boolean fDynamicFunctionCallArgumentMarker = false;
   
-  private boolean fIsXpathPredicateParsingActive = false;
+  private boolean fIsXPathPredicateParsingActive = false;
   
   private boolean fIsBeginParse = false;
   
@@ -1100,26 +1100,37 @@ public class XPathParser
       
       while (!tokenIs("return") && m_token != null)
       {
-          String bindingVarName = null;
+          String bindingVarName = null;                    
           
-          if (forExprVarBindingList.size() > 0 && tokenIs(',')) {
-             nextToken();    
+          if ((forExprVarBindingList.size() > 0) && tokenIs(',') && 
+                                                          lookahead('$', 1)) {
+             nextToken();
+             nextToken();              
+             bindingVarName = m_token;              
+             nextToken();              
+             consumeExpected("in");
           }
-          
-          if (tokenIs('$')) {
-              nextToken();              
-              bindingVarName = m_token;              
-              nextToken();              
-              consumeExpected("in");                            
+          else if (tokenIs('$')) {
+             nextToken();
+             bindingVarName = m_token;              
+             nextToken();              
+             consumeExpected("in");
           }
           
           List<String> bindingXPathExprStrPartsList = new ArrayList<String>();
           
-          while (!(tokenIs(',') || tokenIs("return")) && m_token != null) {
+          while (!((tokenIs('$') && lookahead("in", 2)) || tokenIs("return")) && 
+                                                                         m_token != null) {
              bindingXPathExprStrPartsList.add(m_token);
              nextToken();
           }
           
+          if (",".equals(bindingXPathExprStrPartsList.get(bindingXPathExprStrPartsList.
+                                                                                   size() - 1))) {
+             bindingXPathExprStrPartsList = bindingXPathExprStrPartsList.subList(0, 
+                                                                   bindingXPathExprStrPartsList.size() - 1); 
+          }
+          
           String varBindingXpathStr = getXPathStrFromComponentParts(
                                                                 bindingXPathExprStrPartsList);
           
@@ -1181,23 +1192,35 @@ public class XPathParser
       {
           String bindingVarName = null;
           
-          if (letExprVarBindingList.size() > 0 && tokenIs(',')) {
-             nextToken();    
-          }
-          
-          if (tokenIs('$')) {
+          if ((letExprVarBindingList.size() > 0) && tokenIs(',') && 
+                                                         lookahead('$', 1)) {
+              nextToken();
+              nextToken();              
+              bindingVarName = m_token;              
               nextToken();              
+              consumeExpected(':');
+              consumeExpected('=');
+          }
+          else if (tokenIs('$')) {
+              nextToken();
               bindingVarName = m_token;              
               nextToken();              
-              consumeExpected(":");
-              consumeExpected("=");
+              consumeExpected(':');
+              consumeExpected('=');
           }
           
           List<String> bindingXPathExprStrPartsList = new ArrayList<String>();
           
-          while (!(tokenIs(',') || tokenIs("return")) && m_token != null) {
-             bindingXPathExprStrPartsList.add(m_token);
-             nextToken();
+          while (!((tokenIs('$') && lookahead(':', 2) && lookahead('=', 3)) || 
+                                                               tokenIs("return")) && m_token != null) {
+              bindingXPathExprStrPartsList.add(m_token);
+              nextToken();
+          }
+           
+          if (",".equals(bindingXPathExprStrPartsList.get(bindingXPathExprStrPartsList.
+                                                                                    size() - 1))) {
+              bindingXPathExprStrPartsList = bindingXPathExprStrPartsList.subList(0, 
+                                                                    bindingXPathExprStrPartsList.size() - 1); 
           }
           
           String varBindingXpathStr = getXPathStrFromComponentParts(bindingXPathExprStrPartsList);
@@ -1263,24 +1286,34 @@ public class XPathParser
       {
           String bindingVarName = null;
           
-          if (quantifiedExprVarBindingList.size() > 0 && tokenIs(',')) {
-             nextToken();    
+          if ((quantifiedExprVarBindingList.size() > 0) && tokenIs(',') && lookahead('$', 1)) {
+             nextToken();
+             nextToken();              
+             bindingVarName = m_token;              
+             nextToken();              
+             consumeExpected("in");
           }
-          
-          if (tokenIs('$')) {
-              nextToken();              
-              bindingVarName = m_token;              
-              nextToken();              
-              consumeExpected("in");                            
+          else if (tokenIs('$')) {
+             nextToken();
+             bindingVarName = m_token;              
+             nextToken();              
+             consumeExpected("in");
           }
           
           List<String> bindingXPathExprStrPartsList = new ArrayList<String>();
           
-          while (!(tokenIs(',') || tokenIs("satisfies")) && m_token != null) {
+          while (!((tokenIs('$') && lookahead("in", 2)) || tokenIs("satisfies")) && 
+                                                                          m_token != null) {
              bindingXPathExprStrPartsList.add(m_token);
              nextToken();
           }
           
+          if (",".equals(bindingXPathExprStrPartsList.get(bindingXPathExprStrPartsList.
+                                                                                   size() - 1))) {
+             bindingXPathExprStrPartsList = bindingXPathExprStrPartsList.subList(0, 
+                                                                   bindingXPathExprStrPartsList.size() - 1); 
+          }
+          
           String varBindingXpathStr = getXPathStrFromComponentParts(
                                                                 bindingXPathExprStrPartsList);
           
@@ -1309,7 +1342,7 @@ public class XPathParser
                nextToken();
             }
          }
-         else if (fIsXpathPredicateParsingActive && tokenIs(']')) {
+         else if (fIsXPathPredicateParsingActive && tokenIs(']')) {
             break;    
          }
          else {
@@ -1372,7 +1405,7 @@ public class XPathParser
       
       while (m_token != null)
       {
-          if (fIsXpathPredicateParsingActive && lookahead(']', 1)) {
+          if (fIsXPathPredicateParsingActive && lookahead(']', 1)) {
              elseExprXPathStrPartsList.add(m_token);
              elseExprXPathStrPartsList.subList(0, elseExprXPathStrPartsList.size() - 1);
              nextToken();
@@ -2893,11 +2926,11 @@ public class XPathParser
 
     if (tokenIs('['))
     {
-      fIsXpathPredicateParsingActive = true;      
+      fIsXPathPredicateParsingActive = true;      
       nextToken();
       PredicateExpr();
       consumeExpected(']');      
-      fIsXpathPredicateParsingActive = false;
+      fIsXPathPredicateParsingActive = false;
     }
   }
 
diff --git a/src/org/apache/xpath/functions/FuncExtFunction.java b/src/org/apache/xpath/functions/FuncExtFunction.java
index 27baee47..e0b1ff63 100644
--- a/src/org/apache/xpath/functions/FuncExtFunction.java
+++ b/src/org/apache/xpath/functions/FuncExtFunction.java
@@ -199,7 +199,7 @@ public class FuncExtFunction extends Function
        // An XPath 3.1 constructor function call, is syntactically similar
        // to XalanJ extension function call (both have, syntax like 
        // nsPrefix:functionName(..)). If the XML namespace of XPath function 
-       // call is http://www.w3.org/2001/XMLSchema, this class implements that
+       // name is http://www.w3.org/2001/XMLSchema, this class implements that
        // as an XPath 3.1 constructor function call within this section of code.
        try {
           result = XSConstructorFunctionUtil.processFuncExtFunctionOrXPathOpn(
diff --git a/src/org/apache/xpath/operations/StrConcat.java b/src/org/apache/xpath/operations/StrConcat.java
index 96533a25..2927df6d 100644
--- a/src/org/apache/xpath/operations/StrConcat.java
+++ b/src/org/apache/xpath/operations/StrConcat.java
@@ -17,6 +17,7 @@
  */
 package org.apache.xpath.operations;
 
+import org.apache.xalan.xslt.util.XslTransformEvaluationHelper;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.objects.XObject;
 import org.apache.xpath.objects.XString;
@@ -51,11 +52,12 @@ public class StrConcat extends Operation
         
       XObject result = null;
       
-      XObject expr1 = m_left.execute(xctxt);
+      XObject left = m_left.execute(xctxt);
       
-      XObject expr2 = m_right.execute(xctxt);
+      XObject right = m_right.execute(xctxt);
       
-      result = new XString(expr1.str() + expr2.str());
+      result = new XString(XslTransformEvaluationHelper.getStrVal(left) + 
+                                                             XslTransformEvaluationHelper.getStrVal(right));
       
       return result;
     }
@@ -64,7 +66,8 @@ public class StrConcat extends Operation
      * Apply the operation to two operands, and return the result.
      */
     public XObject operate(XObject left, XObject right) {
-        XObject result =  new XString(left.str() + right.str());
+        XObject result =  new XString(XslTransformEvaluationHelper.getStrVal(left) + 
+                                                             XslTransformEvaluationHelper.getStrVal(right));
         
         return result;
     }
diff --git a/tests/for_expr/gold/test11.out b/tests/for_expr/gold/test11.out
new file mode 100644
index 00000000..fd22a384
--- /dev/null
+++ b/tests/for_expr/gold/test11.out
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><result>hello there, all is fine</result>
diff --git a/tests/for_expr/gold/test12.out b/tests/for_expr/gold/test12.out
new file mode 100644
index 00000000..7ce62c2d
--- /dev/null
+++ b/tests/for_expr/gold/test12.out
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <newInfo>hello there, all is fine</newInfo>
+  <newInfo>hiiii there, aii is fine</newInfo>
+  <newInfo>hoooo there, aoo is fine</newInfo>
+</result>
diff --git a/tests/for_expr/gold/test13.out b/tests/for_expr/gold/test13.out
new file mode 100644
index 00000000..3531be51
--- /dev/null
+++ b/tests/for_expr/gold/test13.out
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><result>1 2 2 4 3 6</result>
diff --git a/tests/for_expr/gold/test14.out b/tests/for_expr/gold/test14.out
new file mode 100644
index 00000000..643c66b8
--- /dev/null
+++ b/tests/for_expr/gold/test14.out
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <detail inp="math:pow(a, 2)">math:pow(1, 2) = 1 , math:pow(2, 2) = 4 , math:pow(3, 2) = 9 , math:pow(4, 2) = 16 , math:pow(5, 2) = 25</detail>
+  <detail inp="math:pow(a, 3)">math:pow(1, 3) = 1 , math:pow(2, 3) = 8 , math:pow(3, 3) = 27 , math:pow(4, 3) = 64 , math:pow(5, 3) = 125</detail>
+  <detail inp="math:pow(a, 4)">math:pow(1, 4) = 1 , math:pow(2, 4) = 16 , math:pow(3, 4) = 81 , math:pow(4, 4) = 256 , math:pow(5, 4) = 625</detail>
+</result>
diff --git a/tests/for_expr/test11.xsl b/tests/for_expr/test11.xsl
new file mode 100644
index 00000000..797d11d2
--- /dev/null
+++ b/tests/for_expr/test11.xsl
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->                
+   
+   <!-- An XSLT stylesheet test, to test the evaluation of an 
+        XPath 3.1 "for" expression. -->                
+
+   <xsl:output method="xml" indent="yes"/>
+   
+   <xsl:template match="/">
+      <result>
+        <xsl:value-of select="for $a in (substring('hello world', 1, 5) || ' ' || 'there'), 
+                                  $b in substring('all is well', 1, 3) 
+                                               return $a || ', ' || $b || ' is fine'"/>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/for_expr/test12.xsl b/tests/for_expr/test12.xsl
new file mode 100644
index 00000000..3a53da52
--- /dev/null
+++ b/tests/for_expr/test12.xsl
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->
+   
+   <!-- use with test1_c.xml -->                
+   
+   <!-- An XSLT stylesheet test, to test the evaluation of an 
+        XPath 3.1 "for" expression. -->               
+
+   <xsl:output method="xml" indent="yes"/>
+   
+   <xsl:variable name="procInfo" select="function($info) { for $a in (substring($info/a, 1, 5) || ' ' || 'there'), 
+                                                               $b in substring($info/b, 1, 3) 
+                                                                            return $a || ', ' || $b || ' is fine' }"/>
+   
+   <xsl:template match="/temp">
+      <result>
+        <xsl:for-each select="info">
+          <newInfo>
+            <xsl:value-of select="$procInfo(.)"/>
+          </newInfo>
+        </xsl:for-each>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/for_expr/test13.xsl b/tests/for_expr/test13.xsl
new file mode 100644
index 00000000..55666adc
--- /dev/null
+++ b/tests/for_expr/test13.xsl
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->               
+   
+   <!-- An XSLT stylesheet test, to test the evaluation of an 
+        XPath 3.1 "for" expression. -->                 
+
+   <xsl:output method="xml" indent="yes"/>
+   
+   <xsl:template match="/">
+      <result>
+         <xsl:value-of select="for $val1 in (1, 2, 3), $val2 in (1, 2) return $val1 * $val2"/>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/for_expr/test14.xsl b/tests/for_expr/test14.xsl
new file mode 100644
index 00000000..bf8914e2
--- /dev/null
+++ b/tests/for_expr/test14.xsl
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:math="http://www.w3.org/2005/xpath-functions/math"
+                exclude-result-prefixes="math"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->               
+   
+   <!-- An XSLT stylesheet test, to test the evaluation of an 
+        XPath 3.1 "for" expression. -->                 
+
+   <xsl:output method="xml" indent="yes"/>
+   
+   <xsl:template match="/">
+      <result>
+         <xsl:for-each select="(2, 3, 4)">
+           <xsl:variable name="num" select="."/>
+           <xsl:variable name="result1" select="for $a in (1, 2, 3, 4, 5), $b in $num return 
+                                                                     'math:pow(' || $a || ', ' || $b || ')' || ' = ' || math:pow($a, $b)"/>
+           <detail inp="math:pow(a, {$num})"><xsl:value-of select="string-join($result1, ' , ')"/></detail>
+         </xsl:for-each>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/for_expr/test1_c.xml b/tests/for_expr/test1_c.xml
new file mode 100644
index 00000000..6ac91ed3
--- /dev/null
+++ b/tests/for_expr/test1_c.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<temp>
+  <info>
+    <a>hello world</a>
+    <b>all is well</b>
+  </info>
+  <info>
+    <a>hiiii world</a>
+    <b>aii is well</b>
+  </info>
+  <info>
+    <a>hoooo world</a>
+    <b>aoo is well</b>
+  </info>
+</temp>
+ 
\ No newline at end of file
diff --git a/tests/let_expr/gold/test10.out b/tests/let_expr/gold/test10.out
new file mode 100644
index 00000000..7ce62c2d
--- /dev/null
+++ b/tests/let_expr/gold/test10.out
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <newInfo>hello there, all is fine</newInfo>
+  <newInfo>hiiii there, aii is fine</newInfo>
+  <newInfo>hoooo there, aoo is fine</newInfo>
+</result>
diff --git a/tests/let_expr/gold/test9.out b/tests/let_expr/gold/test9.out
new file mode 100644
index 00000000..52018c34
--- /dev/null
+++ b/tests/let_expr/gold/test9.out
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><result>3 2</result>
diff --git a/tests/let_expr/test10.xsl b/tests/let_expr/test10.xsl
new file mode 100644
index 00000000..e408b771
--- /dev/null
+++ b/tests/let_expr/test10.xsl
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->
+   
+   <!-- use with test1_c.xml -->                
+   
+   <!-- An XSLT stylesheet test, to test the evaluation of an 
+        XPath 3.1 "let" expression. -->                 
+
+   <xsl:output method="xml" indent="yes"/>
+      
+   <xsl:variable name="procInfo" select="function($info) { let $a := (substring($info/a, 1, 5) || ' ' || 'there'), 
+                                                               $b := substring($info/b, 1, 3) 
+                                                                                   return $a || ', ' || $b || ' is fine' }"/>
+                                                                                         
+   <xsl:template match="/temp">
+      <result>
+         <xsl:for-each select="info">
+           <newInfo>
+             <xsl:value-of select="$procInfo(.)"/>
+           </newInfo>
+         </xsl:for-each>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/let_expr/test1_c.xml b/tests/let_expr/test1_c.xml
new file mode 100644
index 00000000..6ac91ed3
--- /dev/null
+++ b/tests/let_expr/test1_c.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<temp>
+  <info>
+    <a>hello world</a>
+    <b>all is well</b>
+  </info>
+  <info>
+    <a>hiiii world</a>
+    <b>aii is well</b>
+  </info>
+  <info>
+    <a>hoooo world</a>
+    <b>aoo is well</b>
+  </info>
+</temp>
+ 
\ No newline at end of file
diff --git a/tests/let_expr/test9.xsl b/tests/let_expr/test9.xsl
new file mode 100644
index 00000000..4ab7ab75
--- /dev/null
+++ b/tests/let_expr/test9.xsl
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->                
+   
+   <!-- An XSLT stylesheet test, to test the evaluation of an 
+        XPath 3.1 "let" expression. -->                 
+
+   <xsl:output method="xml" indent="yes"/>
+   
+   <xsl:template match="/">
+      <result>
+        <xsl:value-of select="let $a := (1, 2, 3), $b := (1, 2)  return 
+                                                             (count($a) || ' ' || count($b))"/>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/org/apache/xalan/xpath3/ForExprTests.java b/tests/org/apache/xalan/xpath3/ForExprTests.java
index 221c20b1..40eabd48 100644
--- a/tests/org/apache/xalan/xpath3/ForExprTests.java
+++ b/tests/org/apache/xalan/xpath3/ForExprTests.java
@@ -146,5 +146,45 @@ public class ForExprTests extends XslTransformTestsUtil {
         
         runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
     }
+    
+    @Test
+    public void xslForExprTest11() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test11.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test11.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test11.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void xslForExprTest12() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_c.xml"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test12.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test12.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void xslForExprTest13() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test13.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test13.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test13.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void xslForExprTest14() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test14.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test14.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test14.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
 
 }
diff --git a/tests/org/apache/xalan/xpath3/LetExprTests.java b/tests/org/apache/xalan/xpath3/LetExprTests.java
index 48d62e12..8ec01d0f 100644
--- a/tests/org/apache/xalan/xpath3/LetExprTests.java
+++ b/tests/org/apache/xalan/xpath3/LetExprTests.java
@@ -126,5 +126,25 @@ public class LetExprTests extends XslTransformTestsUtil {
         
         runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
     }
+    
+    @Test
+    public void xslLetExprTest9() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test9.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test9.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test9.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void xslLetExprTest10() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_c.xml"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test10.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test10.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
 
 }
diff --git a/tests/org/apache/xalan/xpath3/QuantifiedExprTests.java b/tests/org/apache/xalan/xpath3/QuantifiedExprTests.java
index 10dc49b6..6861f869 100644
--- a/tests/org/apache/xalan/xpath3/QuantifiedExprTests.java
+++ b/tests/org/apache/xalan/xpath3/QuantifiedExprTests.java
@@ -161,5 +161,45 @@ public class QuantifiedExprTests extends XslTransformTestsUtil {
         
         runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
     }
+    
+    @Test
+    public void xslQuantifiedExprTest12() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test11.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test11.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test12.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void xslQuantifiedExprTest13() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_h.xml"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test12.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test12.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void xslQuantifiedExprTest14() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test13.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test13.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test13.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void xslQuantifiedExprTest15() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test14.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test14.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test14.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
 
 }
diff --git a/tests/quantified_expr/gold/test12.out b/tests/quantified_expr/gold/test12.out
new file mode 100644
index 00000000..7ce9da42
--- /dev/null
+++ b/tests/quantified_expr/gold/test12.out
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <someEvenVal>false</someEvenVal>
+  <someEvenVal>true</someEvenVal>
+  <everyEvenVal>true</everyEvenVal>
+  <everyEvenVal>false</everyEvenVal>
+</result>
diff --git a/tests/quantified_expr/gold/test13.out b/tests/quantified_expr/gold/test13.out
new file mode 100644
index 00000000..05e5bb77
--- /dev/null
+++ b/tests/quantified_expr/gold/test13.out
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <one>true</one>
+  <two>false</two>
+</result>
diff --git a/tests/quantified_expr/gold/test14.out b/tests/quantified_expr/gold/test14.out
new file mode 100644
index 00000000..05e5bb77
--- /dev/null
+++ b/tests/quantified_expr/gold/test14.out
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <one>true</one>
+  <two>false</two>
+</result>
diff --git a/tests/quantified_expr/test11.xsl b/tests/quantified_expr/test11.xsl
new file mode 100644
index 00000000..3ce790e8
--- /dev/null
+++ b/tests/quantified_expr/test11.xsl
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->
+   
+   <!-- An XSLT stylesheet test case, to test the XPath 3.1 quantified 
+        expressions 'some' and 'every'.
+   -->                 
+
+   <xsl:output method="xml" indent="yes"/>
+      
+   <xsl:template match="/">
+      <result>
+         <someEvenVal><xsl:value-of select="some $x in (1, 3, 5, 7, 9) satisfies ($x mod 2) eq 0"/></someEvenVal>
+         <someEvenVal><xsl:value-of select="some $x in (1, 2, 5, 7, 9) satisfies ($x mod 2) eq 0"/></someEvenVal>
+         <everyEvenVal><xsl:value-of select="every $x in (2, 4, 6, 8, 10) satisfies ($x mod 2) eq 0"/></everyEvenVal>
+         <everyEvenVal><xsl:value-of select="every $x in (2, 3, 6, 8, 10) satisfies ($x mod 2) eq 0"/></everyEvenVal>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/quantified_expr/test12.xsl b/tests/quantified_expr/test12.xsl
new file mode 100644
index 00000000..bdff420c
--- /dev/null
+++ b/tests/quantified_expr/test12.xsl
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="3.0">
+   
+   <!-- Author: mukulg@apache.org -->
+   
+   <!-- use with test1_h.xml -->
+   
+   <!-- An XSLT stylesheet test case, to test the XPath 3.1 quantified 
+        expressions 'some' and 'every'.
+   -->
+   
+   <xsl:output method="xml" indent="yes"/>
+      
+   <xsl:template match="/temp">
+      <result>
+         <someEvenVal><xsl:value-of select="some $x in seq1/val satisfies ($x mod 2) eq 0"/></someEvenVal>
+         <someEvenVal><xsl:value-of select="some $x in seq2/val satisfies ($x mod 2) eq 0"/></someEvenVal>
+         <everyEvenVal><xsl:value-of select="every $x in seq3/val satisfies ($x mod 2) eq 0"/></everyEvenVal>
+         <everyEvenVal><xsl:value-of select="every $x in seq4/val satisfies ($x mod 2) eq 0"/></everyEvenVal>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/quantified_expr/test13.xsl b/tests/quantified_expr/test13.xsl
new file mode 100644
index 00000000..608fb7c6
--- /dev/null
+++ b/tests/quantified_expr/test13.xsl
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->
+   
+   <!-- An XSLT stylesheet test case, to test the XPath 3.1 quantified 
+        expressions 'some' and 'every'.
+        
+        This stylesheet test case, borrows the XPath quantified expression 
+        examples from XPath 3.1 spec.
+   -->                 
+
+   <xsl:output method="xml" indent="yes"/>
+      
+   <xsl:template match="/">
+      <result>
+         <one>
+            <xsl:value-of select="some $x in (1, 2, 3), $y in (2, 3, 4)
+                                                            satisfies $x + $y = 4"/>
+         </one>
+         <two>
+            <xsl:value-of select="every $x in (1, 2, 3), $y in (2, 3, 4)
+                                                            satisfies $x + $y = 4"/>
+         </two>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/quantified_expr/test14.xsl b/tests/quantified_expr/test14.xsl
new file mode 100644
index 00000000..1c2de9c6
--- /dev/null
+++ b/tests/quantified_expr/test14.xsl
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="3.0">
+                
+   <!-- Author: mukulg@apache.org -->
+   
+   <!-- An XSLT stylesheet test case, to test the XPath 3.1 quantified 
+        expressions 'some' and 'every'.
+        
+        This stylesheet test case, borrows the XPath quantified expression 
+        examples from XPath 3.1 spec.
+   -->                 
+
+   <xsl:output method="xml" indent="yes"/>
+      
+   <xsl:template match="/">
+      <result>
+         <one>
+            <xsl:value-of select="some $x in (1, 2, 'cat') satisfies $x * 2 = 4"/>
+         </one>
+         <two>
+            <xsl:value-of select="every $x in (1, 2, 'cat') satisfies $x * 2 = 4"/>
+         </two>
+      </result>
+   </xsl:template>
+   
+   <!--
+      * Licensed to the Apache Software Foundation (ASF) under one
+      * or more contributor license agreements. See the NOTICE file
+      * distributed with this work for additional information
+      * regarding copyright ownership. The ASF licenses this file
+      * to you under the Apache License, Version 2.0 (the  "License");
+      * you may not use this file except in compliance with the License.
+      * You may obtain a copy of the License at
+      *
+      *     http://www.apache.org/licenses/LICENSE-2.0
+      *
+      * Unless required by applicable law or agreed to in writing, software
+      * distributed under the License is distributed on an "AS IS" BASIS,
+      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      * See the License for the specific language governing permissions and
+      * limitations under the License.
+   -->
+
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/tests/quantified_expr/test1_h.xml b/tests/quantified_expr/test1_h.xml
new file mode 100644
index 00000000..7043bb67
--- /dev/null
+++ b/tests/quantified_expr/test1_h.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<temp>
+  <seq1>
+    <val>1</val>
+    <val>3</val>
+    <val>5</val>
+    <val>7</val>
+    <val>9</val>
+  </seq1>
+  <seq2>
+    <val>1</val>
+    <val>2</val>
+    <val>5</val>
+    <val>7</val>
+    <val>9</val>
+  </seq2>
+  <seq3>
+    <val>2</val>
+    <val>4</val>
+    <val>6</val>
+    <val>8</val>
+    <val>10</val>
+  </seq3>
+  <seq4>
+    <val>2</val>
+    <val>3</val>
+    <val>6</val>
+    <val>8</val>
+    <val>10</val>
+  </seq4>
+</temp>
+ 
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org