01: package net.sf.saxon.pull;
02:
03: import net.sf.saxon.event.Receiver;
04: import net.sf.saxon.trans.XPathException;
05:
06: /**
07: * This class copies a document by using the pull interface to read the input document,
08: * and the push interface to write the output document.
09: */
10: public class PullPushCopier {
11:
12: private PullProvider in;
13: private Receiver out;
14:
15: public PullPushCopier(PullProvider in, Receiver out) {
16: this .out = out;
17: this .in = in;
18: }
19:
20: /**
21: * Copy the input to the output
22: * @throws XPathException
23: */
24:
25: public void copy() throws XPathException {
26: PullPushTee tee = new PullPushTee(in, out);
27: new PullConsumer(tee).consume();
28: }
29: }
30:
31: //
32: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
33: // you may not use this file except in compliance with the License. You may obtain a copy of the
34: // License at http://www.mozilla.org/MPL/
35: //
36: // Software distributed under the License is distributed on an "AS IS" basis,
37: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
38: // See the License for the specific language governing rights and limitations under the License.
39: //
40: // The Original Code is: all this file.
41: //
42: // The Initial Developer of the Original Code is Michael H. Kay.
43: //
44: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
45: //
46: // Contributor(s): none.
47: //
|