File excalibur-components-xmlutil-Saxon8ProcessorImpl.patch of Package excalibur

--- components/xmlutil/src/java/org/apache/excalibur/xml/xpath/Saxon8ProcessorImpl.java.sav08	2007-01-30 09:26:54.000000000 +0100
+++ components/xmlutil/src/java/org/apache/excalibur/xml/xpath/Saxon8ProcessorImpl.java	2008-10-08 09:03:18.000000000 +0200
@@ -23,11 +23,13 @@
 import net.sf.saxon.om.NodeInfo;
 import net.sf.saxon.om.SequenceIterator;
 import net.sf.saxon.om.Item;
-import net.sf.saxon.xpath.XPathException;
+import net.sf.saxon.trans.XPathException;
 import net.sf.saxon.xpath.StandaloneContext;
 import net.sf.saxon.TransformerFactoryImpl;
 import net.sf.saxon.expr.Expression;
+import net.sf.saxon.expr.StaticContext;
 import net.sf.saxon.expr.XPathContext;
+import net.sf.saxon.expr.EarlyEvaluationContext;
 import net.sf.saxon.expr.ExpressionTool;
 import net.sf.saxon.tinytree.TinyBuilder;
 
@@ -37,8 +39,8 @@
 
 /**
  * This class defines the implementation of the {@link XPathProcessor}
- * component. This implementation depends on Saxon 7.X XSLT processor.
- * This implementation was tested with Saxon 7.5 release.
+ * component. This implementation depends on Saxon 8.X XSLT processor.
+ * This implementation was tested with Saxon 8.7 release.
  *
  * To configure it, add the following lines in the
  * <file>cocoon.xconf</file> file:
@@ -48,10 +50,8 @@
  * &lt;/xslt-processor&gt;
  * </pre>
  *
- * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
- * @version CVS $Id: Saxon7ProcessorImpl.java,v 1.6 2004/04/02 09:02:37 cziegeler Exp $
  */
-public class Saxon7ProcessorImpl
+public class Saxon8ProcessorImpl
         extends AbstractProcessorImpl
         implements ThreadSafe
 {
@@ -223,12 +223,12 @@
                 DOMSource source = new DOMSource(contextNode);
                 TinyBuilder result = new TinyBuilder();
                 factory.newTransformer().transform(source, result);
-                contextNode = (Node)result.getCurrentDocument();
+                contextNode = (Node)result.getCurrentRoot();
             }
 
             Expression expression = ExpressionTool.make(
-                    str, new Saxon7Context((NodeInfo)contextNode, resolver), 0, -1);
-            XPathContext context = new XPathContext((NodeInfo)contextNode);
+                    str, (StaticContext)new Saxon8Context((NodeInfo)contextNode, resolver), 0, -1, -1);
+            XPathContext context = new EarlyEvaluationContext(((StaticContext)contextNode).getConfiguration(), new net.sf.saxon.expr.CollationMap(((StaticContext)contextNode).getConfiguration()));
             return expression.iterate(context);
         }
         catch (final Exception e)
@@ -243,11 +243,11 @@
     }
 
 
-    private class Saxon7Context extends StandaloneContext
+    private class Saxon8Context extends StandaloneContext
     {
         private final PrefixResolver resolver;
 
-        public Saxon7Context(NodeInfo node, PrefixResolver resolver)
+        public Saxon8Context(NodeInfo node, PrefixResolver resolver)
         {
             super(node);
             this.resolver = resolver;