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/08 08:25:34 UTC

[xalan-java] branch xalan-j_xslt3.0 updated: committing implementation of xslt 3.0 'as' attribute on xsl:param, xsl:with-param, xsl:template elements, along with few new related working test cases. committing as well, minor implementation enhancements and refactoring on xalanj codebase on this dev repos branch.

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 ec215a0f committing implementation of xslt 3.0 'as' attribute on xsl:param, xsl:with-param, xsl:template elements, along with few new related working test cases. committing as well, minor implementation enhancements and refactoring on xalanj codebase on this dev repos branch.
     new 5bc0fe73 Merge pull request #79 from mukulga/xalan-j_xslt3.0_mukul
ec215a0f is described below

commit ec215a0f2db6b736c8694979f3eaad5e92dfd975
Author: Mukul Gandhi <ga...@gmail.com>
AuthorDate: Fri Sep 8 13:48:58 2023 +0530

    committing implementation of xslt 3.0 'as' attribute on xsl:param, xsl:with-param, xsl:template elements, along with few new related working test cases. committing as well, minor implementation enhancements and refactoring on xalanj codebase on this dev repos branch.
---
 src/org/apache/xalan/processor/XSLTSchema.java     |   9 +-
 .../apache/xalan/templates/ElemApplyTemplates.java | 145 +++++++++++-----
 src/org/apache/xalan/templates/ElemCopyOf.java     | 187 ++++++++-------------
 src/org/apache/xalan/templates/ElemParam.java      |  86 ++++++++--
 src/org/apache/xalan/templates/ElemTemplate.java   | 150 ++++++++++++-----
 src/org/apache/xalan/templates/ElemValueOf.java    |  21 +--
 src/org/apache/xalan/templates/ElemVariable.java   |  66 +++-----
 src/org/apache/xalan/templates/ElemWithParam.java  |  42 +++--
 src/org/apache/xalan/templates/TemplateList.java   |   2 +-
 src/org/apache/xpath/composite/ForExpr.java        |   4 +-
 src/org/apache/xpath/composite/LetExpr.java        |   6 +-
 src/org/apache/xpath/composite/QuantifiedExpr.java |   4 +-
 .../xpath/composite/SequenceTypeSupport.java       |  45 +++--
 .../xpath/functions/DynamicFunctionCall.java       |   6 +-
 tests/org/apache/xalan/xslt3/AllXsl3Tests.java     |   2 +-
 ...Tests.java => XslTemplateAttributeAsTests.java} |  95 +++--------
 ...Tests.java => XslVariableAttributeAsTests.java} |  36 ++--
 .../gold/test1.out}                                |   4 +-
 .../gold/test2.out                                 |   4 +-
 .../gold/test3.out}                                |   4 +-
 .../gold/test4.out}                                |   7 +-
 .../gold/test5.out}                                |   4 +-
 tests/xsl_template_attribute_as/gold/test6.out     |  10 ++
 .../gold/test7.out}                                |   7 +-
 tests/xsl_template_attribute_as/gold/test8.out     |   5 +
 .../test1.xsl}                                     |  25 ++-
 tests/xsl_template_attribute_as/test1_a.xml        |   4 +
 .../test2.xsl}                                     |  33 ++--
 .../test3.xsl                                      |  25 ++-
 .../test4.xsl}                                     |  33 ++--
 .../test5.xsl}                                     |  19 +--
 .../test6.xsl}                                     |  25 ++-
 .../test7.xsl}                                     |  32 ++--
 .../test8.xsl}                                     |  29 ++--
 .../gold/test1.out                                 |   0
 .../gold/test10.out                                |   0
 .../gold/test11.out                                |   0
 .../gold/test12.out                                |   0
 .../gold/test2.out                                 |   0
 .../gold/test3.out                                 |   0
 .../gold/test3_1.out                               |   0
 .../gold/test4.out                                 |   0
 .../gold/test5.out                                 |   0
 .../gold/test6.out                                 |   0
 .../gold/test7.out                                 |   0
 .../gold/test8.out                                 |   0
 .../gold/test9.out                                 |   0
 .../test1.xsl                                      |   0
 .../test10.xsl                                     |   0
 .../test11.xsl                                     |   0
 .../test12.xsl                                     |   0
 .../test13.xsl                                     |   0
 .../test1_a.xml                                    |   0
 .../test1_b.xml                                    |   0
 .../test1_c.xml                                    |   0
 .../test1_d.xml                                    |   0
 .../test1_e.xml                                    |   0
 .../test2.xsl                                      |   0
 .../test3.xsl                                      |   0
 .../test4.xsl                                      |   0
 .../test5.xsl                                      |   0
 .../test6.xsl                                      |   0
 .../test7.xsl                                      |   0
 .../test8.xsl                                      |   0
 .../test9.xsl                                      |   0
 65 files changed, 676 insertions(+), 500 deletions(-)

diff --git a/src/org/apache/xalan/processor/XSLTSchema.java b/src/org/apache/xalan/processor/XSLTSchema.java
index 2e5e6f76..c6d86632 100644
--- a/src/org/apache/xalan/processor/XSLTSchema.java
+++ b/src/org/apache/xalan/processor/XSLTSchema.java
@@ -247,7 +247,7 @@ public class XSLTSchema extends XSLTElementDef
                                        XSLTAttributeDef.T_EXPR, false, false, XSLTAttributeDef.ERROR);
     
     // Optional.
-    // xsl:variable 
+    // xsl:variable, xsl:param, xsl:with-param, xsl:template 
     XSLTAttributeDef asAttrOpt = new XSLTAttributeDef(null, "as",
                                        XSLTAttributeDef.T_STRING, false, false, XSLTAttributeDef.ERROR);
 
@@ -470,7 +470,7 @@ public class XSLTSchema extends XSLTElementDef
                                     "with-param", null /*alias */,
                                     templateElements /* elements */,  // %template;>
                                     new XSLTAttributeDef[]{ nameAttrRequired,
-                                                            selectAttrOpt }, new ProcessorTemplateElem(),
+                                                            selectAttrOpt, asAttrOpt }, new ProcessorTemplateElem(),
                                                                              ElemWithParam.class /* class object */, 19, true);
     XSLTElementDef xslApplyTemplates = new XSLTElementDef(this,
                                          Constants.S_XSLNAMESPACEURL,
@@ -608,7 +608,7 @@ public class XSLTSchema extends XSLTElementDef
                                 null /*alias */,
                                 templateElements /* elements */,  // %template;>
                                 new XSLTAttributeDef[]{ nameAttrRequired,
-                                                        selectAttrOpt }, 
+                                                        selectAttrOpt, asAttrOpt }, 
                                        new ProcessorTemplateElem(),
                                 ElemParam.class /* class object */, 19, true);
     XSLTElementDef xslText =
