01: package net.sf.saxon;
02:
03: import javax.xml.transform.Result;
04: import javax.xml.transform.TransformerException;
05:
06: /**
07: * This interface defines an OutputURIResolver. This is a counterpart to the JAXP
08: * URIResolver, but is used to map the URI of a secondary result document to a Result object
09: * which acts as the destination for the new document.
10: * @author Michael H. Kay
11: */
12:
13: public interface OutputURIResolver {
14:
15: /**
16: * Resolve an output URI.
17: * @param href The relative URI of the output document. This corresponds to the
18: * href attribute of the xsl:result-document instruction.
19: * @param base The base URI that should be used. This is the base URI of the
20: * element that contained the href attribute. It may be null if no systemID was supplied
21: * for the stylesheet.
22: * @return a Result object representing the destination for the XML document. The
23: * method can also return null, in which case the standard output URI resolver
24: * will be used to create a Result object.
25: */
26:
27: public Result resolve(String href, String base)
28: throws TransformerException;
29:
30: /**
31: * Signal completion of the result document. This method is called by the system
32: * when the result document has been successfully written. It allows the resolver
33: * to perform tidy-up actions such as closing output streams, or firing off
34: * processes that take this result tree as input. Note that the OutputURIResolver
35: * is stateless, so the the original Result object is supplied to identify the document
36: * that has been completed.
37: * @param result The result object returned by the previous call of resolve()
38: */
39:
40: public void close(Result result) throws TransformerException;
41:
42: }
43:
44: //
45: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
46: // you may not use this file except in compliance with the License. You may obtain a copy of the
47: // License at http://www.mozilla.org/MPL/
48: //
49: // Software distributed under the License is distributed on an "AS IS" basis,
50: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
51: // See the License for the specific language governing rights and limitations under the License.
52: //
53: // The Original Code is: all this file.
54: //
55: // The Initial Developer of the Original Code is Michael H. Kay
56: //
57: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
58: //
59: // Contributor(s): none.
60: //
|