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/09/09 15:23:02 UTC

[xalan-java] branch xalan-j_xslt3.0 updated: committing implementation of expected type support for xpath 3.1 inline function expression, for function parameters and return value. also committing few new related working test cases as well. committing as well, a related minor bug fix within class ElemValueOf.

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 85499476 committing implementation of expected type support for xpath 3.1 inline function expression, for function parameters and return value. also committing few new related working test cases as well. committing as well, a related minor bug fix within class ElemValueOf.
     new 2f1b30a0 Merge pull request #80 from mukulga/xalan-j_xslt3.0_mukul
85499476 is described below

commit 85499476424e70a7b71715dcf43f168978d66645
Author: Mukul Gandhi <ga...@gmail.com>
AuthorDate: Sat Sep 9 20:49:23 2023 +0530

    committing implementation of expected type support for xpath 3.1 inline function expression, for function parameters and return value. also committing few new related working test cases as well. committing as well, a related minor bug fix within class ElemValueOf.
---
 src/org/apache/xalan/templates/ElemValueOf.java    |   2 +-
 src/org/apache/xpath/compiler/XPathParser.java     | 110 ++++++++++++++-------
 .../xpath/composite/SequenceTypeSupport.java       |  11 ++-
 .../xpath/functions/DynamicFunctionCall.java       |  57 +++++++++--
 src/org/apache/xpath/functions/FuncFilter.java     |  13 +--
 src/org/apache/xpath/functions/FuncFoldLeft.java   |  13 +--
 src/org/apache/xpath/functions/FuncFoldRight.java  |  13 +--
 src/org/apache/xpath/functions/FuncForEach.java    |  13 +--
 .../apache/xpath/functions/FuncForEachPair.java    |  11 ++-
 src/org/apache/xpath/functions/FuncSort.java       |  14 +--
 src/org/apache/xpath/objects/InlineFunction.java   |  47 +++++----
 .../xpath/objects/InlineFunctionParameter.java     |  51 ++++++++++
 tests/inline_function_expr/gold/test8.out          |   4 +
 tests/inline_function_expr/gold/test9.out          |   1 +
 tests/inline_function_expr/test1_d.xml             |   4 +
 tests/inline_function_expr/test8.xsl               |  49 +++++++++
 tests/inline_function_expr/test9.xsl               |  44 +++++++++
 .../apache/xalan/util/XslTransformTestsUtil.java   |   4 +-
 .../xalan/xpath3/InlineFunctionItemExprTests.java  |  20 ++++
 19 files changed, 371 insertions(+), 110 deletions(-)

diff --git a/src/org/apache/xalan/templates/ElemValueOf.java b/src/org/apache/xalan/templates/ElemValueOf.java
index a89ab45f..cd878bc3 100644
--- a/src/org/apache/xalan/templates/ElemValueOf.java
+++ b/src/org/apache/xalan/templates/ElemValueOf.java
@@ -388,7 +388,7 @@ public class ElemValueOf extends ElemTemplateElement {
                      
                      XObject evalResult = dfc.execute(xctxt);
                      
-                     String strValue = evalResult.str();
+                     String strValue = XslTransformEvaluationHelper.getStrVal(evalResult);
                      
                      (new XString(strValue)).dispatchCharactersEvents(rth);
                   }
diff --git a/src/org/apache/xpath/compiler/XPathParser.java b/src/org/apache/xpath/compiler/XPathParser.java
index cbf0ee11..f5eee541 100644
--- a/src/org/apache/xpath/compiler/XPathParser.java
+++ b/src/org/apache/xpath/compiler/XPathParser.java
@@ -38,6 +38,7 @@ import org.apache.xpath.composite.IfExpr;
 import org.apache.xpath.composite.LetExpr;
 import org.apache.xpath.composite.LetExprVarBinding;
 import org.apache.xpath.composite.QuantifiedExpr;
+import org.apache.xpath.composite.SequenceTypeData;
 import org.apache.xpath.composite.SequenceTypeKindTest;
 import org.apache.xpath.composite.SequenceTypeSupport;
 import org.apache.xpath.composite.SimpleSequenceConstructor;
@@ -45,6 +46,7 @@ import org.apache.xpath.composite.XPathSequenceTypeExpr;
 import org.apache.xpath.domapi.XPathStylesheetDOM3Exception;
 import org.apache.xpath.functions.DynamicFunctionCall;
 import org.apache.xpath.objects.InlineFunction;
+import org.apache.xpath.objects.InlineFunctionParameter;
 import org.apache.xpath.objects.XNumber;
 import org.apache.xpath.objects.XString;
 import org.apache.xpath.res.XPATHErrorResources;
@@ -100,7 +102,8 @@ public class XPathParser
                                                       "eq", "ne", "lt", "gt", "le", "ge", 
                                                       "for", "in", "return", "if", "then", 
                                                       "else", "some", "every", "satisfies", 
-                                                      "let", ":=", "-", "||", "instance", "of" };
+                                                      "let", ":=", "-", "||", "instance", "of", 
+                                                      "as" };
   
   // If the XPath expression is () (i.e, representing an xdm empty sequence),
   // we translate that within this XPath parser implementation, to an XPath
@@ -800,7 +803,8 @@ public class XPathParser
   /**
    * This method helps to implement, XPath 3.1 sequence type expressions.
    */