@@ -888,7 +888,7 @@ public class XSLTSchema extends XSLTElementDef
                                            templateElements /* elements */,
                                            new XSLTAttributeDef[]{
                                                    nameAttrRequired,
-                                                   selectAttrOpt }, 
+                                                   selectAttrOpt, asAttrOpt }, 
                                            new ProcessorGlobalParamDecl(),
                                            ElemParam.class /* class object */, 20, true),
                                   new XSLTElementDef(
@@ -902,6 +902,7 @@ public class XSLTSchema extends XSLTElementDef
                                                    nameAttrOpt_ERROR,
                                                    priorityAttr,
                                                    modeAttr,
+                                                   asAttrOpt,
                                                    spaceAttr }, 
                                            new ProcessorTemplate(), ElemTemplate.class /* class object */, true, 20, true), 
                                   new XSLTElementDef(
diff --git a/src/org/apache/xalan/templates/ElemApplyTemplates.java b/src/org/apache/xalan/templates/ElemApplyTemplates.java
index 498365f6..ac1b07ca 100644
--- a/src/org/apache/xalan/templates/ElemApplyTemplates.java
+++ b/src/org/apache/xalan/templates/ElemApplyTemplates.java
@@ -22,6 +22,7 @@ package org.apache.xalan.templates;
 
 import java.util.Vector;
 
+import javax.xml.transform.SourceLocator;
 import javax.xml.transform.TransformerException;
 
 import org.apache.xalan.transformer.StackGuard;
@@ -34,28 +35,29 @@ import org.apache.xml.utils.QName;
 import org.apache.xpath.VariableStack;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
+import org.apache.xpath.composite.SequenceTypeSupport;
+import org.apache.xpath.objects.ResultSequence;
+import org.apache.xpath.objects.XNodeSet;
+import org.apache.xpath.objects.XNodeSetForDOM;
 import org.apache.xpath.objects.XObject;
+import org.apache.xpath.objects.XRTreeFrag;
+import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 
 /**
- * Implement xsl:apply-templates.
- * <pre>
- * &amp;!ELEMENT xsl:apply-templates (xsl:sort|xsl:with-param)*>
- * &amp;!ATTLIST xsl:apply-templates
- *   select %expr; "node()"
- *   mode %qname; #IMPLIED
- * &amp;
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Applying-Template-Rules">section-Applying-Template-Rules in XSLT Specification</a>
+ * Implementation of XSLT xsl:apply-templates element.
+ * 
+ * Ref : https://www.w3.org/TR/xslt-30/#element-apply-templates
+ * 
  * @xsl.usage advanced
  */
 public class ElemApplyTemplates extends ElemCallTemplate
 {
-    static final long serialVersionUID = 2903125371542621004L;
+  
+  static final long serialVersionUID = 2903125371542621004L;
 
   /**
    * mode %qname; #IMPLIED
-   * @serial
    */
   private QName m_mode = null;
 
@@ -83,8 +85,7 @@ public class ElemApplyTemplates extends ElemCallTemplate
    * Tells if this belongs to a default template,
    * in which case it will act different with
    * regard to processing modes.
-   * @see <a href="http://www.w3.org/TR/xslt#built-in-rule">built-in-rule in XSLT Specification</a>
-   * @serial
+   * 
    */
   private boolean m_isDefaultTemplate = false;
   
@@ -212,6 +213,8 @@ public class ElemApplyTemplates extends ElemCallTemplate
     boolean check = (guard.getRecursionLimit() > -1) ? true : false;
     
     boolean pushContextNodeListFlag = false;
+    
+    SourceLocator srcLocator = xctxt.getSAXLocator();
       
     try
     {
@@ -258,7 +261,16 @@ public class ElemApplyTemplates extends ElemCallTemplate
           ElemWithParam ewp = m_paramElems[i];
           if (transformer.getDebug())
             transformer.getTraceManager().fireTraceEvent(ewp);
-          XObject obj = ewp.getValue(transformer, sourceNode);
+          
+          XObject obj = null;
+          
+          try {
+             obj = ewp.getValue(transformer, sourceNode);
+          }
+          catch (TransformerException ex) {
+             throw new TransformerException(ex.getMessage(), srcLocator);   
+          }
+          
           if (transformer.getDebug())
             transformer.getTraceManager().fireTraceEndEvent(ewp);
           
@@ -298,7 +310,7 @@ public class ElemApplyTemplates extends ElemCallTemplate
 
         // If that didn't locate a node, fall back to a default template rule.
         // See http://www.w3.org/TR/xslt#built-in-rule.
-        if (null == template)
+        if (template == null)
         {
           switch (nodeType)
           {
@@ -375,33 +387,90 @@ public class ElemApplyTemplates extends ElemCallTemplate
             
           }
         }
-        else
-        	currentFrameBottom = 0;
+        else {
+           currentFrameBottom = 0;
+        }
 
-        // Fire a trace event for the template.
-        if (transformer.getDebug())
-          transformer.getTraceManager().fireTraceEvent(template);
+        if (transformer.getDebug()) {
+           transformer.getTraceManager().fireTraceEvent(template);
+        }
 
-        // And execute the child templates.
-        // Loop through the children of the template, calling execute on 
-        // each of them.
-        for (ElemTemplateElement t = template.m_firstChild; 
-             t != null; t = t.m_nextSibling)
-        {
-          xctxt.setSAXLocator(t);
-          try
-          {
-          	transformer.pushElemTemplateElement(t);
-          	t.execute(transformer);
-          }
-          finally
-          {
-          	transformer.popElemTemplateElement();
-          }
+        String templateAsAttrVal = template.getAs();
+        
+        if (templateAsAttrVal != null) {         
+            try {
+               // The code within this 'try' block, checks whether the template's result contents
+               // conform to the 'sequence type' expression specified as value of template's 
+               // 'as' attribute.
+                 
+               int dtmNodeHandle = transformer.transformToGlobalRTF(template);
+                
+               NodeList nodeList = (new XRTreeFrag(dtmNodeHandle, xctxt, template)).convertToNodeset();             
+               XObject templateEvalResultForAsAttr = new XNodeSetForDOM(nodeList, xctxt);
+               
+               templateEvalResultForAsAttr = SequenceTypeSupport.convertXDMValueToAnotherType(templateEvalResultForAsAttr, templateAsAttrVal, 
+                                                                                                                                          null, xctxt);
+               if (templateEvalResultForAsAttr != null) {
+                   SerializationHandler handler = transformer.getSerializationHandler();        
+                   
+                   try {
+                        if (templateEvalResultForAsAttr instanceof XNodeSet) {
+                           ElemCopyOf.copyOfActionOnNodeSet((XNodeSet)templateEvalResultForAsAttr, transformer, 
+                                                                                                            handler, xctxt);
+                        }
+                        else {
+                           ElemCopyOf.copyOfActionOnResultSequence((ResultSequence)templateEvalResultForAsAttr, 
+                                                                                                            transformer, handler, xctxt); 
+                        }
+                    } 
+                    catch (TransformerException ex) {
+                        throw new TransformerException(ex.getMessage(), srcLocator); 
+                    } 
+                    catch (SAXException ex) {
+                        transformer.getErrorListener().fatalError(new TransformerException(ex)); 
+                    }   
+               }
+               else {
+                   QName m_name = template.getName();
+                   String m_matchPatternStr = (template.getMatch()).getPatternString();
+                   String errTemplateStr = (m_name != null) ? m_name.toString() : m_matchPatternStr; 
+                   throw new TransformerException("XTTE0505 : The required item type of the result of template " + 
+                                                                                                           errTemplateStr + " is " + templateAsAttrVal + ". But the template "
+                                                                                                           + "result doesn't conform to this required item type.", srcLocator);  
+               }
+            }
+            catch (TransformerException ex) {
+               QName m_name = template.getName();
+               String m_matchPatternStr = (template.getMatch()).getPatternString();
+               String errTemplateStr = (m_name != null) ? m_name.toString() : m_matchPatternStr; 
+               throw new TransformerException("XTTE0505 : The required item type of the result of template " + 
+                                                                                                       errTemplateStr + " is " + templateAsAttrVal + ". But the template "
+                                                                                                       + "result doesn't conform to this required item type.", srcLocator); 
+            }  
+        }
+        else {
+            // Evaluate the child templates.
+            // Loop through the children of the template, evaluating 
+            // each of them.
+            for (ElemTemplateElement t = template.m_firstChild; 
+                                                        t != null; t = t.m_nextSibling) {
+              xctxt.setSAXLocator(t);
+              
+              try
+              {
+              	  transformer.pushElemTemplateElement(t);
+              	  t.execute(transformer);
+              }
+              finally
+              {
+              	  transformer.popElemTemplateElement();
+              }
+            }
         }
         
-        if (transformer.getDebug())
-	      transformer.getTraceManager().fireTraceEndEvent(template); 
+        if (transformer.getDebug()) {
+	      transformer.getTraceManager().fireTraceEndEvent(template);
+        }
 	    
         if(template.m_frameSize > 0)
         {
diff --git a/src/org/apache/xalan/templates/ElemCopyOf.java b/src/org/apache/xalan/templates/ElemCopyOf.java
index 160a002e..3e93bba8 100644
--- a/src/org/apache/xalan/templates/ElemCopyOf.java
+++ b/src/org/apache/xalan/templates/ElemCopyOf.java
@@ -35,28 +35,18 @@ import org.apache.xml.serializer.SerializationHandler;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.objects.ResultSequence;
+import org.apache.xpath.objects.XBoolean;
 import org.apache.xpath.objects.XNodeSet;
 import org.apache.xpath.objects.XNumber;
 import org.apache.xpath.objects.XObject;
 import org.apache.xpath.objects.XString;
-import org.apache.xpath.xs.types.XSNumericType;
-import org.apache.xpath.xs.types.XSString;
-import org.apache.xpath.xs.types.XSUntyped;
-import org.apache.xpath.xs.types.XSUntypedAtomic;
+import org.apache.xpath.xs.types.XSAnyAtomicType;
 import org.xml.sax.SAXException;
 
 /**
  * Implementation of XSLT xsl:copy-of instruction.
  * 
- * XSLT 3.0 spec, provides following definition of xsl:copy-of
- * instruction,
- *  
- * <xsl:copy-of
-          select = expression
-          copy-accumulators? = boolean
-          copy-namespaces? = boolean
-          type? = eqname
-          validation? = "strict" | "lax" | "preserve" | "strip" />
+ * Ref : https://www.w3.org/TR/xslt-30/#element-copy-of
  * 
  * @xsl.usage advanced
  */
@@ -81,7 +71,7 @@ public class ElemCopyOf extends ElemTemplateElement
   private Vector fVars;    
   private int fGlobalsSize;
   
-  private final char SPACE_CHAR = ' ';
+  private final static char SPACE_CHAR = ' ';
 
   /**
    * Set the "select" attribute.
@@ -176,66 +166,58 @@ public class ElemCopyOf extends ElemTemplateElement
       
       XObject xpath3ContextItem = xctxt.getXPath3ContextItem();
       if (m_isDot && (xpath3ContextItem != null)) {
-         value = xpath3ContextItem;  
+          value = xpath3ContextItem;  
       }
       else {
-         value = m_selectExpression.execute(xctxt, sourceNode, this);
+          value = m_selectExpression.execute(xctxt, sourceNode, this);
       }
 
-      if (transformer.getDebug())
+      if (transformer.getDebug()) {
         transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
                                                         "select", m_selectExpression, value);
+      }
 
       SerializationHandler handler = transformer.getSerializationHandler();
 
       if (value != null) {
-        int type = value.getType();
-        String str;
-
-        switch (type)
-        {
-        case XObject.CLASS_BOOLEAN :
-        case XObject.CLASS_NUMBER :
-        case XObject.CLASS_STRING :
-          str = value.str();
-
-          handler.characters(str.toCharArray(), 0, str.length());
-          break;            
-        case XObject.CLASS_NODESET :          
-          copyOfActionOnNodeSet((XNodeSet)value, transformer, handler, xctxt);          
-          break;
-        case XObject.CLASS_RTREEFRAG :
-          SerializerUtils.outputResultTreeFragment(
-                                                handler, value, transformer.getXPathContext());
-          break;
-        case XObject.CLASS_RESULT_SEQUENCE :
-          // added for XSLT 3.0          
-          ResultSequence resultSequence = (ResultSequence)value;
-          
-          copyOfActionOnResultSequence(resultSequence, transformer, handler, xctxt);          
-          break;
-        default :          
-          str = value.str();
-          handler.characters(str.toCharArray(), 0, str.length());
-          
-          break;
-        }
-        
-        if (value instanceof XSNumericType) {
-           str = ((XSNumericType)value).stringValue();
-           handler.characters(str.toCharArray(), 0, str.length());
-        }
+            int xObjectType = value.getType();
+            String strVal = null;
+    
+            switch (xObjectType) {           
+                case XObject.CLASS_NODESET :          
+                  copyOfActionOnNodeSet((XNodeSet)value, transformer, handler, xctxt);          
+                  break;
+                case XObject.CLASS_RTREEFRAG :
+                  SerializerUtils.outputResultTreeFragment(
+                                                        handler, value, transformer.getXPathContext());
+                  break;
+                case XObject.CLASS_RESULT_SEQUENCE :         
+                  ResultSequence resultSequence = (ResultSequence)value;          
+                  copyOfActionOnResultSequence(resultSequence, transformer, handler, xctxt);          
+                  break;
+                default :
+                  // no op
+            }
+            
+            if ((value instanceof XBoolean) || (value instanceof XNumber) || 
+                                                                      (value instanceof XString)) {
+                strVal = value.str();
+                handler.characters(strVal.toCharArray(), 0, strVal.length());
+            }
+            else if (value instanceof XSAnyAtomicType) {
+                strVal = ((XSAnyAtomicType)value).stringValue();
+                handler.characters(strVal.toCharArray(), 0, strVal.length());
+            }
       }
 
     }
-    catch(org.xml.sax.SAXException se)
-    {
-      throw new TransformerException(se);
+    catch(org.xml.sax.SAXException se) {
+        throw new TransformerException(se);
     }
-    finally
-    {
-      if (transformer.getDebug())
-        transformer.getTraceManager().fireTraceEndEvent(this);
+    finally {
+      if (transformer.getDebug()) {
+         transformer.getTraceManager().fireTraceEndEvent(this);
+      }
     }
 
   }
@@ -252,9 +234,7 @@ public class ElemCopyOf extends ElemTemplateElement
 
     error(XSLTErrorResources.ER_CANNOT_ADD,
           new Object[]{ newChild.getNodeName(),
-                        this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
-
-    //" to " + this.m_elemName);
+                        this.getNodeName() });
     return null;
   }
   
@@ -264,17 +244,19 @@ public class ElemCopyOf extends ElemTemplateElement
    */
   protected void callChildVisitors(XSLTVisitor visitor, boolean callAttrs)
   {
-  	if(callAttrs)
-  		m_selectExpression.getExpression().callVisitors(m_selectExpression, visitor);
+  	if (callAttrs) {
+  	   m_selectExpression.getExpression().callVisitors(m_selectExpression, visitor);
+  	}
+  	
     super.callChildVisitors(visitor, callAttrs);
   }
   
   /**
    *  Method to perform xsl:copy-of instruction's action, on an XNodeSet object.
    */
-  private void copyOfActionOnNodeSet(XNodeSet nodeSet, TransformerImpl transformer, 
-                                                               SerializationHandler serializationHandler, XPathContext xctxt) 
-                                                                                          throws TransformerException, SAXException {
+  public static void copyOfActionOnNodeSet(XNodeSet nodeSet, TransformerImpl transformer, 
+                                                                      SerializationHandler serializationHandler, XPathContext xctxt) 
+                                                                               throws TransformerException, SAXException {
       DTMIterator dtmIter = nodeSet.iter();
 
       DTMTreeWalker tw = new TreeWalker2Result(transformer, serializationHandler);
@@ -282,19 +264,19 @@ public class ElemCopyOf extends ElemTemplateElement
 
       while ((pos = dtmIter.nextNode()) != DTM.NULL) {
           DTM dtm = xctxt.getDTMManager().getDTM(pos);
-          short t = dtm.getNodeType(pos);
+          short nodeType = dtm.getNodeType(pos);
 
-          if (t == DTM.DOCUMENT_NODE) {
+          if (nodeType == DTM.DOCUMENT_NODE) {
              for (int child = dtm.getFirstChild(pos); child != DTM.NULL; 
                       child = dtm.getNextSibling(child)) {
-                tw.traverse(child);
+                 tw.traverse(child);
              }
           }
-          else if (t == DTM.ATTRIBUTE_NODE) {
-             SerializerUtils.addAttribute(serializationHandler, pos);
+          else if (nodeType == DTM.ATTRIBUTE_NODE) {
+              SerializerUtils.addAttribute(serializationHandler, pos);
           }
           else {
-             tw.traverse(pos);
+              tw.traverse(pos);
           }
       } 
   }
@@ -302,59 +284,36 @@ public class ElemCopyOf extends ElemTemplateElement
   /**
    * Method to perform xsl:copy-of instruction's action, on an ResultSequence object.
    */
-  private void copyOfActionOnResultSequence(ResultSequence resultSequence, TransformerImpl transformer, 
+  public static void copyOfActionOnResultSequence(ResultSequence resultSequence, TransformerImpl transformer, 
                                                                       SerializationHandler serializationHandler, 
                                                                                        XPathContext xctxt) throws TransformerException, SAXException {
       char[] spaceCharArr = new char[1];      
       spaceCharArr[0] = SPACE_CHAR;
       
+      String strVal = null;
+      
       for (int idx = 0; idx < resultSequence.size(); idx++) {             
-         XObject sequenceItem = resultSequence.item(idx);
+         XObject xdmItem = resultSequence.item(idx);
          
-         if (sequenceItem instanceof XString) {
-             String str = sequenceItem.str();
-             serializationHandler.characters(str.toCharArray(), 0, str.length());
-             if (idx < (resultSequence.size() - 1)) {                     
-                serializationHandler.characters(spaceCharArr, 0, 1);
-             }
-         }
-         else if (sequenceItem instanceof XSString) {
-             String str = ((XSString)sequenceItem).stringValue();
-             serializationHandler.characters(str.toCharArray(), 0, str.length());
+         if ((xdmItem instanceof XBoolean) || (xdmItem instanceof XNumber) || (xdmItem instanceof XString)) {
+             strVal = xdmItem.str();
+             serializationHandler.characters(strVal.toCharArray(), 0, strVal.length());
              if (idx < (resultSequence.size() - 1)) {                     
                 serializationHandler.characters(spaceCharArr, 0, 1);
              }
          }
-         else if (sequenceItem.getType() == XObject.CLASS_NUMBER) {
-             String str = ((XNumber)sequenceItem).str();
-             serializationHandler.characters(str.toCharArray(), 0, str.length());
-             if (idx < (resultSequence.size() - 1)) {                     
-                serializationHandler.characters(spaceCharArr, 0, 1);
-             }
-         }
-         else if (sequenceItem instanceof XSNumericType) {
-             String str = ((XSNumericType)sequenceItem).stringValue();
-             serializationHandler.characters(str.toCharArray(), 0, str.length());
-             if (idx < (resultSequence.size() - 1)) {                     
-                serializationHandler.characters(spaceCharArr, 0, 1);
-             }
+         else if (xdmItem instanceof XSAnyAtomicType) {
+            strVal = ((XSAnyAtomicType)xdmItem).stringValue();
+            serializationHandler.characters(strVal.toCharArray(), 0, strVal.length());
+            if (idx < (resultSequence.size() - 1)) {                     
+               serializationHandler.characters(spaceCharArr, 0, 1);
+            }
          }
-         else if (sequenceItem instanceof XSUntyped) {
-             String str = ((XSUntyped)sequenceItem).stringValue();
-             serializationHandler.characters(str.toCharArray(), 0, str.length());
-             if (idx < (resultSequence.size() - 1)) {                     
-                serializationHandler.characters(spaceCharArr, 0, 1);
-             }
-         }
-         else if (sequenceItem instanceof XSUntypedAtomic) {
-             String str = ((XSUntypedAtomic)sequenceItem).stringValue();
-             serializationHandler.characters(str.toCharArray(), 0, str.length());
-             if (idx < (resultSequence.size() - 1)) {                     
-                serializationHandler.characters(spaceCharArr, 0, 1);
-             } 
+         else if (xdmItem.getType() == XObject.CLASS_NODESET) {                 
+             copyOfActionOnNodeSet((XNodeSet)xdmItem, transformer, serializationHandler, xctxt);
          }
-         else if (sequenceItem.getType() == XObject.CLASS_NODESET) {                 
-             copyOfActionOnNodeSet((XNodeSet)sequenceItem, transformer, serializationHandler, xctxt);
+         else if (xdmItem.getType() == XObject.CLASS_RESULT_SEQUENCE) {                 
+             copyOfActionOnResultSequence((ResultSequence)xdmItem, transformer, serializationHandler, xctxt);
          }
       } 
   }
diff --git a/src/org/apache/xalan/templates/ElemParam.java b/src/org/apache/xalan/templates/ElemParam.java
index c0a4038e..bf4033ca 100644
--- a/src/org/apache/xalan/templates/ElemParam.java
+++ b/src/org/apache/xalan/templates/ElemParam.java
@@ -20,27 +20,27 @@
  */
 package org.apache.xalan.templates;
 
+import javax.xml.transform.SourceLocator;
 import javax.xml.transform.TransformerException;
 
 import org.apache.xalan.transformer.TransformerImpl;
 import org.apache.xpath.VariableStack;
+import org.apache.xpath.XPathContext;
+import org.apache.xpath.composite.SequenceTypeSupport;
 import org.apache.xpath.objects.XObject;
 
 /**
- * Implement xsl:param.
- * <pre>
- * <!ELEMENT xsl:param %template;>
- * <!ATTLIST xsl:param
- *   name %qname; #REQUIRED
- *   select %expr; #IMPLIED
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#variables">variables in XSLT Specification</a>
+ * Implementation of XSLT xsl:param element.
+ * 
+ * Ref : https://www.w3.org/TR/xslt-30/#element-param
+ * 
  * @xsl.usage advanced
  */
 public class ElemParam extends ElemVariable
 {
-    static final long serialVersionUID = -1131781475589006431L;
+  
+  static final long serialVersionUID = -1131781475589006431L;
+  
   int m_qnameID;
 
   /**
@@ -113,15 +113,65 @@ public class ElemParam extends ElemVariable
       
     VariableStack vars = transformer.getXPathContext().getVarStack();
     
-    if(!vars.isLocalSet(m_index))
-    {
-
-      int sourceNode = transformer.getXPathContext().getCurrentNode();
-      XObject var = getValue(transformer, sourceNode);
-  
-      // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var);
-      transformer.getXPathContext().getVarStack().setLocalVariable(m_index, var);
+    XPathContext xctx = transformer.getXPathContext();
+    
+    SourceLocator srcLocator = xctx.getSAXLocator();
+    
+    String asAttrVal = getAs();
+    
+    if(!vars.isLocalSet(m_index)) {
+        // The caller of this stylesheet callable component, didn't provide the 
+        // parameter value via xsl:with-param instruction.
+        
+        // We'll determine the parameter's value by evaluating either the parameter's
+        // 'select' attribute, or the contained sequence constructor within xsl:param 
+        // element.
+        
+        int sourceNode = transformer.getXPathContext().getCurrentNode();
+        
+        try {
+           XObject var = getValue(transformer, sourceNode);
+           if (var == null) {
+              throw new TransformerException("XTTE0590 : The value to parameter " + m_qname.toString() + " cannot be assigned. "
+                                                                             + "Either an input content for parameter is not available within "
+                                                                             + "stylesheet context, or parameter's value cannot be cast to an expected type.", srcLocator);  
+           }
+           
+           transformer.getXPathContext().getVarStack().setLocalVariable(m_index, var);
+        }
+        catch (TransformerException ex) {
+            throw new TransformerException("XTTE0590 : The value to parameter " + m_qname.toString() + " cannot be assigned. "
+                                                                           + "Either an input content for parameter is not available within "
+                                                                           + "stylesheet context, or parameter's value cannot be cast to an expected type.", srcLocator);   
+        }
     }
+    else {
+        // The caller of this stylesheet callable component, has provided the 
+        // parameter's value via xsl:with-param instruction.
+        
+        // If the xsl:param instruction has 'as' attribute, we'll check below
+        // whether the parameter's value conforms to the sequence type specified by
+        // xsl:param's 'as' attribute.
+        
+        if (asAttrVal != null) {
+          try {
+             XObject var = transformer.getXPathContext().getVarStack().getLocalVariable(xctx, m_index);
+             var = SequenceTypeSupport.convertXDMValueToAnotherType(var, asAttrVal, null, 
+                                                                               transformer.getXPathContext());
+             if (var == null) {
+                throw new TransformerException("XTTE0590 : The required item type of the value of parameter " + 
+                                                                               m_qname.toString() + " is " + asAttrVal + ". The supplied value "
+                                                                               + "doesn't match the expected item type.", srcLocator);  
+             }
+          }
+          catch (TransformerException ex) {
+             throw new TransformerException("XTTE0590 : The required item type of the value of parameter " + 
+                                                                               m_qname.toString() + " is " + asAttrVal + ". The supplied value "
+                                                                               + "doesn't match the expected item type.", srcLocator); 
+          }
+       }
+    }
+    
     
     if (transformer.getDebug())
       transformer.getTraceManager().fireTraceEndEvent(this);
diff --git a/src/org/apache/xalan/templates/ElemTemplate.java b/src/org/apache/xalan/templates/ElemTemplate.java
index 5add0aa3..4411745a 100644
--- a/src/org/apache/xalan/templates/ElemTemplate.java
+++ b/src/org/apache/xalan/templates/ElemTemplate.java
@@ -24,40 +24,39 @@ import javax.xml.transform.SourceLocator;
 import javax.xml.transform.TransformerException;
 
 import org.apache.xalan.transformer.TransformerImpl;
+import org.apache.xml.serializer.SerializationHandler;
 import org.apache.xml.utils.QName;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
+import org.apache.xpath.composite.SequenceTypeSupport;
+import org.apache.xpath.objects.ResultSequence;
+import org.apache.xpath.objects.XNodeSet;
+import org.apache.xpath.objects.XNodeSetForDOM;
+import org.apache.xpath.objects.XObject;
+import org.apache.xpath.objects.XRTreeFrag;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
 
 /**
- * Implement xsl:template.
- * <pre>
- * <!ELEMENT xsl:template
- *  (#PCDATA
- *   %instructions;
- *   %result-elements;
- *   | xsl:param)
- * >
- *
- * <!ATTLIST xsl:template
- *   match %pattern; #IMPLIED
- *   name %qname; #IMPLIED
- *   priority %priority; #IMPLIED
- *   mode %qname; #IMPLIED
- *   %space-att;
- * >
- * </pre>
- * @see <a href="http://www.w3.org/TR/xslt#section-Defining-Template-Rules">section-Defining-Template-Rules in XSLT Specification</a>
+ * Implementation of XSLT xsl:template element.
+ * 
+ * Ref : https://www.w3.org/TR/xslt-30/#element-template
+ * 
  * @xsl.usage advanced
  */
 public class ElemTemplate extends ElemTemplateElement
 {
-    static final long serialVersionUID = -5283056789965384058L;
-  /** The public identifier for the current document event.
-   *  @serial          */
+  
+  static final long serialVersionUID = -5283056789965384058L;
+  
+  /** 
+   * The public identifier for the current document event.
+   */
   private String m_publicId;
 
-  /** The system identifier for the current document event.
-   *  @serial          */
+  /** 
+   * The system identifier for the current document event.
+   */
   private String m_systemId;
 
   /**
@@ -257,6 +256,26 @@ public class ElemTemplate extends ElemTemplateElement
   {
     return m_mode;
   }
+  
+  /**
+   * The value of the "as" attribute.
+   */
+  private String m_asAttr;
+  
+  /**
+   * Set the "as" attribute.
+   */
+  public void setAs(String val) {
+     m_asAttr = val;
+  }
+  
+  /**
+   * Get the "as" attribute.
+   */
+  public String getAs()
+  {
+     return m_asAttr;
+  }
 
   /**
    * The priority of a template rule is specified by the priority
@@ -375,39 +394,80 @@ public class ElemTemplate extends ElemTemplateElement
    *
    * @throws TransformerException
    */
-  public void execute(
-          TransformerImpl transformer)
-            throws TransformerException
-  {
+  public void execute(TransformerImpl transformer) throws TransformerException {
+    
     XPathContext xctxt = transformer.getXPathContext();
     
+    SourceLocator srcLocator = xctxt.getSAXLocator();
+    
     transformer.getStackGuard().checkForInfinateLoop();
     
     xctxt.pushRTFContext();
 
-    if (transformer.getDebug())
+    if (transformer.getDebug()) {
       transformer.getTraceManager().fireTraceEvent(this);
+    }
 
-      // %REVIEW% commenting out of the code below.
-//    if (null != sourceNode)
-//    {
-      transformer.executeChildTemplates(this, true);
-//    }
-//    else  // if(null == sourceNode)
-//    {
-//      transformer.getMsgMgr().error(this,
-//        this, sourceNode,
-//        XSLTErrorResources.ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES);
-//
-//      //"sourceNode is null in handleApplyTemplatesInstruction!");
-//    }
-
-    if (transformer.getDebug())
-      transformer.getTraceManager().fireTraceEndEvent(this);
+    XObject templateEvalResultForAsAttr = null;
+    
+    if (m_asAttr != null) {         
+        try {
+           // The code within this 'try' block, checks whether the template's result contents
+           // conform to the 'sequence type' expression specified as value of template's 
+           // 'as' attribute.
+             
+           int dtmNodeHandle = transformer.transformToGlobalRTF(this);
+            
+           NodeList nodeList = (new XRTreeFrag(dtmNodeHandle, xctxt, this)).convertToNodeset();             
+           templateEvalResultForAsAttr = new XNodeSetForDOM(nodeList, xctxt);
+           templateEvalResultForAsAttr = SequenceTypeSupport.convertXDMValueToAnotherType(templateEvalResultForAsAttr, m_asAttr, 
+                                                                                                                   null, xctxt);
+           if (templateEvalResultForAsAttr == null) {
+              String errTemplateStr = (m_name != null) ? m_name.toString() : m_matchPattern.getPatternString(); 
+              throw new TransformerException("XTTE0505 : The required item type of the result of template " + 
+                                                                                     errTemplateStr + " is " + m_asAttr + ". But the template result "
+                                                                                     + "doesn't conform to this required item type.", srcLocator);   
+           }
+        }
+        catch (TransformerException ex) {
+           String errTemplateStr = (m_name != null) ? m_name.toString() : m_matchPattern.getPatternString(); 
+           throw new TransformerException("XTTE0505 : The required item type of the result of template " + 
+                                                                                  errTemplateStr + " is " + m_asAttr + ". But the template result "
+                                                                                  + "doesn't conform to this required item type.", srcLocator); 
+        }
+    }
+    
+    if (templateEvalResultForAsAttr != null) {        
+        SerializationHandler handler = transformer.getSerializationHandler();        
+        
+        try {
+            if (templateEvalResultForAsAttr instanceof XNodeSet) {
+               ElemCopyOf.copyOfActionOnNodeSet((XNodeSet)templateEvalResultForAsAttr, transformer, 
+                                                                                                handler, xctxt);
+            }
+            else {
+               ElemCopyOf.copyOfActionOnResultSequence((ResultSequence)templateEvalResultForAsAttr, 
+                                                                                                transformer, handler, xctxt); 
+            }
+        } 
+        catch (TransformerException ex) {
+            throw new TransformerException(ex.getMessage(), srcLocator); 
+        } 
+        catch (SAXException ex) {
+            transformer.getErrorListener().fatalError(new TransformerException(ex)); 
+        }  
+    }
+    else {
+       transformer.executeChildTemplates(this, true);
+    }
 
-    xctxt.popRTFContext();  
+    if (transformer.getDebug()) {
+       transformer.getTraceManager().fireTraceEndEvent(this);
     }
 
+    xctxt.popRTFContext();  
+  }
+
   /**
    * This function is called during recomposition to
    * control how this element is composed.
diff --git a/src/org/apache/xalan/templates/ElemValueOf.java b/src/org/apache/xalan/templates/ElemValueOf.java
index 8614c64d..a89ab45f 100644
--- a/src/org/apache/xalan/templates/ElemValueOf.java
+++ b/src/org/apache/xalan/templates/ElemValueOf.java
@@ -33,6 +33,7 @@ import org.apache.xpath.Expression;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
 import org.apache.xpath.axes.LocPathIterator;
+import org.apache.xpath.composite.IfExpr;
 import org.apache.xpath.composite.LetExpr;
 import org.apache.xpath.functions.DynamicFunctionCall;
 import org.apache.xpath.functions.FuncExtFunction;
@@ -50,17 +51,9 @@ import org.w3c.dom.DOMException;
 import org.xml.sax.SAXException;
 
 /**
- * Implementation of XSLT 3.0 xsl:value-of element.
+ * Implementation of XSLT xsl:value-of element.
  * 
-    <xsl:value-of
-       select? = expression
-       separator? = { string }
-       [disable-output-escaping]? = boolean >
-          <!-- Content: sequence-constructor -->
-    </xsl:value-of>
- * 
- * Within a sequence constructor, the xsl:value-of instruction may be 
- * used to generate text nodes.
+ * Ref : https://www.w3.org/TR/xslt-30/#element-value-of
  * 
  * @xsl.usage advanced
  */
@@ -522,6 +515,14 @@ public class ElemValueOf extends ElemTemplateElement {
                      
                      (new XString(strValue)).dispatchCharactersEvents(rth);
                   }
+                  else if (expr instanceof IfExpr) {
+                      IfExpr ifExpr = (IfExpr)expr;
+                       
+                      XObject evalResult = ifExpr.execute(xctxt);                     
+                      String strValue = XslTransformEvaluationHelper.getStrVal(evalResult);
+                      
+                      (new XString(strValue)).dispatchCharactersEvents(rth);
+                  }
                   else {
                      expr.executeCharsToContentHandler(xctxt, rth);
                   }
diff --git a/src/org/apache/xalan/templates/ElemVariable.java b/src/org/apache/xalan/templates/ElemVariable.java
index c624ddfa..a23d480f 100644
--- a/src/org/apache/xalan/templates/ElemVariable.java
+++ b/src/org/apache/xalan/templates/ElemVariable.java
@@ -55,25 +55,16 @@ import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 
 /**
- * Implementation of XSLT 3.0 xsl:variable element.
+ * Implementation of XSLT xsl:variable element.
  * 
-    <xsl:variable
-          name = eqname
-          select? = expression
-          as? = sequence-type
-          static? = boolean
-          visibility? = "public" | "private" | "final" | "abstract" >
-          <!-- Content: sequence-constructor -->
-    </xsl:variable>
-       
-    The value of an XSLT 3.0 variable, is calculated using an expression provided
-    within the "select" attribute or the contained sequence constructor.
+ * Ref : https://www.w3.org/TR/xslt-30/#element-variable
  *
  * @xsl.usage advanced
  */
 public class ElemVariable extends ElemTemplateElement
 {
-    static final long serialVersionUID = 9111131075322790061L;
+  
+  static final long serialVersionUID = 9111131075322790061L;
 
   /**
    * Constructor ElemVariable
@@ -154,26 +145,6 @@ public class ElemVariable extends ElemTemplateElement
   {
     return m_selectPattern;
   }
-  
-  /**
-   * The value of the "as" attribute.
-   */
-  private String m_asAttr;
-  
-  /**
-   * Set the "as" attribute.
-   */
-  public void setAs(String val) {
-     m_asAttr = val;
-  }
-  
-  /**
-   * Get the "as" attribute.
-   */
-  public String getAs()
-  {
-     return m_asAttr;
-  }
 
   /**
    * The value of the "name" attribute.
@@ -210,6 +181,26 @@ public class ElemVariable extends ElemTemplateElement
   {
     return m_qname;
   }
+  
+  /**
+   * The value of the "as" attribute.
+   */
+  private String m_asAttr;
+  
+  /**
+   * Set the "as" attribute.
+   */
+  public void setAs(String val) {
+     m_asAttr = val;
+  }
+  
+  /**
+   * Get the "as" attribute.
+   */
+  public String getAs()
+  {
+     return m_asAttr;
+  }
 
   /**
    * Tells if this is a top-level variable or param, or not.
@@ -542,24 +533,17 @@ public class ElemVariable extends ElemTemplateElement
          var = XString.EMPTYSTRING;
       }
       else {
-        // Use result tree fragment.
-        // Global variables may be deferred (see XUnresolvedVariable) and hence
-        // need to be assigned to a different set of DTMs than local variables
-        // so they aren't popped off the stack on return from a template.
         int df;
 
 		try {
-			//////////xctxt.getVarStack().link(0);
 			if(m_parentNode instanceof Stylesheet) // Global variable
 				df = transformer.transformToGlobalRTF(this);
 			else
 				df = transformer.transformToRTF(this);
     	}
 		finally { 
-		   //////////////xctxt.getVarStack().unlink(); 
+		    // no op
 	    }
-
-        // var = new XRTreeFrag(df, xctxt, this);
 		
 		// With XSLT 3.0, RTFs are treated as proper node sets
 		NodeList nodeList = (new XRTreeFrag(df, xctxt, this)).convertToNodeset();		
diff --git a/src/org/apache/xalan/templates/ElemWithParam.java b/src/org/apache/xalan/templates/ElemWithParam.java
index 67d72803..9fe73426 100644
--- a/src/org/apache/xalan/templates/ElemWithParam.java
+++ b/src/org/apache/xalan/templates/ElemWithParam.java
@@ -27,6 +27,7 @@ import org.apache.xalan.transformer.TransformerImpl;
 import org.apache.xml.utils.QName;
 import org.apache.xpath.XPath;
 import org.apache.xpath.XPathContext;
+import org.apache.xpath.composite.SequenceTypeSupport;
 import org.apache.xpath.objects.XNodeSetForDOM;
 import org.apache.xpath.objects.XObject;
 import org.apache.xpath.objects.XRTreeFrag;
@@ -34,21 +35,17 @@ import org.apache.xpath.objects.XString;
 import org.w3c.dom.NodeList;
 
 /**
- * Implement xsl:with-param.  xsl:with-param is allowed within
- * both xsl:call-template and xsl:apply-templates.
- * <pre>
- * <!ELEMENT xsl:with-param %template;>
- * <!ATTLIST xsl:with-param
- *   name %qname; #REQUIRED
- *   select %expr; #IMPLIED
- * >
- * </pre>
+ * Implementation of XSLT xsl:with-param element.
+ * 
+ * Ref : https://www.w3.org/TR/xslt-30/#element-with-param
  * 
  * @xsl.usage advanced
  */
 public class ElemWithParam extends ElemTemplateElement
 {
-    static final long serialVersionUID = -1070355175864326257L;
+  
+  static final long serialVersionUID = -1070355175864326257L;
+  
   /**
    * This is the index to the stack frame being called, <emph>not</emph> the 
    * stack frame that contains this element.
@@ -129,6 +126,26 @@ public class ElemWithParam extends ElemTemplateElement
   {
     return m_qname;
   }
+  
+  /**
+   * The value of the "as" attribute.
+   */
+  private String m_asAttr;
+  
+  /**
+   * Set the "as" attribute.
+   */
+  public void setAs(String val) {
+     m_asAttr = val;
+  }
+  
+  /**
+   * Get the "as" attribute.
+   */
+  public String getAs()
+  {
+     return m_asAttr;
+  }
 
   /**
    * Get an integer representation of the element type.
@@ -248,6 +265,11 @@ public class ElemWithParam extends ElemTemplateElement
     {
       xctxt.popCurrentNode();
     }
+    
+    if (m_asAttr != null) {
+       var = SequenceTypeSupport.convertXDMValueToAnotherType(var, m_asAttr, null, 
+                                                                          transformer.getXPathContext()); 
+    }
 
     return var;
   }
diff --git a/src/org/apache/xalan/templates/TemplateList.java b/src/org/apache/xalan/templates/TemplateList.java
index 19d962ac..5d3da814 100644
--- a/src/org/apache/xalan/templates/TemplateList.java
+++ b/src/org/apache/xalan/templates/TemplateList.java
@@ -472,7 +472,7 @@ public class TemplateList implements java.io.Serializable
   /**
    * Given a target element, find the template that best
    * matches in the given XSL document, according
-   * to the rules specified in the xsl draft.  This variation of getTemplate 
+   * to the rules specified within XSLT 3.0 spec. This variation of getTemplate 
    * assumes the current node and current expression node have already been 
    * pushed. 
    *
diff --git a/src/org/apache/xpath/composite/ForExpr.java b/src/org/apache/xpath/composite/ForExpr.java
index 5feb5ebe..cfd6cfd8 100644
--- a/src/org/apache/xpath/composite/ForExpr.java
+++ b/src/org/apache/xpath/composite/ForExpr.java
@@ -149,8 +149,6 @@ public class ForExpr extends Expression {
         
         int contextNode = xctxt.getContextNode();
         
-        Map<QName, XObject> forExprVarBindingMap = xctxt.getXPathVarMap();
-        
         if (listIter.hasNext()) {           
            ForQuantifiedExprVarBinding forExprVarBinding = (ForQuantifiedExprVarBinding)listIter.next();            
             
@@ -208,6 +206,8 @@ public class ForExpr extends Expression {
                return resultSeq;    
            }
            
+           Map<QName, XObject> forExprVarBindingMap = xctxt.getXPathVarMap();
+           
            // For each xdm item within sequence object 'xsObjResultSeq' (which is the 
            // result of variable binding xpath expression's evaluation), bind the 'for' 
            // expression's binding variable in turn to that item.
diff --git a/src/org/apache/xpath/composite/LetExpr.java b/src/org/apache/xpath/composite/LetExpr.java
index 3861303e..331a065e 100644
--- a/src/org/apache/xpath/composite/LetExpr.java
+++ b/src/org/apache/xpath/composite/LetExpr.java
@@ -88,7 +88,7 @@ public class LetExpr extends Expression {
           prefixTable = (List<XMLNSDecl>)elemTemplateElement.getPrefixTable();
        }
        
-       Map<QName, XObject> letExprVarBindingMap = new HashMap<QName, XObject>();
+       Map<QName, XObject> letExprVarBackupMap = new HashMap<QName, XObject>();
        
        for (int idx = 0; idx < fLetExprVarBindingList.size(); idx++) {          
           LetExprVarBinding letExprVarBinding = fLetExprVarBindingList.get(idx);
@@ -111,12 +111,12 @@ public class LetExpr extends Expression {
           
           m_xpathVarList.add(new QName(varName));
           
-          letExprVarBindingMap.put(new QName(varName), varBindingEvalResult);
+          letExprVarBackupMap.put(new QName(varName), varBindingEvalResult);
        }
        
        Map<QName, XObject> xpathVarMap = xctxt.getXPathVarMap();
        
-       xpathVarMap.putAll(letExprVarBindingMap);
+       xpathVarMap.putAll(letExprVarBackupMap);
        
        if (prefixTable != null) {
           fReturnExprXPathStr = XslTransformEvaluationHelper.replaceNsUrisWithPrefixesOnXPathStr(
diff --git a/src/org/apache/xpath/composite/QuantifiedExpr.java b/src/org/apache/xpath/composite/QuantifiedExpr.java
index 74d73ce3..27c44d5f 100644
--- a/src/org/apache/xpath/composite/QuantifiedExpr.java
+++ b/src/org/apache/xpath/composite/QuantifiedExpr.java
@@ -193,8 +193,6 @@ public class QuantifiedExpr extends Expression {
         
         int contextNode = xctxt.getContextNode();
         
-        Map<QName, XObject> quantifiedExprVarBindingMap = xctxt.getXPathVarMap();
-        
         ElemTemplateElement elemTemplateElement = (ElemTemplateElement)xctxt.getNamespaceContext();
         List<XMLNSDecl> prefixTable = null;
         if (elemTemplateElement != null) {
@@ -251,6 +249,8 @@ public class QuantifiedExpr extends Expression {
                return resultSeq;    
            }
            
+           Map<QName, XObject> quantifiedExprVarBindingMap = xctxt.getXPathVarMap();
+           
            // For each xdm item within sequence object 'xsObjResultSeq' (which is the 
            // result of variable binding xpath expression's evaluation), bind the 
            // quantifier expression's binding variable in turn to that item.
diff --git a/src/org/apache/xpath/composite/SequenceTypeSupport.java b/src/org/apache/xpath/composite/SequenceTypeSupport.java
index ed7b8bc9..aff43d16 100644
--- a/src/org/apache/xpath/composite/SequenceTypeSupport.java
+++ b/src/org/apache/xpath/composite/SequenceTypeSupport.java
@@ -372,8 +372,8 @@ public class SequenceTypeSupport {
             }
             else if (srcValue instanceof ResultSequence) {
                result = castResultSequenceInstance(srcValue, sequenceTypeXPathExprStr,
-                        seqExpectedTypeDataInp, xctxt, srcLocator,
-                        expectedType, itemTypeOccurenceIndicator);
+                                                                                   seqExpectedTypeDataInp, xctxt, srcLocator,
+                                                                                   expectedType, itemTypeOccurenceIndicator);
             }
         }
         catch (TransformerException ex) {
@@ -503,6 +503,15 @@ public class SequenceTypeSupport {
                   result = new XSDouble(srcStrVal);
                }
             }
+            else if (expectedType == XS_INT) {
+                result = new XSInt(srcStrVal);
+            }
+            else if (expectedType == XS_LONG) {
+                result = new XSLong(srcStrVal); 
+            }
+            else if (expectedType == XS_INTEGER) {
+                result = new XSInteger(srcStrVal); 
+            }
             else if (srcXsNumericType instanceof XSDecimal) {           
                if (expectedType == XS_DECIMAL) {
                   // The source and expected data types are same. Return the original value unchanged.
@@ -518,15 +527,6 @@ public class SequenceTypeSupport {
             else if (expectedType == XS_DECIMAL) {
                result = new XSDecimal(srcStrVal);  
             }
-            else if (expectedType == XS_INTEGER) {
-               result = new XSInteger(srcStrVal); 
-            }
-            else if (expectedType == XS_LONG) {
-               result = new XSLong(srcStrVal); 
-            }
-            else if (expectedType == XS_INT) {
-               result = new XSInt(srcStrVal);
-            }
             else if (expectedType == XS_DOUBLE) {
                result = new XSDouble(srcStrVal); 
             }
@@ -624,7 +624,7 @@ public class SequenceTypeSupport {
            result = srcValue;
         }
         else {
-           throw new TransformerException("XTTE0570 : An " + srcDataTypeName + " value '" + srcStrVal + "' cannot be cast to "
+           throw new TransformerException("XTTE0570 : The " + srcDataTypeName + " value '" + srcStrVal + "' cannot be cast to "
                                                                                                    + "a type " + sequenceTypeXPathExprStr + "."); 
         }
         
@@ -648,17 +648,16 @@ public class SequenceTypeSupport {
     }
     
     /**
-     * When for e.g, we've a xsl:variable declaration like following,
+     * This method is used to support following XSL transformation actions,
      * 
-     * <xsl:variable name="varName" as="sequenceTypeExpr">
-     *   <!-- sequence constructor -->
-     * </xsl:variable>
-     * 
-     * this method is used, to cast the provided XNodeSetForDOM object instance
-     * (representing xsl:variable's evaluated sequence constructor, when this
-     * sequence constructor represents an XML complex content) to an XObject value
-     * conforming to xsl:variable's sequence type expression which is the value of
-     * xsl:variable's "as" attribute.    
+     * 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
+     *    evaluated, construct's the variable's value). An xsl:variable's evaluated value passed as an
+     *    argument to this method, is checked against the variable's expected type.
+     *      
+     * 2) An xsl:template element has an "as" attribute (specifying the expected type of template's
+     *    evaluated content). The template's evaluated content passed as an argument to this method, 
+     *    is checked against the expected type.  
      */
     private static XObject castXNodeSetForDOMInstance(XObject srcValue,
                                                                   String sequenceTypeXPathExprStr,
@@ -783,7 +782,7 @@ public class SequenceTypeSupport {
         if (convertedResultSeq.size() > 0) {
             result = convertedResultSeq;  
         }
-        else {
+        else if (xdmNodesDtmList.size() > 0) {
             result = new XNodeSet(xdmNodesDtmList, dtmMgr); 
         }
         
diff --git a/src/org/apache/xpath/functions/DynamicFunctionCall.java b/src/org/apache/xpath/functions/DynamicFunctionCall.java
index 20a8a2c6..a4602105 100644
--- a/src/org/apache/xpath/functions/DynamicFunctionCall.java
+++ b/src/org/apache/xpath/functions/DynamicFunctionCall.java
@@ -139,7 +139,7 @@ public class DynamicFunctionCall extends Expression {
                prefixTable = (List<XMLNSDecl>)elemTemplateElement.getPrefixTable();
            }
            
-           Map<QName, XObject> functionParamAndArgMap = new HashMap<QName, XObject>();
+           Map<QName, XObject> functionParamAndArgBackupMap = new HashMap<QName, XObject>();
            
            for (int idx = 0; idx < funcParamNameList.size(); idx++) {              
               String funcParamName = funcParamNameList.get(idx);
@@ -161,10 +161,10 @@ public class DynamicFunctionCall extends Expression {
               
               m_xpathVarList.add(new QName(funcParamName));
               
-              functionParamAndArgMap.put(new QName(funcParamName), argValue);
+              functionParamAndArgBackupMap.put(new QName(funcParamName), argValue);
            }
            
-           inlineFunctionVarMap.putAll(functionParamAndArgMap);
+           inlineFunctionVarMap.putAll(functionParamAndArgBackupMap);
            
            if (prefixTable != null) {
               inlineFnXPathStr = XslTransformEvaluationHelper.replaceNsUrisWithPrefixesOnXPathStr(inlineFnXPathStr, 
diff --git a/tests/org/apache/xalan/xslt3/AllXsl3Tests.java b/tests/org/apache/xalan/xslt3/AllXsl3Tests.java
index c554db94..473113f1 100644
--- a/tests/org/apache/xalan/xslt3/AllXsl3Tests.java
+++ b/tests/org/apache/xalan/xslt3/AllXsl3Tests.java
@@ -93,7 +93,7 @@ import org.junit.runners.Suite.SuiteClasses;
                 FnStringToCodepointsTests.class, FnCompareTests.class, FnCodepointEqualTests.class,
                 SequenceFunctionTests.class, FnParseXmlTests.class, FnParseXmlFragmentTests.class,
                 TemplateTests.class, FnAvgTests.class, FnMaxTests.class, FnMinTests.class, FnContainsTokenTests.class,
-                XslAttributeAsTests.class, InstanceOfExprTests.class })
+                XslVariableAttributeAsTests.class, InstanceOfExprTests.class, XslTemplateAttributeAsTests.class })
 public class AllXsl3Tests {
 
 }
diff --git a/tests/org/apache/xalan/xslt3/XslAttributeAsTests.java b/tests/org/apache/xalan/xslt3/XslTemplateAttributeAsTests.java
similarity index 61%
copy from tests/org/apache/xalan/xslt3/XslAttributeAsTests.java
copy to tests/org/apache/xalan/xslt3/XslTemplateAttributeAsTests.java
index 14efd16e..fa8c3264 100644
--- a/tests/org/apache/xalan/xslt3/XslAttributeAsTests.java
+++ b/tests/org/apache/xalan/xslt3/XslTemplateAttributeAsTests.java
@@ -16,27 +16,27 @@
  */
 package org.apache.xalan.xslt3;
 
-import org.apache.xalan.util.XslTestsErrorHandler;
 import org.apache.xalan.util.XslTransformTestsUtil;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
- * XSLT test cases, to test the sequence type declaration
- * attribute "as" within stylesheets.
+ * XSLT test cases, to test "as" attribute present on
+ * xsl:with-param and xsl:param elements, and "as" attribute on
+ * xsl:template element.
  * 
  * @author Mukul Gandhi <mu...@apache.org>
  * 
  * @xsl.usage advanced
  */
-public class XslAttributeAsTests extends XslTransformTestsUtil {
+public class XslTemplateAttributeAsTests extends XslTransformTestsUtil {
     
     private static final String XSL_TRANSFORM_INPUT_DIRPATH = XSLConstants.XSL_TRANSFORM_INPUT_DIRPATH_PREFIX 
-                                                                                                         + "xsl_attribute_as/";
+                                                                                                    + "xsl_template_attribute_as/";
     
     private static final String XSL_TRANSFORM_GOLD_DIRPATH = XSLConstants.XSL_TRANSFORM_GOLD_DIRPATH_PREFIX 
-                                                                                                         + "xsl_attribute_as/gold/";      
+                                                                                                    + "xsl_template_attribute_as/gold/";      
 
 
     @BeforeClass
@@ -52,7 +52,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
 
     @Test
-    public void xslAttributeAsTest1() {
+    public void xslTemplateAttributeAsTest1() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1.xsl";
         
@@ -62,7 +62,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest2() {
+    public void xslTemplateAttributeAsTest2() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_a.xml"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test2.xsl";
         
@@ -72,18 +72,18 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest3() {
+    public void xslTemplateAttributeAsTest3() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test3.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test3.xsl";
         
-        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test3_1.out";                
+        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test3.out";                
         
         runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);   
     }
     
     @Test
-    public void xslAttributeAsTest4() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_b.xml"; 
+    public void xslTemplateAttributeAsTest4() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_a.xml"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test4.xsl";
         
         String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test4.out";                
@@ -92,8 +92,8 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest5() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_c.xml"; 
+    public void xslTemplateAttributeAsTest5() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test5.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test5.xsl";
         
         String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test5.out";                
@@ -102,30 +102,19 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest6() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_d.xml"; 
+    public void xslTemplateAttributeAsTest6() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test6.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test6.xsl";
         
-        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test3.out";                
-        
-        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, 
-                                                                           new XslTestsErrorHandler());   
-    }
-    
-    @Test
-    public void xslAttributeAsTest7() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_b.xml"; 
-        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test7.xsl";
-        
         String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test6.out";                
         
         runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);   
     }
     
     @Test
-    public void xslAttributeAsTest8() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_b.xml"; 
-        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test8.xsl";
+    public void xslTemplateAttributeAsTest7() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_a.xml"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test7.xsl";
         
         String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test7.out";                
         
@@ -133,53 +122,13 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest9() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_e.xml"; 
-        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test9.xsl";
+    public void xslTemplateAttributeAsTest8() {
+        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_a.xml"; 
+        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test8.xsl";
         
         String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test8.out";                
         
         runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);   
     }
-    
-    @Test
-    public void xslAttributeAsTest10() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test10.xsl"; 
-        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test10.xsl";
-        
-        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test9.out";                
-        
-        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);   
-    }
-    
-    @Test
-    public void xslAttributeAsTest11() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test11.xsl"; 
-        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test11.xsl";
-        
-        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test10.out";                
-        
-        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);   
-    }
-    
-    @Test
-    public void xslAttributeAsTest12() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test12.xsl"; 
-        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test12.xsl";
-        
-        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test11.out";                
-        
-        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);   
-    }
-    
-    @Test
-    public void xslAttributeAsTest13() {
-        String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test13.xsl"; 
-        String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test13.xsl";
-        
-        String goldFilePath = XSL_TRANSFORM_GOLD_DIRPATH + "test12.out";                
-        
-        runXslTransformAndAssertOutput(xmlFilePath, xslFilePath, goldFilePath, null);   
-    }
 
 }
diff --git a/tests/org/apache/xalan/xslt3/XslAttributeAsTests.java b/tests/org/apache/xalan/xslt3/XslVariableAttributeAsTests.java
similarity index 87%
rename from tests/org/apache/xalan/xslt3/XslAttributeAsTests.java
rename to tests/org/apache/xalan/xslt3/XslVariableAttributeAsTests.java
index 14efd16e..2473b6b0 100644
--- a/tests/org/apache/xalan/xslt3/XslAttributeAsTests.java
+++ b/tests/org/apache/xalan/xslt3/XslVariableAttributeAsTests.java
@@ -23,20 +23,20 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
- * XSLT test cases, to test the sequence type declaration
- * attribute "as" within stylesheets.
+ * XSLT test cases, to test xsl:variable element's "as" 
+ * attribute.
  * 
  * @author Mukul Gandhi <mu...@apache.org>
  * 
  * @xsl.usage advanced
  */
-public class XslAttributeAsTests extends XslTransformTestsUtil {
+public class XslVariableAttributeAsTests extends XslTransformTestsUtil {
     
     private static final String XSL_TRANSFORM_INPUT_DIRPATH = XSLConstants.XSL_TRANSFORM_INPUT_DIRPATH_PREFIX 
-                                                                                                         + "xsl_attribute_as/";
+                                                                                                    + "xsl_variable_attribute_as/";
     
     private static final String XSL_TRANSFORM_GOLD_DIRPATH = XSLConstants.XSL_TRANSFORM_GOLD_DIRPATH_PREFIX 
-                                                                                                         + "xsl_attribute_as/gold/";      
+                                                                                                    + "xsl_variable_attribute_as/gold/";      
 
 
     @BeforeClass
@@ -52,7 +52,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
 
     @Test
-    public void xslAttributeAsTest1() {
+    public void xslVariableAttributeAsTest1() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1.xsl";
         
@@ -62,7 +62,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest2() {
+    public void xslVariableAttributeAsTest2() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_a.xml"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test2.xsl";
         
@@ -72,7 +72,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest3() {
+    public void xslVariableAttributeAsTest3() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test3.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test3.xsl";
         
@@ -82,7 +82,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest4() {
+    public void xslVariableAttributeAsTest4() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_b.xml"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test4.xsl";
         
@@ -92,7 +92,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest5() {
+    public void xslVariableAttributeAsTest5() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_c.xml"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test5.xsl";
         
@@ -102,7 +102,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest6() {
+    public void xslVariableAttributeAsTest6() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_d.xml"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test6.xsl";
         
@@ -113,7 +113,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest7() {
+    public void xslVariableAttributeAsTest7() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_b.xml"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test7.xsl";
         
@@ -123,7 +123,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest8() {
+    public void xslVariableAttributeAsTest8() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_b.xml"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test8.xsl";
         
@@ -133,7 +133,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest9() {
+    public void xslVariableAttributeAsTest9() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test1_e.xml"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test9.xsl";
         
@@ -143,7 +143,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest10() {
+    public void xslVariableAttributeAsTest10() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test10.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test10.xsl";
         
@@ -153,7 +153,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest11() {
+    public void xslVariableAttributeAsTest11() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test11.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test11.xsl";
         
@@ -163,7 +163,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest12() {
+    public void xslVariableAttributeAsTest12() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test12.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test12.xsl";
         
@@ -173,7 +173,7 @@ public class XslAttributeAsTests extends XslTransformTestsUtil {
     }
     
     @Test
-    public void xslAttributeAsTest13() {
+    public void xslVariableAttributeAsTest13() {
         String xmlFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test13.xsl"; 
         String xslFilePath = XSL_TRANSFORM_INPUT_DIRPATH + "test13.xsl";
         
diff --git a/tests/xsl_attribute_as/gold/test11.out b/tests/xsl_template_attribute_as/gold/test1.out
similarity index 60%
copy from tests/xsl_attribute_as/gold/test11.out
copy to tests/xsl_template_attribute_as/gold/test1.out
index 0271626d..05e5bb77 100644
--- a/tests/xsl_attribute_as/gold/test11.out
+++ b/tests/xsl_template_attribute_as/gold/test1.out
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?><result>
-  <one>123</one>
-  <two>123</two>
+  <one>true</one>
+  <two>false</two>
 </result>
diff --git a/tests/xsl_attribute_as/gold/test2.out b/tests/xsl_template_attribute_as/gold/test2.out
similarity index 50%
copy from tests/xsl_attribute_as/gold/test2.out
copy to tests/xsl_template_attribute_as/gold/test2.out
index ec66c00c..2a16d6c1 100644
--- a/tests/xsl_attribute_as/gold/test2.out
+++ b/tests/xsl_template_attribute_as/gold/test2.out
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?><result>
-  <one>2007-10-05</one>
-  <two>2003-10-05</two>
+  <abc val="123">true</abc>
+  <pqr val="567">false</pqr>
 </result>
diff --git a/tests/xsl_attribute_as/gold/test11.out b/tests/xsl_template_attribute_as/gold/test3.out
similarity index 60%
copy from tests/xsl_attribute_as/gold/test11.out
copy to tests/xsl_template_attribute_as/gold/test3.out
index 0271626d..05e5bb77 100644
--- a/tests/xsl_attribute_as/gold/test11.out
+++ b/tests/xsl_template_attribute_as/gold/test3.out
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?><result>
-  <one>123</one>
-  <two>123</two>
+  <one>true</one>
+  <two>false</two>
 </result>
diff --git a/tests/xsl_attribute_as/gold/test10.out b/tests/xsl_template_attribute_as/gold/test4.out
similarity index 50%
copy from tests/xsl_attribute_as/gold/test10.out
copy to tests/xsl_template_attribute_as/gold/test4.out
index c1ffd9fc..2a16d6c1 100644
--- a/tests/xsl_attribute_as/gold/test10.out
+++ b/tests/xsl_template_attribute_as/gold/test4.out
@@ -1,7 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?><result>
-  <a1/>
-  <a1/>
-  <a1/>
-  <a1/>
-  <a1/>
+  <abc val="123">true</abc>
+  <pqr val="567">false</pqr>
 </result>
diff --git a/tests/xsl_attribute_as/gold/test11.out b/tests/xsl_template_attribute_as/gold/test5.out
similarity index 60%
copy from tests/xsl_attribute_as/gold/test11.out
copy to tests/xsl_template_attribute_as/gold/test5.out
index 0271626d..05e5bb77 100644
--- a/tests/xsl_attribute_as/gold/test11.out
+++ b/tests/xsl_template_attribute_as/gold/test5.out
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?><result>
-  <one>123</one>
-  <two>123</two>
+  <one>true</one>
+  <two>false</two>
 </result>
diff --git a/tests/xsl_template_attribute_as/gold/test6.out b/tests/xsl_template_attribute_as/gold/test6.out
new file mode 100644
index 00000000..b9d2beab
--- /dev/null
+++ b/tests/xsl_template_attribute_as/gold/test6.out
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><result>
+  <one>2005-10-07</one>
+  <two>
+    <elem/>
+    <elem/>
+    <elem/>
+    <elem/>
+    <elem/>
+  </two>
+</result>
diff --git a/tests/xsl_attribute_as/gold/test10.out b/tests/xsl_template_attribute_as/gold/test7.out
similarity index 50%
copy from tests/xsl_attribute_as/gold/test10.out
copy to tests/xsl_template_attribute_as/gold/test7.out
index c1ffd9fc..2a16d6c1 100644
--- a/tests/xsl_attribute_as/gold/test10.out
+++ b/tests/xsl_template_attribute_as/gold/test7.out
@@ -1,7 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?><result>
-  <a1/>
-  <a1/>
-  <a1/>
-  <a1/>
-  <a1/>
+  <abc val="123">true</abc>
+  <pqr val="567">false</pqr>
 </result>
diff --git a/tests/xsl_template_attribute_as/gold/test8.out b/tests/xsl_template_attribute_as/gold/test8.out
new file mode 100644
index 00000000..8a7dbbc6
--- /dev/null
+++ b/tests/xsl_template_attribute_as/gold/test8.out
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?><result>2005-10-07<abc val="123"/>
+  <abc/>
+  <pqr val="567"/>
+  <pqr/>
+</result>
diff --git a/tests/xsl_attribute_as/test3.xsl b/tests/xsl_template_attribute_as/test1.xsl
similarity index 69%
copy from tests/xsl_attribute_as/test3.xsl
copy to tests/xsl_template_attribute_as/test1.xsl
index 7ae6e35a..9c062ac7 100644
--- a/tests/xsl_attribute_as/test3.xsl
+++ b/tests/xsl_template_attribute_as/test1.xsl
@@ -3,21 +3,32 @@
                 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 the sequence type
-         declaration attribute "as" on an xsl:variable instruction.
-    -->
+         declaration attribute "as" on an xsl:template/xsl:param
+         element of named template.
+    -->                 
     
     <xsl:output method="xml" indent="yes"/>
     
-    <xsl:variable name="var1" select="'4'" as="xs:integer"/>
-        
     <xsl:template match="/">       
        <result>
-          <xsl:value-of select="$var1"/>
-       </result> 
+         <xsl:call-template name="Template1">
+           <xsl:with-param name="dt1" select="xs:date('2005-10-07')"/>
+         </xsl:call-template>
+       </result>
+    </xsl:template>
+    
+    <xsl:template name="Template1">
+       <xsl:param name="dt1" as="xs:date"/>       
+       <one>
+          <xsl:value-of select="$dt1 instance of xs:date"/>
+       </one>
+       <two>
+          <xsl:value-of select="$dt1 instance of xs:integer"/>
+       </two>
     </xsl:template>
     
     <!--
diff --git a/tests/xsl_template_attribute_as/test1_a.xml b/tests/xsl_template_attribute_as/test1_a.xml
new file mode 100644
index 00000000..68d9e1a8
--- /dev/null
+++ b/tests/xsl_template_attribute_as/test1_a.xml
@@ -0,0 +1,4 @@
+<info>
+  <abc>123</abc>
+  <pqr>567</pqr>
+</info>
\ No newline at end of file
diff --git a/tests/xsl_attribute_as/test9.xsl b/tests/xsl_template_attribute_as/test2.xsl
similarity index 64%
copy from tests/xsl_attribute_as/test9.xsl
copy to tests/xsl_template_attribute_as/test2.xsl
index 0e1d016c..716b88ae 100644
--- a/tests/xsl_attribute_as/test9.xsl
+++ b/tests/xsl_template_attribute_as/test2.xsl
@@ -6,24 +6,35 @@
                 
     <!-- Author: mukulg@apache.org -->
     
-    <!-- use with test1_e.xml -->               
+    <!-- use with test1_a.xml -->                
     
     <!-- An XSLT stylesheet test case, to test the sequence type
-         declaration attribute "as" on an xsl:variable instruction.
-    -->                
+         declaration attribute "as" on an xsl:template/xsl:param
+         element on a template with "match" attribute.
+    -->                  
     
     <xsl:output method="xml" indent="yes"/>
     
     <xsl:template match="/info">       
        <result>
-	      <xsl:for-each select="val">
-	         <xsl:variable name="attrVar" select="@*[1]" as="attribute(attr1)"/>
-	         <xsl:element name="valNew">
-	            <xsl:copy-of select="$attrVar"/>
-	            <xsl:value-of select="."/>
-	         </xsl:element>
-	      </xsl:for-each>
-       </result> 
+         <xsl:apply-templates select="*">
+            <xsl:with-param name="dt1" select="xs:date('2005-10-07')"/>
+         </xsl:apply-templates>
+       </result>
+    </xsl:template>
+    
+    <xsl:template match="abc">
+      <xsl:param name="dt1" as="xs:date"/>
+      <abc val="{.}">
+         <xsl:value-of select="$dt1 instance of xs:date"/>
+      </abc>
+    </xsl:template>
+    
+    <xsl:template match="pqr">
+      <xsl:param name="dt1" as="xs:date"/>
+      <pqr val="{.}">
+         <xsl:value-of select="$dt1 instance of xs:integer"/>    
+      </pqr>
     </xsl:template>
     
     <!--
diff --git a/tests/xsl_attribute_as/test3.xsl b/tests/xsl_template_attribute_as/test3.xsl
similarity index 70%
copy from tests/xsl_attribute_as/test3.xsl
copy to tests/xsl_template_attribute_as/test3.xsl
index 7ae6e35a..5f43c388 100644
--- a/tests/xsl_attribute_as/test3.xsl
+++ b/tests/xsl_template_attribute_as/test3.xsl
@@ -3,21 +3,32 @@
                 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 the sequence type
-         declaration attribute "as" on an xsl:variable instruction.
-    -->
+         declaration attribute "as" on an xsl:call-template/xsl:with-param
+         element.
+    -->                 
     
     <xsl:output method="xml" indent="yes"/>
     
-    <xsl:variable name="var1" select="'4'" as="xs:integer"/>
-        
     <xsl:template match="/">       
        <result>
-          <xsl:value-of select="$var1"/>
-       </result> 
+         <xsl:call-template name="Template1">
+           <xsl:with-param name="dt1" select="'2005-10-07'" as="xs:date"/>
+         </xsl:call-template>
+       </result>
+    </xsl:template>
+    
+    <xsl:template name="Template1">
+       <xsl:param name="dt1"/>       
+       <one>
+          <xsl:value-of select="$dt1 instance of xs:date"/>
+       </one>
+       <two>
+          <xsl:value-of select="$dt1 instance of xs:integer"/>
+       </two>
     </xsl:template>
     
     <!--
diff --git a/tests/xsl_attribute_as/test9.xsl b/tests/xsl_template_attribute_as/test4.xsl
similarity index 66%
copy from tests/xsl_attribute_as/test9.xsl
copy to tests/xsl_template_attribute_as/test4.xsl
index 0e1d016c..3249ca51 100644
--- a/tests/xsl_attribute_as/test9.xsl
+++ b/tests/xsl_template_attribute_as/test4.xsl
@@ -6,24 +6,35 @@
                 
     <!-- Author: mukulg@apache.org -->
     
-    <!-- use with test1_e.xml -->               
+    <!-- use with test1_a.xml -->                
     
     <!-- An XSLT stylesheet test case, to test the sequence type
-         declaration attribute "as" on an xsl:variable instruction.
-    -->                
+         declaration attribute "as" on an xsl:apply-templates/xsl:with-param
+         element.
+    -->
     
     <xsl:output method="xml" indent="yes"/>
     
     <xsl:template match="/info">       
        <result>
-	      <xsl:for-each select="val">
-	         <xsl:variable name="attrVar" select="@*[1]" as="attribute(attr1)"/>
-	         <xsl:element name="valNew">
-	            <xsl:copy-of select="$attrVar"/>
-	            <xsl:value-of select="."/>
-	         </xsl:element>
-	      </xsl:for-each>
-       </result> 
+          <xsl:apply-templates select="*">
+             <xsl:with-param name="dt1" select="'2005-10-07'" as="xs:date"/>
+          </xsl:apply-templates>
+       </result>
+    </xsl:template>
+    
+    <xsl:template match="abc">
+      <xsl:param name="dt1"/>
+      <abc val="{.}">
+         <xsl:value-of select="$dt1 instance of xs:date"/>
+      </abc>
+    </xsl:template>
+    
+    <xsl:template match="pqr">
+      <xsl:param name="dt1"/>
+      <pqr val="{.}">
+         <xsl:value-of select="$dt1 instance of xs:integer"/>    
+      </pqr>
     </xsl:template>
     
     <!--
diff --git a/tests/xsl_attribute_as/test2.xsl b/tests/xsl_template_attribute_as/test5.xsl
similarity index 78%
copy from tests/xsl_attribute_as/test2.xsl
copy to tests/xsl_template_attribute_as/test5.xsl
index d33690c8..efb6a672 100644
--- a/tests/xsl_attribute_as/test2.xsl
+++ b/tests/xsl_template_attribute_as/test5.xsl
@@ -4,27 +4,26 @@
                 exclude-result-prefixes="xs"
                 version="3.0">
                 
-    <!-- Author: mukulg@apache.org -->
-    
-    <!-- use with test1_a.xml -->               
+    <!-- Author: mukulg@apache.org -->                
     
     <!-- An XSLT stylesheet test case, to test the sequence type
-         declaration attribute "as" on an xsl:variable instruction.
-    -->                
+         declaration attribute "as" on a stylesheet global
+         xsl:param element.
+    -->                   
     
     <xsl:output method="xml" indent="yes"/>
     
-    <xsl:variable name="var1" select="/info/val" as="xs:date*"/>
-        
+    <xsl:param name="dt1" select="'2005-10-07'" as="xs:date"/>
+    
     <xsl:template match="/">       
        <result>
           <one>
-             <xsl:value-of select="max($var1)"/>
+             <xsl:value-of select="$dt1 instance of xs:date"/>
           </one>
           <two>
-	         <xsl:value-of select="min($var1)"/>
+	         <xsl:value-of select="$dt1 instance of xs:integer"/>
           </two>
-       </result> 
+       </result>
     </xsl:template>
     
     <!--
diff --git a/tests/xsl_attribute_as/test2.xsl b/tests/xsl_template_attribute_as/test6.xsl
similarity index 72%
copy from tests/xsl_attribute_as/test2.xsl
copy to tests/xsl_template_attribute_as/test6.xsl
index d33690c8..1f4682b6 100644
--- a/tests/xsl_attribute_as/test2.xsl
+++ b/tests/xsl_template_attribute_as/test6.xsl
@@ -4,27 +4,34 @@
                 exclude-result-prefixes="xs"
                 version="3.0">
                 
-    <!-- Author: mukulg@apache.org -->
-    
-    <!-- use with test1_a.xml -->               
+    <!-- Author: mukulg@apache.org -->                
     
     <!-- An XSLT stylesheet test case, to test the sequence type
-         declaration attribute "as" on an xsl:variable instruction.
+         declaration attribute "as" on named template element 
+         xsl:template.
     -->                
     
     <xsl:output method="xml" indent="yes"/>
     
-    <xsl:variable name="var1" select="/info/val" as="xs:date*"/>
-        
     <xsl:template match="/">       
        <result>
           <one>
-             <xsl:value-of select="max($var1)"/>
+             <xsl:call-template name="Template1"/>
           </one>
           <two>
-	         <xsl:value-of select="min($var1)"/>
+             <xsl:call-template name="Template2"/>
           </two>
-       </result> 
+       </result>
+    </xsl:template>
+    
+    <xsl:template name="Template1" as="xs:date">       
+       <xsl:value-of select="'2005-10-07'"/>
+    </xsl:template>
+    
+    <xsl:template name="Template2" as="element(elem)*">
+       <xsl:for-each select="1 to 5">
+          <elem/>
+       </xsl:for-each>
     </xsl:template>
     
     <!--
diff --git a/tests/xsl_attribute_as/test9.xsl b/tests/xsl_template_attribute_as/test7.xsl
similarity index 64%
copy from tests/xsl_attribute_as/test9.xsl
copy to tests/xsl_template_attribute_as/test7.xsl
index 0e1d016c..8f818a39 100644
--- a/tests/xsl_attribute_as/test9.xsl
+++ b/tests/xsl_template_attribute_as/test7.xsl
@@ -6,24 +6,36 @@
                 
     <!-- Author: mukulg@apache.org -->
     
-    <!-- use with test1_e.xml -->               
+    <!-- use with test1_a.xml -->                
     
     <!-- An XSLT stylesheet test case, to test the sequence type
-         declaration attribute "as" on an xsl:variable instruction.
+         declaration attribute "as" on an xsl:template/xsl:param
+         element and the corresponding xsl:apply-templates's 
+         xsl:with-param element.
     -->                
     
     <xsl:output method="xml" indent="yes"/>
     
     <xsl:template match="/info">       
        <result>
-	      <xsl:for-each select="val">
-	         <xsl:variable name="attrVar" select="@*[1]" as="attribute(attr1)"/>
-	         <xsl:element name="valNew">
-	            <xsl:copy-of select="$attrVar"/>
-	            <xsl:value-of select="."/>
-	         </xsl:element>
-	      </xsl:for-each>
-       </result> 
+          <xsl:apply-templates select="*">
+             <xsl:with-param name="dt1" select="'2005-10-07'" as="xs:date"/>
+          </xsl:apply-templates>
+       </result>
+    </xsl:template>
+    
+    <xsl:template match="abc">
+      <xsl:param name="dt1" as="xs:date"/>
+      <abc val="{.}">
+         <xsl:value-of select="$dt1 instance of xs:date"/>
+      </abc>
+    </xsl:template>
+    
+    <xsl:template match="pqr">
+      <xsl:param name="dt1" as="xs:date"/>
+      <pqr val="{.}">
+         <xsl:value-of select="$dt1 instance of xs:integer"/>    
+      </pqr>
     </xsl:template>
     
     <!--
diff --git a/tests/xsl_attribute_as/test9.xsl b/tests/xsl_template_attribute_as/test8.xsl
similarity index 70%
copy from tests/xsl_attribute_as/test9.xsl
copy to tests/xsl_template_attribute_as/test8.xsl
index 0e1d016c..7de97b13 100644
--- a/tests/xsl_attribute_as/test9.xsl
+++ b/tests/xsl_template_attribute_as/test8.xsl
@@ -6,24 +6,31 @@
                 
     <!-- Author: mukulg@apache.org -->
     
-    <!-- use with test1_e.xml -->               
+    <!-- use with test1_a.xml -->                
     
     <!-- An XSLT stylesheet test case, to test the sequence type
-         declaration attribute "as" on an xsl:variable instruction.
-    -->                
+         declaration attribute "as" on an element xsl:template
+         when the template is invoked via xsl:apply-templates 
+         instruction.
+    -->                 
     
     <xsl:output method="xml" indent="yes"/>
     
     <xsl:template match="/info">       
        <result>
-	      <xsl:for-each select="val">
-	         <xsl:variable name="attrVar" select="@*[1]" as="attribute(attr1)"/>
-	         <xsl:element name="valNew">
-	            <xsl:copy-of select="$attrVar"/>
-	            <xsl:value-of select="."/>
-	         </xsl:element>
-	      </xsl:for-each>
-       </result> 
+         <xsl:apply-templates select="*"/>
+       </result>
+    </xsl:template>
+    
+    <xsl:template match="abc" as="item()*">
+       <xsl:value-of select="xs:date('2005-10-07')"/>
+       <abc val="{.}"/>
+       <abc/>
+    </xsl:template>
+    
+    <xsl:template match="pqr" as="element(pqr)*">
+       <pqr val="{.}"/>
+       <pqr/>
     </xsl:template>
     
     <!--
diff --git a/tests/xsl_attribute_as/gold/test1.out b/tests/xsl_variable_attribute_as/gold/test1.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test1.out
rename to tests/xsl_variable_attribute_as/gold/test1.out
diff --git a/tests/xsl_attribute_as/gold/test10.out b/tests/xsl_variable_attribute_as/gold/test10.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test10.out
rename to tests/xsl_variable_attribute_as/gold/test10.out
diff --git a/tests/xsl_attribute_as/gold/test11.out b/tests/xsl_variable_attribute_as/gold/test11.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test11.out
rename to tests/xsl_variable_attribute_as/gold/test11.out
diff --git a/tests/xsl_attribute_as/gold/test12.out b/tests/xsl_variable_attribute_as/gold/test12.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test12.out
rename to tests/xsl_variable_attribute_as/gold/test12.out
diff --git a/tests/xsl_attribute_as/gold/test2.out b/tests/xsl_variable_attribute_as/gold/test2.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test2.out
rename to tests/xsl_variable_attribute_as/gold/test2.out
diff --git a/tests/xsl_attribute_as/gold/test3.out b/tests/xsl_variable_attribute_as/gold/test3.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test3.out
rename to tests/xsl_variable_attribute_as/gold/test3.out
diff --git a/tests/xsl_attribute_as/gold/test3_1.out b/tests/xsl_variable_attribute_as/gold/test3_1.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test3_1.out
rename to tests/xsl_variable_attribute_as/gold/test3_1.out
diff --git a/tests/xsl_attribute_as/gold/test4.out b/tests/xsl_variable_attribute_as/gold/test4.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test4.out
rename to tests/xsl_variable_attribute_as/gold/test4.out
diff --git a/tests/xsl_attribute_as/gold/test5.out b/tests/xsl_variable_attribute_as/gold/test5.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test5.out
rename to tests/xsl_variable_attribute_as/gold/test5.out
diff --git a/tests/xsl_attribute_as/gold/test6.out b/tests/xsl_variable_attribute_as/gold/test6.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test6.out
rename to tests/xsl_variable_attribute_as/gold/test6.out
diff --git a/tests/xsl_attribute_as/gold/test7.out b/tests/xsl_variable_attribute_as/gold/test7.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test7.out
rename to tests/xsl_variable_attribute_as/gold/test7.out
diff --git a/tests/xsl_attribute_as/gold/test8.out b/tests/xsl_variable_attribute_as/gold/test8.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test8.out
rename to tests/xsl_variable_attribute_as/gold/test8.out
diff --git a/tests/xsl_attribute_as/gold/test9.out b/tests/xsl_variable_attribute_as/gold/test9.out
similarity index 100%
rename from tests/xsl_attribute_as/gold/test9.out
rename to tests/xsl_variable_attribute_as/gold/test9.out
diff --git a/tests/xsl_attribute_as/test1.xsl b/tests/xsl_variable_attribute_as/test1.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test1.xsl
rename to tests/xsl_variable_attribute_as/test1.xsl
diff --git a/tests/xsl_attribute_as/test10.xsl b/tests/xsl_variable_attribute_as/test10.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test10.xsl
rename to tests/xsl_variable_attribute_as/test10.xsl
diff --git a/tests/xsl_attribute_as/test11.xsl b/tests/xsl_variable_attribute_as/test11.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test11.xsl
rename to tests/xsl_variable_attribute_as/test11.xsl
diff --git a/tests/xsl_attribute_as/test12.xsl b/tests/xsl_variable_attribute_as/test12.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test12.xsl
rename to tests/xsl_variable_attribute_as/test12.xsl
diff --git a/tests/xsl_attribute_as/test13.xsl b/tests/xsl_variable_attribute_as/test13.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test13.xsl
rename to tests/xsl_variable_attribute_as/test13.xsl
diff --git a/tests/xsl_attribute_as/test1_a.xml b/tests/xsl_variable_attribute_as/test1_a.xml
similarity index 100%
rename from tests/xsl_attribute_as/test1_a.xml
rename to tests/xsl_variable_attribute_as/test1_a.xml
diff --git a/tests/xsl_attribute_as/test1_b.xml b/tests/xsl_variable_attribute_as/test1_b.xml
similarity index 100%
rename from tests/xsl_attribute_as/test1_b.xml
rename to tests/xsl_variable_attribute_as/test1_b.xml
diff --git a/tests/xsl_attribute_as/test1_c.xml b/tests/xsl_variable_attribute_as/test1_c.xml
similarity index 100%
rename from tests/xsl_attribute_as/test1_c.xml
rename to tests/xsl_variable_attribute_as/test1_c.xml
diff --git a/tests/xsl_attribute_as/test1_d.xml b/tests/xsl_variable_attribute_as/test1_d.xml
similarity index 100%
rename from tests/xsl_attribute_as/test1_d.xml
rename to tests/xsl_variable_attribute_as/test1_d.xml
diff --git a/tests/xsl_attribute_as/test1_e.xml b/tests/xsl_variable_attribute_as/test1_e.xml
similarity index 100%
rename from tests/xsl_attribute_as/test1_e.xml
rename to tests/xsl_variable_attribute_as/test1_e.xml
diff --git a/tests/xsl_attribute_as/test2.xsl b/tests/xsl_variable_attribute_as/test2.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test2.xsl
rename to tests/xsl_variable_attribute_as/test2.xsl
diff --git a/tests/xsl_attribute_as/test3.xsl b/tests/xsl_variable_attribute_as/test3.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test3.xsl
rename to tests/xsl_variable_attribute_as/test3.xsl
diff --git a/tests/xsl_attribute_as/test4.xsl b/tests/xsl_variable_attribute_as/test4.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test4.xsl
rename to tests/xsl_variable_attribute_as/test4.xsl
diff --git a/tests/xsl_attribute_as/test5.xsl b/tests/xsl_variable_attribute_as/test5.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test5.xsl
rename to tests/xsl_variable_attribute_as/test5.xsl
diff --git a/tests/xsl_attribute_as/test6.xsl b/tests/xsl_variable_attribute_as/test6.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test6.xsl
rename to tests/xsl_variable_attribute_as/test6.xsl
diff --git a/tests/xsl_attribute_as/test7.xsl b/tests/xsl_variable_attribute_as/test7.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test7.xsl
rename to tests/xsl_variable_attribute_as/test7.xsl
diff --git a/tests/xsl_attribute_as/test8.xsl b/tests/xsl_variable_attribute_as/test8.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test8.xsl
rename to tests/xsl_variable_attribute_as/test8.xsl
diff --git a/tests/xsl_attribute_as/test9.xsl b/tests/xsl_variable_attribute_as/test9.xsl
similarity index 100%
rename from tests/xsl_attribute_as/test9.xsl
rename to tests/xsl_variable_attribute_as/test9.xsl


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