Permalink
Browse files

Update to the Saxon 9.8 API

  • Loading branch information...
ndw committed Jan 25, 2018
1 parent 1e7285c commit 70cad177d3cb4132b2a358a5593ac13802b26a87
@@ -3,7 +3,6 @@
import net.sf.saxon.expr.LastPositionFinder;
import net.sf.saxon.om.FocusIterator;
import net.sf.saxon.om.Item;
import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.om.SequenceIterator;
import net.sf.saxon.trans.XPathException;
@@ -14,7 +13,7 @@
* Time: 4:35:36 PM
* To change this template use File | Settings | File Templates.
*/
public class DocumentSequenceIterator implements FocusIterator, LastPositionFinder<Item> {
public class DocumentSequenceIterator implements FocusIterator, LastPositionFinder {
int position = 0;
int last = 0;
Item item = null;
@@ -24,7 +24,6 @@
import com.xmlcalabash.core.XProcRuntime;
import com.xmlcalabash.model.RuntimeValue;
import net.sf.saxon.Configuration;
import net.sf.saxon.event.NamespaceReducer;
import net.sf.saxon.event.PipelineConfiguration;
import net.sf.saxon.om.NamespaceResolver;
import net.sf.saxon.s9api.Axis;
@@ -82,7 +81,6 @@ public void match(XdmNode doc, RuntimeValue match) {
destination = new XdmDestination();
receiver = destination.getReceiver(saxonConfig);
receiver = new NamespaceReducer(receiver);
PipelineConfiguration pipe = controller.makePipelineConfiguration();
receiver.setPipelineConfiguration(pipe);
@@ -22,7 +22,18 @@
import com.xmlcalabash.core.XProcConstants;
import com.xmlcalabash.core.XProcException;
import net.sf.saxon.om.*;
import com.xmlcalabash.core.XProcRuntime;
import net.sf.saxon.Configuration;
import net.sf.saxon.event.PipelineConfiguration;
import net.sf.saxon.event.Receiver;
import net.sf.saxon.event.TreeReceiver;
import net.sf.saxon.om.FingerprintedQName;
import net.sf.saxon.om.InscopeNamespaceResolver;
import net.sf.saxon.om.Item;
import net.sf.saxon.om.NameOfNode;
import net.sf.saxon.om.NamespaceBinding;
import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.om.NodeName;
import net.sf.saxon.s9api.Axis;
import net.sf.saxon.s9api.Destination;
import net.sf.saxon.s9api.Processor;
@@ -43,12 +54,10 @@
import net.sf.saxon.s9api.XdmSequenceIterator;
import net.sf.saxon.s9api.XdmValue;
import net.sf.saxon.trans.XPathException;
import net.sf.saxon.event.Receiver;
import net.sf.saxon.event.TreeReceiver;
import net.sf.saxon.event.NamespaceReducer;
import net.sf.saxon.event.PipelineConfiguration;
import net.sf.saxon.Configuration;
import com.xmlcalabash.core.XProcRuntime;
import net.sf.saxon.tree.util.NamespaceIterator;
import nu.validator.htmlparser.sax.HtmlSerializer;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -57,15 +66,10 @@
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.Writer;
import java.net.URI;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Vector;
import java.util.HashSet;
import java.net.URI;
import net.sf.saxon.tree.util.NamespaceIterator;
import nu.validator.htmlparser.sax.HtmlSerializer;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
/**
*
@@ -98,7 +102,6 @@ public static void writeXdmValue(Processor proc, Vector<XdmValue> values, Destin
PipelineConfiguration pipeConfig = config.makePipelineConfiguration();
Receiver out = destination.getReceiver(config);
out = new NamespaceReducer(out);
TreeReceiver tree = new TreeReceiver(out);
tree.setPipelineConfiguration(pipeConfig);
if (baseURI != null) {
@@ -126,7 +129,6 @@ public static void writeXdmValue(XProcRuntime runtime, XdmItem node, Destination
PipelineConfiguration pipeConfig = config.makePipelineConfiguration();
Receiver out = destination.getReceiver(config);
out = new NamespaceReducer(out);
TreeReceiver tree = new TreeReceiver(out);
tree.setPipelineConfiguration(pipeConfig);
if (baseURI != null) {
@@ -20,14 +20,20 @@
package com.xmlcalabash.util;
import com.xmlcalabash.core.XProcRuntime;
import com.xmlcalabash.core.XProcException;
import com.xmlcalabash.core.XProcRuntime;
import net.sf.saxon.Controller;
import net.sf.saxon.event.NamespaceReducer;
import net.sf.saxon.event.Receiver;
import net.sf.saxon.event.PipelineConfiguration;
import net.sf.saxon.event.Receiver;
import net.sf.saxon.expr.instruct.Executable;
import net.sf.saxon.om.*;
import net.sf.saxon.expr.parser.Location;
import net.sf.saxon.om.FingerprintedQName;
import net.sf.saxon.om.NameOfNode;
import net.sf.saxon.om.NamePool;
import net.sf.saxon.om.NamespaceBinding;
import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.om.NodeName;
import net.sf.saxon.om.StandardNames;
import net.sf.saxon.s9api.Axis;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.QName;
@@ -43,7 +49,6 @@
import java.net.URI;
import java.util.Iterator;
import net.sf.saxon.expr.parser.Location;
/**
*
@@ -106,8 +111,7 @@ public void startDocument(URI baseURI) {
exec = new Executable(controller.getConfiguration());
destination = new XdmDestination();
receiver = destination.getReceiver(controller.getConfiguration());
receiver = new NamespaceReducer(receiver);
PipelineConfiguration pipe = controller.makePipelineConfiguration();
receiver.setPipelineConfiguration(pipe);

0 comments on commit 70cad17

Please sign in to comment.