-  private void setSequenceTypeOccurenceIndicator(XPathSequenceTypeExpr xpathSequenceTypeExpr) throws TransformerException {
+  private void setSequenceTypeOccurenceIndicator(XPathSequenceTypeExpr xpathSequenceTypeExpr, 
+                                                                                   boolean isInlineFunction) throws TransformerException {
       if (tokenIs(SequenceTypeSupport.Q_MARK)) {
          xpathSequenceTypeExpr.setItemTypeOccurrenceIndicator(SequenceTypeSupport.
                                                                                  OccurenceIndicator.ZERO_OR_ONE);
@@ -816,7 +820,7 @@ public class XPathParser
                                                                                  OccurenceIndicator.ONE_OR_MANY);
          nextToken();
       }
-      else {
+      else if (!isInlineFunction) {
          throw new javax.xml.transform.TransformerException("XPST0051 A sequence type occurence indicator '" + m_token + "', is not recognized."); 
       }
    }
@@ -850,7 +854,9 @@ public class XPathParser
     * This method helps to implement, XPath 3.1 sequence type expressions.
     */
    private SequenceTypeKindTest constructSequenceTypeKindTestForXDMNodes(XPathSequenceTypeExpr 
-                                                                                         xpathSequenceTypeExpr, int nodeType) throws TransformerException {
+                                                                                     xpathSequenceTypeExpr, 
+                                                                                     int nodeType, 
+                                                                                     boolean isInlineFunction) throws TransformerException {
 
        SequenceTypeKindTest sequenceTypeKindTest = new SequenceTypeKindTest();
 
@@ -863,16 +869,22 @@ public class XPathParser
            nextToken();
        }
        if (tokenIs(')')) {
-           if (getTokenRelative(0) == null) {
-               nextToken();                
-           }
-           else if (getTokenRelative(1) == null) {
+           if (isInlineFunction) {
                nextToken();                
-               setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr);
+               setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr, isInlineFunction);  
            }
            else {
-               throw new javax.xml.transform.TransformerException("XPST0051 : The sequence type expression is "
-                                                                                                      + "not well-formed."); 
+               if (getTokenRelative(0) == null) {
+                   nextToken();                
+               }
+               else if (getTokenRelative(1) == null) {
+                   nextToken();                
+                   setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr, isInlineFunction);
+               }
+               else {
+                   throw new javax.xml.transform.TransformerException("XPST0051 : The sequence type expression is "
+                                                                                                          + "not well-formed."); 
+               }
            }
        }
        else {
@@ -1239,7 +1251,7 @@ public class XPathParser
           }
       }
       else if (fIsSequenceTypeXPathExpr) {
-         fXpathSequenceTypeExpr = SequenceTypeExpr(); 
+         fXpathSequenceTypeExpr = SequenceTypeExpr(false); 
       }
       else {
          ExprSingle();  
@@ -2012,7 +2024,7 @@ public class XPathParser
           
           int op1 = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
           
-          fXpathSequenceTypeExpr = SequenceTypeExpr();          
+          fXpathSequenceTypeExpr = SequenceTypeExpr(false);          
           m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, 
                                                   m_ops.getOp(addPos + op1 + 1) + op1);
           addPos += 2;
@@ -2480,8 +2492,7 @@ public class XPathParser
        String delim = "t0_" + delimSuffix;
        
        while (m_token != null && isXPathDynamicFuncCallParseAhead(
-                                                      argDetailsStrPartsList, delim))
-       {
+                                                      argDetailsStrPartsList, delim)) {
           // no op here
        }
        
@@ -2581,7 +2592,7 @@ public class XPathParser
   protected InlineFunction InlineFunctionExpr() throws javax.xml.transform.TransformerException {
       InlineFunction inlineFunction = new InlineFunction();
       
-      List<String> funcParamNameList = new ArrayList<String>();      
+      List<InlineFunctionParameter> funcParamList = new ArrayList<InlineFunctionParameter>();      
       String funcBodyXPathExprStr = null;
       
       nextToken();
@@ -2599,8 +2610,25 @@ public class XPathParser
               if (m_tokenChar == '$')
               {
                   nextToken();
-                  funcParamNameList.add(m_token);
-                  nextToken();
+                  
+                  InlineFunctionParameter inlineFunctionParameter = new InlineFunctionParameter();                   
+                  if (lookahead("as", 1)) {
+                     inlineFunctionParameter.setParamName(m_token);                     
+                     nextToken();
+                     nextToken();                     
+                     SequenceTypeData paramType = new SequenceTypeData();
+                     XPathSequenceTypeExpr seqTypeExpr = SequenceTypeExpr(true);
+                     paramType.setSequenceType(seqTypeExpr.getSequenceType());
+                     paramType.setItemTypeOccurrenceIndicator(seqTypeExpr.getItemTypeOccurrenceIndicator());
+                     paramType.setSequenceTypeKindTest(seqTypeExpr.getSequenceTypeKindTest());
+                     inlineFunctionParameter.setParamType(paramType);                     
+                  }
+                  else {
+                     inlineFunctionParameter.setParamName(m_token);
+                     nextToken();
+                  }
+                  
+                  funcParamList.add(inlineFunctionParameter);
               }
     
               if (!tokenIs(')'))
@@ -2615,10 +2643,21 @@ public class XPathParser
           }    
       }
       
-      inlineFunction.setFuncParamNameList(funcParamNameList);
+      inlineFunction.setFuncParamList(funcParamList);
       
       consumeExpected(')');
       
+      if (tokenIs("as")) {
+         nextToken();
+         XPathSequenceTypeExpr seqTypeExpr = SequenceTypeExpr(true);
+         SequenceTypeData returnType = new SequenceTypeData();
+         returnType.setSequenceType(seqTypeExpr.getSequenceType());
+         returnType.setItemTypeOccurrenceIndicator(seqTypeExpr.getItemTypeOccurrenceIndicator());
+         returnType.setSequenceTypeKindTest(seqTypeExpr.getSequenceTypeKindTest());
+         
+         inlineFunction.setReturnType(returnType);
+      }
+      
       consumeExpected('{');
       
       // While parsing the XPath expression string that forms body of inline
