You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2007/04/02 17:52:12 UTC

svn commit: r524814 - /xalan/java/trunk/src/org/apache/xpath/jaxp/XPathImpl.java

Author: zongaro
Date: Mon Apr  2 08:52:11 2007
New Revision: 524814

URL: http://svn.apache.org/viewvc?view=rev&rev=524814
Log:
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).

Modified:
    xalan/java/trunk/src/org/apache/xpath/jaxp/XPathImpl.java

Modified: xalan/java/trunk/src/org/apache/xpath/jaxp/XPathImpl.java
URL: http://svn.apache.org/viewvc/xalan/java/trunk/src/org/apache/xpath/jaxp/XPathImpl.java?view=diff&rev=524814&r1=524813&r2=524814
==============================================================================
--- xalan/java/trunk/src/org/apache/xpath/jaxp/XPathImpl.java (original)
+++ xalan/java/trunk/src/org/apache/xpath/jaxp/XPathImpl.java Mon Apr  2 08:52:11 2007
@@ -195,12 +195,16 @@
         org.apache.xpath.XPath xpath = new org.apache.xpath.XPath( expression,
             null, prefixResolver, org.apache.xpath.XPath.SELECT ); 
         org.apache.xpath.XPathContext xpathSupport = null;
+
+        // Create an XPathContext that doesn't support pushing and popping of
+        // variable resolution scopes.  Sufficient for simple XPath 1.0
+        // expressions.
         if ( functionResolver != null ) {
             JAXPExtensionsProvider jep = new JAXPExtensionsProvider(
                     functionResolver, featureSecureProcessing );
-            xpathSupport = new org.apache.xpath.XPathContext( jep );
+            xpathSupport = new org.apache.xpath.XPathContext(jep, false);
         } else { 
-            xpathSupport = new org.apache.xpath.XPathContext();
+            xpathSupport = new org.apache.xpath.XPathContext(false);
         }
 
         XObject xobj = null;



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