1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 // $Id: URIResolver.java 446598 2006-09-15 12:55:40Z jeremias $
19 
20 package javax.xml.transform;
21 
22 /**
23  * <p>An object that implements this interface that can be called by the processor
24  * to turn a URI used in document(), xsl:import, or xsl:include into a Source object.
25  */
26 public interface URIResolver {
27 
28     /**
29      * Called by the processor when it encounters
30      * an xsl:include, xsl:import, or document() function.
31      *
32      * @param href An href attribute, which may be relative or absolute.
33      * @param base The base URI against which the first argument will be made
34      * absolute if the absolute URI is required.
35      *
36      * @return A Source object, or null if the href cannot be resolved,
37      * and the processor should try to resolve the URI itself.
38      *
39      * @throws TransformerException if an error occurs when trying to
40      * resolve the URI.
41      */
resolve(String href, String base)42     public Source resolve(String href, String base)
43         throws TransformerException;
44 }
45