src/com/sun/org/apache/xpath/internal/XPathContext.java

Print this page

        

@@ -20,21 +20,10 @@
 /*
  * $Id: XPathContext.java,v 1.2.4.2 2005/09/15 01:37:55 jeffsuttor Exp $
  */
 package com.sun.org.apache.xpath.internal;
 
-import java.lang.reflect.Method;
-import java.util.Stack;
-import java.util.Vector;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-
 import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
 import com.sun.org.apache.xml.internal.dtm.Axis;
 import com.sun.org.apache.xml.internal.dtm.DTM;
 import com.sun.org.apache.xml.internal.dtm.DTMFilter;

@@ -44,18 +33,25 @@
 import com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2RTFDTM;
 import com.sun.org.apache.xml.internal.utils.IntStack;
 import com.sun.org.apache.xml.internal.utils.NodeVector;
 import com.sun.org.apache.xml.internal.utils.ObjectStack;
 import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xml.internal.utils.SAXSourceLocator;
 import com.sun.org.apache.xml.internal.utils.XMLString;
 import com.sun.org.apache.xpath.internal.axes.SubContextList;
-import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.objects.DTMXRTreeFrag;
+import com.sun.org.apache.xpath.internal.objects.XObject;
 import com.sun.org.apache.xpath.internal.objects.XString;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Stack;
+import java.util.Vector;
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.SourceLocator;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.URIResolver;
 import org.xml.sax.XMLReader;
 
 /**
  * Default class for the runtime execution context for XPath.
  *

@@ -337,12 +333,12 @@
     m_currentNodes.push(DTM.NULL);
     m_currentExpressionNodes.push(DTM.NULL);
     m_saxLocations.push(null);
     m_useServicesMechanism = useServicesMechanism;
     m_dtmManager = DTMManager.newInstance(
-                   com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory(),
-                   m_useServicesMechanism);
+                   com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory()
+                   );
   }
 
   /**
    * Reset for new run.
    */

@@ -361,12 +357,12 @@
                         m_dtmManager.release(m_global_rtfdtm,true);
     m_global_rtfdtm=null;
 
 
     m_dtmManager = DTMManager.newInstance(
-                   com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory(),
-                   m_useServicesMechanism);
+                   com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory()
+                   );
 
     m_saxLocations.removeAllElements();
         m_axesIteratorStack.removeAllElements();
         m_contextNodeLists.removeAllElements();
         m_currentExpressionNodes.removeAllElements();

@@ -620,36 +616,10 @@
 
 
   /** Misnamed string manager for XPath messages.  */
   // private static XSLMessages m_XSLMessages = new XSLMessages();
 
-  /**
-   * Tell the user of an assertion error, and probably throw an
-   * exception.
-   *
-   * @param b  If false, a TransformerException will be thrown.
-   * @param msg The assertion message, which should be informative.
-   *
-   * @throws javax.xml.transform.TransformerException if b is false.
-   */
-  private void assertion(boolean b, String msg) throws javax.xml.transform.TransformerException
-  {
-    if (!b)
-    {
-      ErrorListener errorHandler = getErrorListener();
-
-      if (errorHandler != null)
-      {
-        errorHandler.fatalError(
-          new TransformerException(
-            XSLMessages.createMessage(
-              XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
-              new Object[]{ msg }), (SAXSourceLocator)this.getSAXLocator()));
-      }
-    }
-  }
-
   //==========================================================
   // SECTION: Execution context state tracking
   //==========================================================
 
   /**

@@ -662,11 +632,11 @@
 
   /**
    * Get the current context node list.
    *
    * @return  the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>,
-   * also refered to here as a <term>context node list</term>.
+   * also referred to here as a <term>context node list</term>.
    */
   public final DTMIterator getContextNodeList()
   {
 
     if (m_contextNodeLists.size() > 0)

@@ -677,11 +647,11 @@
 
   /**
    * Set the current context node list.
    *
    * @param nl the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>,
-   * also refered to here as a <term>context node list</term>.
+   * also referred to here as a <term>context node list</term>.
    * @xsl.usage internal
    */
   public final void pushContextNodeList(DTMIterator nl)
   {
     m_contextNodeLists.push(nl);

@@ -698,11 +668,11 @@
         else
       m_contextNodeLists.pop();
   }
 
   /**
-   * The ammount to use for stacks that record information during the
+   * The amount to use for stacks that record information during the
    * recursive execution.
    */
   public static final int RECURSIONLIMIT = (1024*4);
 
   /** The stack of <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a> objects.