@@ -3695,11 +3734,14 @@ public class XPathParser
     return trailingSlashConsumed;
   }
   
-  protected XPathSequenceTypeExpr SequenceTypeExpr() throws javax.xml.transform.TransformerException
-  {
-      int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-                  
-      insertOp(opPos, 2, OpCodes.OP_SEQUENCE_TYPE_EXPR);
+  protected XPathSequenceTypeExpr SequenceTypeExpr(boolean isInlineFunction) 
+                                                                          throws javax.xml.transform.TransformerException {
+      int opPos = 0;
+      
+      if (!isInlineFunction) {
+         opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);                  
+         insertOp(opPos, 2, OpCodes.OP_SEQUENCE_TYPE_EXPR);
+      }
       
       XPathSequenceTypeExpr xpathSequenceTypeExpr = new XPathSequenceTypeExpr();
       
@@ -3760,17 +3802,17 @@ public class XPathParser
          nextToken();
          
          if ((m_token != null) && (xpathSequenceTypeExpr.getSequenceType() > 0)) {
-            setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr);
+            setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr, isInlineFunction);
          }         
       }
       else if (tokenIs("element")) {
           sequenceTypeKindTest = constructSequenceTypeKindTestForXDMNodes(xpathSequenceTypeExpr, 
-                                                                                        SequenceTypeSupport.ELEMENT_KIND);          
+                                                                                        SequenceTypeSupport.ELEMENT_KIND, isInlineFunction);          
           xpathSequenceTypeExpr.setSequenceTypeKindTest(sequenceTypeKindTest);          
       }
       else if (tokenIs("attribute")) {
           sequenceTypeKindTest = constructSequenceTypeKindTestForXDMNodes(xpathSequenceTypeExpr, 
-                                                                                        SequenceTypeSupport.ATTRIBUTE_KIND);          
+                                                                                        SequenceTypeSupport.ATTRIBUTE_KIND, isInlineFunction);          
           xpathSequenceTypeExpr.setSequenceTypeKindTest(sequenceTypeKindTest);
       }
       else if (tokenIs("text")) {
@@ -3781,7 +3823,7 @@ public class XPathParser
           consumeExpected(')');
           xpathSequenceTypeExpr.setSequenceTypeKindTest(sequenceTypeKindTest);
           if (m_token != null) {
-             setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr); 
+             setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr, isInlineFunction); 
           }          
       }
       else if (tokenIs("namespace-node")) {
@@ -3792,7 +3834,7 @@ public class XPathParser
           consumeExpected(')');
           xpathSequenceTypeExpr.setSequenceTypeKindTest(sequenceTypeKindTest);
           if (m_token != null) {
-             setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr); 
+             setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr, isInlineFunction); 
           }
       }
       else if (tokenIs("node")) { 
@@ -3803,7 +3845,7 @@ public class XPathParser
           consumeExpected(')');
           xpathSequenceTypeExpr.setSequenceTypeKindTest(sequenceTypeKindTest);
           if (m_token != null) {
-             setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr);  
+             setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr, isInlineFunction);  
           }
       }
       else if (tokenIs("item")) {
@@ -3814,7 +3856,7 @@ public class XPathParser
           consumeExpected(')');
           xpathSequenceTypeExpr.setSequenceTypeKindTest(sequenceTypeKindTest);
           if (m_token != null) {
-             setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr);  
+             setSequenceTypeOccurenceIndicator(xpathSequenceTypeExpr, isInlineFunction);  
           }
       }            
       else {
@@ -3822,8 +3864,10 @@ public class XPathParser
                                                                                                    + "recognized, within the provided sequence type expression."); 
       }
       
-      m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
-                                             m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
+      if (!isInlineFunction) {
+         m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
+                                                m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
+      }
       
       return xpathSequenceTypeExpr;
   }
