Part of fix for Jira issue XALANJ-2375.

Added a new constructor and corresponding reset method that allow the caller
to specify the initial size for the arrays contained in a VariableStack.  This
is important for XPath expression evaluation, where additional stack entries
are never needed.  Previously, the arrays were always allocated based on the
maximum recursion depth permitted by the XSLT processor, which was caused
unnecessary initialization overhead using the various XPath APIs.

Also added two new XPathContext constructors which accept a boolean argument
that indicates whether the context for variables needs to be push/popable.
When it's false, the XPathContext will create a minimally-sized VariableStack.

Reviewed by Christine Li (jycli () ca ! ibm ! com).

diff --git a/src/org/apache/xpath/domapi/XPathExpressionImpl.java b/src/org/apache/xpath/domapi/XPathExpressionImpl.java
index 85b49d8..5d06165 100644
--- a/src/org/apache/xpath/domapi/XPathExpressionImpl.java
+++ b/src/org/apache/xpath/domapi/XPathExpressionImpl.java
@@ -157,8 +157,11 @@
             throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0}               
         }
         
-        // Cache xpath context?
-        XPathContext xpathSupport = new XPathContext();
+        // Create an XPathContext that doesn't support pushing and popping of
+        // variable resolution scopes.  Sufficient for simple XPath 1.0
+        // expressions.
+        //    Cache xpath context?
+        XPathContext xpathSupport = new XPathContext(false);
         
         // if m_document is not null, build the DTM from the document 
         if (null != m_doc) {