diff --git a/src/org/apache/xpath/composite/SequenceTypeSupport.java b/src/org/apache/xpath/composite/SequenceTypeSupport.java
index aff43d16..d581fd85 100644
--- a/src/org/apache/xpath/composite/SequenceTypeSupport.java
+++ b/src/org/apache/xpath/composite/SequenceTypeSupport.java
@@ -648,7 +648,7 @@ public class SequenceTypeSupport {
     }
     
     /**
-     * This method is used to support following XSL transformation actions,
+     * This method helps to support following XSL transformation actions,
      * 
      * 1) An xsl:variable element has an "as" attribute (specifying the expected type of variable's value),
      *    not having a "select" attribute, and having a contained sequence constructor (which when
@@ -948,12 +948,15 @@ public class SequenceTypeSupport {
         
         int seqLen = srcResultSeq.size();
         
-        if ((seqLen > 0) && (expectedType == EMPTY_SEQUENCE)) {
+        if ((seqLen == 0) && (itemTypeOccurenceIndicator == OccurenceIndicator.ONE_OR_MANY)) {
+           throw new TransformerException("XTTE0570 : An empty sequence is not allowed, as result of evaluation for sequence "
+                                                                                                              + "type's occurence indicator +.", srcLocator);  
+        }
+        else if ((seqLen > 0) && (expectedType == EMPTY_SEQUENCE)) {
            throw new TransformerException("XTTE0570 : The sequence doesn't conform to an expected type empty-sequence(). "
                                                                                                + "The supplied sequence has size " + seqLen + ".", srcLocator);  
         }
-        else if ((seqLen > 1) && ((itemTypeOccurenceIndicator == 0) || (itemTypeOccurenceIndicator == 
-                                                                                                OccurenceIndicator.ZERO_OR_ONE))) {
+        else if ((seqLen > 1) && (itemTypeOccurenceIndicator == OccurenceIndicator.ZERO_OR_ONE)) {
             throw new TransformerException("XTTE0570 : A sequence of size " + seqLen + ", cannot be cast to a type " 
                                                                                                                 + sequenceTypeXPathExprStr + ".", srcLocator); 
         }
diff --git a/src/org/apache/xpath/functions/DynamicFunctionCall.java b/src/org/apache/xpath/functions/DynamicFunctionCall.java
index a4602105..46e4e063 100644
--- a/src/org/apache/xpath/functions/DynamicFunctionCall.java
+++ b/src/org/apache/xpath/functions/DynamicFunctionCall.java
@@ -36,7 +36,10 @@ import org.apache.xpath.ExpressionOwner;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.XPathVisitor;
+import org.apache.xpath.composite.SequenceTypeData;
+import org.apache.xpath.composite.SequenceTypeSupport;
 import org.apache.xpath.objects.InlineFunction;
+import org.apache.xpath.objects.InlineFunctionParameter;
 import org.apache.xpath.objects.XObject;
 
 /*
@@ -125,12 +128,12 @@ public class DynamicFunctionCall extends Expression {
            InlineFunction inlineFunction = (InlineFunction)functionRef;
            
            String inlineFnXPathStr = inlineFunction.getFuncBodyXPathExprStr();
-           List<String> funcParamNameList = inlineFunction.getFuncParamNameList();           
+           List<InlineFunctionParameter> funcParamList = inlineFunction.getFuncParamList();           
            
-           if (argList.size() != funcParamNameList.size()) {
+           if (argList.size() != funcParamList.size()) {
                throw new javax.xml.transform.TransformerException("XPTY0004 : Number of arguments required for "
-                                                       + "dynamic call to function is " + funcParamNameList.size() + ". "
-                                                       + "Number of arguments provided " + argList.size() + ".", xctxt.getSAXLocator());    
+                                                                                  + "dynamic call to function is " + funcParamList.size() + ". "
+                                                                                  + "Number of arguments provided " + argList.size() + ".", xctxt.getSAXLocator());    
            }
            
            ElemTemplateElement elemTemplateElement = (ElemTemplateElement)xctxt.getNamespaceContext();
@@ -141,8 +144,8 @@ public class DynamicFunctionCall extends Expression {
            
            Map<QName, XObject> functionParamAndArgBackupMap = new HashMap<QName, XObject>();
            
-           for (int idx = 0; idx < funcParamNameList.size(); idx++) {              
-              String funcParamName = funcParamNameList.get(idx);
+           for (int idx = 0; idx < funcParamList.size(); idx++) {
+              InlineFunctionParameter funcParam = funcParamList.get(idx);                                                         
               
               String argXPathStr = argList.get(idx);
               
@@ -159,6 +162,25 @@ public class DynamicFunctionCall extends Expression {
               
               XObject argValue = argXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext());
               
+              String funcParamName = funcParam.getParamName();
+              SequenceTypeData paramType = funcParam.getParamType();
+              
+              if (paramType != null) {
+                  try {
+                     argValue = SequenceTypeSupport.convertXDMValueToAnotherType(argValue, null, paramType, null);                     
+                     if (argValue == null) {
+                        throw new TransformerException("XTTE0505 : The item type of argument at position " + (idx + 1) + " of dynamic function call "
+                                                                                                           + "$" + funcRefVarName + ", doesn't match "
+                                                                                                           + "an expected type.", srcLocator);  
+                     }
+                  }
+                  catch (TransformerException ex) {
+                     throw new TransformerException("XTTE0505 : The item type of argument at position " + (idx + 1) + " of dynamic function call "
+                                                                                                        + "$" + funcRefVarName + ", doesn't match "
+                                                                                                        + "an expected type.", srcLocator); 
+                  }
+              }
+              
               m_xpathVarList.add(new QName(funcParamName));
               
               functionParamAndArgBackupMap.put(new QName(funcParamName), argValue);
@@ -176,15 +198,30 @@ public class DynamicFunctionCall extends Expression {
            if (fVars != null) {
               inlineFnXPath.fixupVariables(fVars, fGlobalsSize);
            }
-           
+                      
            evalResult = inlineFnXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext());
            
+           SequenceTypeData funcReturnType = inlineFunction.getReturnType();
+           if (funcReturnType != null) {
+              try {
+                 evalResult = SequenceTypeSupport.convertXDMValueToAnotherType(evalResult, null, funcReturnType, null);
+                 if (evalResult == null) {
+                    throw new TransformerException("XTTE0505 : The item type of result of dynamic function call $"+ funcRefVarName + ", doesn't match an "
+                                                                                                                                   + "expected type.", srcLocator);  
+                 }
+              }
+              catch (TransformerException ex) {
+                  throw new TransformerException("XTTE0505 : The item type of result of dynamic function call $"+ funcRefVarName + ", doesn't match an "
+                                                                                                                                 + "expected type.", srcLocator);  
+              }
+           }
+           
            inlineFunctionVarMap.clear();           
        }
        else {
-           throw new javax.xml.transform.TransformerException("XPST0008 variable '" + funcRefVarName + "' has "
-                                                        + "not been declared, or its declaration is not in scope.", 
-                                                                                                      xctxt.getSAXLocator());    
+           throw new javax.xml.transform.TransformerException("XPST0008 : Variable '" + funcRefVarName + "' has "
+                                                                                                       + "not been declared, or its declaration is not in scope.", 
+                                                                                                                                              xctxt.getSAXLocator());    
        }
                
        return evalResult;
diff --git a/src/org/apache/xpath/functions/FuncFilter.java b/src/org/apache/xpath/functions/FuncFilter.java
index 6cc59fdd..3d8c98b0 100644
--- a/src/org/apache/xpath/functions/FuncFilter.java
+++ b/src/org/apache/xpath/functions/FuncFilter.java
@@ -33,6 +33,7 @@ import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.axes.LocPathIterator;
 import org.apache.xpath.objects.InlineFunction;
+import org.apache.xpath.objects.InlineFunctionParameter;
 import org.apache.xpath.objects.ResultSequence;
 import org.apache.xpath.objects.XBoolean;
 import org.apache.xpath.objects.XNodeSet;
@@ -172,10 +173,10 @@ public class FuncFilter extends Function2Args {
    */
   private void validateInlineFunctionParamCardinality(InlineFunction inlineFuncArg, SourceLocator srcLocator) throws 
                                                                                                 javax.xml.transform.TransformerException {
-      List<String> funcParamNameList = inlineFuncArg.getFuncParamNameList();
-      if (funcParamNameList.size() != 1) {
+      List<InlineFunctionParameter> funcParamList = inlineFuncArg.getFuncParamList();
+      if (funcParamList.size() != 1) {
           throw new javax.xml.transform.TransformerException("XPTY0004 : The supplied function fn:filter's function item has " + 
-                                                                                                      funcParamNameList.size() + " parameters. "
+                                                                                                      funcParamList.size() + " parameters. "
                                                                                                       + "Expected 1.", srcLocator);   
       }
   }
@@ -184,12 +185,12 @@ public class FuncFilter extends Function2Args {
    * Evaluate the function call fn:filter.
    */
   private ResultSequence evaluateFnFilter(XPathContext xctxt, XObject arg0XsObject, 
-                                               DTMIterator arg0DtmIterator, InlineFunction arg1) 
+                                                 DTMIterator arg0DtmIterator, InlineFunction arg1) 
                                                                                     throws TransformerException {
         ResultSequence resultSeq = new ResultSequence(); 
         
-        List<String> funcParamNameList = arg1.getFuncParamNameList();
-        QName varQname = new QName(funcParamNameList.get(0));
+        List<InlineFunctionParameter> funcParamList = arg1.getFuncParamList();
+        QName varQname = new QName((funcParamList.get(0)).getParamName());
         
         String funcBodyXPathExprStr = arg1.getFuncBodyXPathExprStr();
         
diff --git a/src/org/apache/xpath/functions/FuncFoldLeft.java b/src/org/apache/xpath/functions/FuncFoldLeft.java
index 9c147dbf..b5c023dc 100644
--- a/src/org/apache/xpath/functions/FuncFoldLeft.java
+++ b/src/org/apache/xpath/functions/FuncFoldLeft.java
@@ -28,6 +28,7 @@ import org.apache.xml.utils.QName;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.objects.InlineFunction;
+import org.apache.xpath.objects.InlineFunctionParameter;
 import org.apache.xpath.objects.ResultSequence;
 import org.apache.xpath.objects.XObject;
 import org.apache.xpath.operations.Variable;
@@ -94,11 +95,11 @@ public class FuncFoldLeft extends XPathHigherOrderBuiltinFunctionsSupport {
         }
            
         String inlineFnXPathStr = foldLeftThirdArg.getFuncBodyXPathExprStr();
-        List<String> funcParamNameList = foldLeftThirdArg.getFuncParamNameList();
+        List<InlineFunctionParameter> funcParamList = foldLeftThirdArg.getFuncParamList();
            
-        if (funcParamNameList.size() == 2) {              
-           String funcItemFirstArgName = funcParamNameList.get(0);
-           String funcItemSecondArgName = funcParamNameList.get(1);
+        if (funcParamList.size() == 2) {              
+           String funcItemFirstArgName = (funcParamList.get(0)).getParamName();
+           String funcItemSecondArgName = (funcParamList.get(1)).getParamName();
               
            ElemTemplateElement elemTemplateElement = (ElemTemplateElement)xctxt.getNamespaceContext();
            List<XMLNSDecl> prefixTable = null;
@@ -134,8 +135,8 @@ public class FuncFoldLeft extends XPathHigherOrderBuiltinFunctionsSupport {
         }
         else {
            throw new javax.xml.transform.TransformerException("XPTY0004 : An inline function definition argument to "
-                                                                    + "function fn:fold-left has " + funcParamNameList.size() + " "
-                                                                    + "parameters. Expected 2.", srcLocator); 
+                                                                                           + "function fn:fold-left has " + funcParamList.size() + " "
+                                                                                           + "parameters. Expected 2.", srcLocator); 
         }
         
         return evalResult;
diff --git a/src/org/apache/xpath/functions/FuncFoldRight.java b/src/org/apache/xpath/functions/FuncFoldRight.java
index 3852ee83..f1bcbd57 100644
--- a/src/org/apache/xpath/functions/FuncFoldRight.java
+++ b/src/org/apache/xpath/functions/FuncFoldRight.java
@@ -28,6 +28,7 @@ import org.apache.xml.utils.QName;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.objects.InlineFunction;
+import org.apache.xpath.objects.InlineFunctionParameter;
 import org.apache.xpath.objects.ResultSequence;
 import org.apache.xpath.objects.XObject;
 import org.apache.xpath.operations.Variable;
@@ -94,11 +95,11 @@ public class FuncFoldRight extends XPathHigherOrderBuiltinFunctionsSupport {
         }
                    
         String inlineFnXPathStr = foldRightThirdArg.getFuncBodyXPathExprStr();
-        List<String> funcParamNameList = foldRightThirdArg.getFuncParamNameList();
+        List<InlineFunctionParameter> funcParamList = foldRightThirdArg.getFuncParamList();
            
-        if (funcParamNameList.size() == 2) {              
-           String funcItemFirstArgName = funcParamNameList.get(0);
-           String funcItemSecondArgName = funcParamNameList.get(1);
+        if (funcParamList.size() == 2) {              
+           String funcItemFirstArgName = (funcParamList.get(0)).getParamName();
+           String funcItemSecondArgName = (funcParamList.get(1)).getParamName();
               
            ElemTemplateElement elemTemplateElement = (ElemTemplateElement)xctxt.getNamespaceContext();
            List<XMLNSDecl> prefixTable = null;
@@ -134,8 +135,8 @@ public class FuncFoldRight extends XPathHigherOrderBuiltinFunctionsSupport {
         }
         else {
             throw new javax.xml.transform.TransformerException("XPTY0004 : An inline function definition argument to "
-                                                                     + "function fn:fold-right has " + funcParamNameList.size() + " "
-                                                                     + "parameters. Expected 2.", srcLocator); 
+                                                                                            + "function fn:fold-right has " + funcParamList.size() + " "
+                                                                                            + "parameters. Expected 2.", srcLocator); 
         }
         
         return result;
diff --git a/src/org/apache/xpath/functions/FuncForEach.java b/src/org/apache/xpath/functions/FuncForEach.java
index 057a024d..163b367e 100644
--- a/src/org/apache/xpath/functions/FuncForEach.java
+++ b/src/org/apache/xpath/functions/FuncForEach.java
@@ -33,6 +33,7 @@ import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.axes.LocPathIterator;
 import org.apache.xpath.objects.InlineFunction;
+import org.apache.xpath.objects.InlineFunctionParameter;
 import org.apache.xpath.objects.ResultSequence;
 import org.apache.xpath.objects.XNodeSet;
 import org.apache.xpath.objects.XObject;
@@ -175,11 +176,11 @@ public class FuncForEach extends Function2Args {
    */
   private void validateInlineFunctionParamCardinality(InlineFunction inlineFuncArg, SourceLocator srcLocator) throws 
                                                                                                 javax.xml.transform.TransformerException {
-      List<String> funcParamNameList = inlineFuncArg.getFuncParamNameList();
-      if (funcParamNameList.size() != 1) {
+      List<InlineFunctionParameter> funcParamList = inlineFuncArg.getFuncParamList();
+      if (funcParamList.size() != 1) {
           throw new javax.xml.transform.TransformerException("XPTY0004 : The supplied function fn:for-each's function item has " + 
-                                                                                   funcParamNameList.size() + " parameters. "
-                                                                                          + "Expected 1.", srcLocator);   
+                                                                                             funcParamList.size() + " parameters. "
+                                                                                             + "Expected 1.", srcLocator);   
       }
   }
   
@@ -191,8 +192,8 @@ public class FuncForEach extends Function2Args {
                                                                                     throws TransformerException {
         ResultSequence resultSeq = new ResultSequence(); 
         
-        List<String> funcParamNameList = arg1.getFuncParamNameList();
-        QName varQname = new QName(funcParamNameList.get(0));
+        List<InlineFunctionParameter> funcParamList = arg1.getFuncParamList();
+        QName varQname = new QName((funcParamList.get(0)).getParamName());
         
         String funcBodyXPathExprStr = arg1.getFuncBodyXPathExprStr();
         
diff --git a/src/org/apache/xpath/functions/FuncForEachPair.java b/src/org/apache/xpath/functions/FuncForEachPair.java
index 885f173c..5d5d4b55 100644
--- a/src/org/apache/xpath/functions/FuncForEachPair.java
+++ b/src/org/apache/xpath/functions/FuncForEachPair.java
@@ -28,6 +28,7 @@ import org.apache.xml.utils.QName;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.objects.InlineFunction;
+import org.apache.xpath.objects.InlineFunctionParameter;
 import org.apache.xpath.objects.ResultSequence;
 import org.apache.xpath.objects.XObject;
 import org.apache.xpath.operations.Variable;
@@ -119,11 +120,11 @@ public class FuncForEachPair extends XPathHigherOrderBuiltinFunctionsSupport {
         int contextNode = xctxt.getContextNode();
         
         String inlineFnXPathStr = inlineFunc.getFuncBodyXPathExprStr();
-        List<String> funcParamNameList = inlineFunc.getFuncParamNameList();
+        List<InlineFunctionParameter> funcParamList = inlineFunc.getFuncParamList();
         
-        if (funcParamNameList.size() == 2) {                           
-            String funcItemFirstArgName = funcParamNameList.get(0);
-            String funcItemSecondArgName = funcParamNameList.get(1);
+        if (funcParamList.size() == 2) {                           
+            String funcItemFirstArgName = (funcParamList.get(0)).getParamName();
+            String funcItemSecondArgName = (funcParamList.get(1)).getParamName();
             
             ElemTemplateElement elemTemplateElement = (ElemTemplateElement)xctxt.getNamespaceContext();
             List<XMLNSDecl> prefixTable = null;
@@ -163,7 +164,7 @@ public class FuncForEachPair extends XPathHigherOrderBuiltinFunctionsSupport {
         }
         else {
             throw new javax.xml.transform.TransformerException("XPTY0004 : An inline function definition argument to "
-                                                                     + "function fn:for-each-pair has " + funcParamNameList.size() + " "
+                                                                     + "function fn:for-each-pair has " + funcParamList.size() + " "
                                                                      + "parameters. Expected 2.", srcLocator); 
         }
         
diff --git a/src/org/apache/xpath/functions/FuncSort.java b/src/org/apache/xpath/functions/FuncSort.java
index 017fa54b..0781b7ac 100644
--- a/src/org/apache/xpath/functions/FuncSort.java
+++ b/src/org/apache/xpath/functions/FuncSort.java
@@ -39,6 +39,7 @@ import org.apache.xpath.Expression;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.objects.InlineFunction;
+import org.apache.xpath.objects.InlineFunctionParameter;
 import org.apache.xpath.objects.ResultSequence;
 import org.apache.xpath.objects.XNodeSet;
 import org.apache.xpath.objects.XObject;
@@ -142,8 +143,9 @@ public class FuncSort extends FunctionMultiArgs
               if (numOfArgs == 3) {                                   
                   InlineFunction arg2InlineFunc = (InlineFunction)arg2;
                   
-                  List<String> funcParamNameList = arg2InlineFunc.getFuncParamNameList();
-                  inlineFunctionVarMap.put(new QName(funcParamNameList.get(0)), xNodeSetItem);
+                  List<InlineFunctionParameter> funcParamList = arg2InlineFunc.getFuncParamList();
+                  inlineFunctionVarMap.put(new QName((funcParamList.get(0)).getParamName()), 
+                                                                                       xNodeSetItem);
                   
                   String sortKeyXPathStr = arg2InlineFunc.getFuncBodyXPathExprStr();
                   
@@ -157,7 +159,7 @@ public class FuncSort extends FunctionMultiArgs
                   XObject sortKeyVal = sortKeyXPathExpr.execute(xctxt, nextNodeDtmHandle, xctxt.getNamespaceContext());
                   
                   // reset the function item argument reference value
-                  inlineFunctionVarMap.put(new QName(funcParamNameList.get(0)), null);
+                  inlineFunctionVarMap.put(new QName((funcParamList.get(0)).getParamName()), null);
                   
                   inpSeqItemWithSortKeyValueList.add(new InpSeqItemWithSortKeyValue(xNodeSetItem, sortKeyVal));
                }
@@ -195,8 +197,8 @@ public class FuncSort extends FunctionMultiArgs
               if (numOfArgs == 3) {                                   
                  InlineFunction arg2InlineFunc = (InlineFunction)arg2;
                  
-                 List<String> funcParamNameList = arg2InlineFunc.getFuncParamNameList();
-                 inlineFunctionVarMap.put(new QName(funcParamNameList.get(0)), inputSeqItem);
+                 List<InlineFunctionParameter> funcParamList = arg2InlineFunc.getFuncParamList();
+                 inlineFunctionVarMap.put(new QName((funcParamList.get(0)).getParamName()), inputSeqItem);
                  
                  String sortKeyXPathStr = arg2InlineFunc.getFuncBodyXPathExprStr();
                  
@@ -210,7 +212,7 @@ public class FuncSort extends FunctionMultiArgs
                  XObject sortKeyVal = sortKeyXPathExpr.execute(xctxt, xctxt.getContextNode(), xctxt.getNamespaceContext());
                  
                  // reset the function item argument reference value
-                 inlineFunctionVarMap.put(new QName(funcParamNameList.get(0)), null);
+                 inlineFunctionVarMap.put(new QName((funcParamList.get(0)).getParamName()), null);
                  
                  inpSeqItemWithSortKeyValueList.add(new InpSeqItemWithSortKeyValue(inputSeqItem, sortKeyVal));
               }
diff --git a/src/org/apache/xpath/objects/InlineFunction.java b/src/org/apache/xpath/objects/InlineFunction.java
index 9ed61fbc..1fed50e6 100644
--- a/src/org/apache/xpath/objects/InlineFunction.java
+++ b/src/org/apache/xpath/objects/InlineFunction.java
@@ -21,26 +21,14 @@ import java.util.List;
 
 import org.apache.xpath.ExpressionOwner;
 import org.apache.xpath.XPathVisitor;
+import org.apache.xpath.composite.SequenceTypeData;
 
-/*
- * The XalanJ XPath parser, creates and populates an object of this class, 
- * as a representation of XPath 3.1 function item "inline function" definition 
- * within XPath expressions.
+/**
+ * An object of this class represents, a run-time representation
+ * of XalanJ's function item "inline function expression".
  * 
- * The XPath 3.1 spec, defines function item "inline function" XPath expressions 
- * with following grammar,
- *
- *   InlineFunctionExpr        ::=  "function" "(" ParamList? ")" ("as" SequenceType)? 
- *                                                                             FunctionBody
-
- *   ParamList                 ::=   Param ("," Param)*
-
- *   Param                     ::=   "$" EQName TypeDeclaration?
-
- *   FunctionBody              ::=   EnclosedExpr
-
- *   EnclosedExpr              ::=   "{" Expr? "}"
-    
+ * Ref : https://www.w3.org/TR/xpath-31/#id-inline-func
+ *  
  * @author Mukul Gandhi <mu...@apache.org>
  *   
  * @xsl.usage advanced 
@@ -49,16 +37,18 @@ public class InlineFunction extends XObject {
 
     private static final long serialVersionUID = 9219253671212483045L;
     
-    private List<String> funcParamNameList = new ArrayList<String>();
+    private List<InlineFunctionParameter> funcParamList = new ArrayList<InlineFunctionParameter>();
     
     private String funcBodyXPathExprStr = null;
+    
+    private SequenceTypeData returnType = null;
 
-    public List<String> getFuncParamNameList() {
-        return funcParamNameList;
+    public List<InlineFunctionParameter> getFuncParamList() {
+        return funcParamList;
     }
 
-    public void setFuncParamNameList(List<String> funcParamNameList) {
-        this.funcParamNameList = funcParamNameList;
+    public void setFuncParamList(List<InlineFunctionParameter> funcParamList) {
+        this.funcParamList = funcParamList;
     }
 
     public String getFuncBodyXPathExprStr() {
@@ -69,8 +59,15 @@ public class InlineFunction extends XObject {
         this.funcBodyXPathExprStr = funcBodyXPathExprStr;
     }
     
-    public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
-    {
+    public SequenceTypeData getReturnType() {
+        return returnType;
+    }
+
+    public void setReturnType(SequenceTypeData returnType) {
+        this.returnType = returnType;
+    }
+
+    public void callVisitors(ExpressionOwner owner, XPathVisitor visitor) {
         // no op
     }
     
diff --git a/src/org/apache/xpath/objects/InlineFunctionParameter.java b/src/org/apache/xpath/objects/InlineFunctionParameter.java
new file mode 100644
index 00000000..875171eb
--- /dev/null
+++ b/src/org/apache/xpath/objects/InlineFunctionParameter.java
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+package org.apache.xpath.objects;
+
+import org.apache.xpath.composite.SequenceTypeData;
+
+/**
+ * An object of this class, represents one parameter 
+ * of an XPath "inline function expression".
+ * 
+ * @author Mukul Gandhi <mu...@apache.org>
+ *
+ * @xsl.usage advanced
+ */
+public class InlineFunctionParameter {
+    
+    private String paramName;
+    
+    private SequenceTypeData paramType;
+
+    public String getParamName() {
+        return paramName;
+    }
+
+    public void setParamName(String paramName) {
+        this.paramName = paramName;
+    }
+
+    public SequenceTypeData getParamType() {
+        return paramType;
+    }
+
+    public void setParamType(SequenceTypeData paramType) {
+        this.paramType = paramType;
+    }
+
+}
diff --git a/tests/inline_function_expr/gold/test8.out b/tests/inline_function_expr/gold/test8.out
new file mode 100644
index 00000000..da6d3d5d
--- /dev/null
+++ b/tests/inline_function_expr/gold/test8.out
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <one>6</one>
+  <two>2 3 4 5 6 7 8 9 10</two>
+</result>
diff --git a/tests/inline_function_expr/gold/test9.out b/tests/inline_function_expr/gold/test9.out
new file mode 100644
index 00000000..db07d8ce
--- /dev/null
+++ b/tests/inline_function_expr/gold/test9.out
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><result>2</result>
diff --git a/tests/inline_function_expr/test1_d.xml b/tests/inline_function_expr/test1_d.xml
new file mode 100644
index 00000000..68d9e1a8
--- /dev/null
+++ b/tests/inline_function_expr/test1_d.xml
@@ -0,0 +1,4 @@
+<info>
+  <abc>123</abc>
+  <pqr>567</pqr>
+</info>
\ No newline at end of file
diff --git a/tests/inline_function_expr/test8.xsl b/tests/inline_function_expr/test8.xsl
new file mode 100644
index 00000000..ff8c1375
--- /dev/null
+++ b/tests/inline_function_expr/test8.xsl
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                exclude-result-prefixes="xs"
+                version="3.0">
+                
+    <!-- Author: mukulg@apache.org -->
+   
+    <!-- An XSLT stylesheet test case, to test an XPath
+         "inline function expression", where the function's 
+         parameters and result have expected type specified 
+         for them. -->                 
+    
+    <xsl:output method="xml" indent="yes"/>
+    
+    <xsl:variable name="mult1" select="function($a as xs:integer, $b as xs:integer) as xs:integer { $a * $b }"/>
+    
+    <xsl:variable name="seq1" select="function($a as xs:integer, $b as xs:integer) as xs:integer+ { $a to $b }"/>
+    
+    <xsl:template match="/">       
+       <result>
+          <one>
+             <xsl:value-of select="$mult1(2, 3)"/>
+          </one>
+          <two>
+	         <xsl:value-of select="$seq1(2, 10)"/>
+          </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/inline_function_expr/test9.xsl b/tests/inline_function_expr/test9.xsl
new file mode 100644
index 00000000..64a8a8ad
--- /dev/null
+++ b/tests/inline_function_expr/test9.xsl
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                exclude-result-prefixes="xs"
+                version="3.0">
+                
+    <!-- Author: mukulg@apache.org -->
+    
+    <!-- use with test1_d.xml -->
+   
+    <!-- An XSLT stylesheet test case, to test an XPath
+         "inline function expression", where the function's 
+         parameters and result have expected type specified 
+         for them. -->                
+    
+    <xsl:output method="xml" indent="yes"/>
+    
+    <xsl:variable name="func1" select="function($nodeList as element()+) as xs:integer { count($nodeList) }"/>
+    
+    <xsl:template match="/info">       
+       <result>
+          <xsl:value-of select="$func1(*)"/>
+       </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/util/XslTransformTestsUtil.java b/tests/org/apache/xalan/util/XslTransformTestsUtil.java
index 3d77af6c..366ac7d4 100644
--- a/tests/org/apache/xalan/util/XslTransformTestsUtil.java
+++ b/tests/org/apache/xalan/util/XslTransformTestsUtil.java
@@ -89,11 +89,11 @@ public class XslTransformTestsUtil {
                List<String> trfErrorList = errHandler.getTrfErrorList();
                List<String> trfFatalErrorList = errHandler.getTrfFatalErrorList();
                if (trfErrorList.size() > 0 || trfFatalErrorList.size() > 0) {
-                   // the test has passed
+                   // The test has passed
                    return;
                }
                else {
-                   // the test has failed
+                   // The test has failed
                    Assert.fail();  
                }
            }
diff --git a/tests/org/apache/xalan/xpath3/InlineFunctionItemExprTests.java b/tests/org/apache/xalan/xpath3/InlineFunctionItemExprTests.java
index e8aabe90..c123b006 100644
--- a/tests/org/apache/xalan/xpath3/InlineFunctionItemExprTests.java
+++ b/tests/org/apache/xalan/xpath3/InlineFunctionItemExprTests.java
@@ -117,5 +117,25 @@ public class InlineFunctionItemExprTests extends XslTransformTestsUtil {
         
         runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
     }
+    
+    @Test
+    public void xslInlineFunctionExprTest8() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test8.xsl"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test8.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test8.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
+    
+    @Test
+    public void xslInlineFunctionExprTest9() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_d.xml"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test9.xsl";
+        
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test9.out";                
+        
+        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);
+    }
 
 }


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