01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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:
19: package org.apache.tools.ant.taskdefs;
20:
21: import java.io.File;
22:
23: /**
24: * Proxy interface for XSLT processors.
25: *
26: * @see XSLTProcess
27: * @since Ant 1.1
28: */
29: public interface XSLTLiaison {
30:
31: /**
32: * the file protocol prefix for systemid.
33: * This file protocol must be appended to an absolute path.
34: * Typically: <tt>FILE_PROTOCOL_PREFIX + file.getAbsolutePath()</tt>
35: * Note that on Windows, an extra '/' must be appended to the
36: * protocol prefix so that there is always 3 consecutive slashes.
37: * @since Ant 1.4
38: */
39: String FILE_PROTOCOL_PREFIX = "file://";
40:
41: /**
42: * set the stylesheet to use for the transformation.
43: * @param stylesheet the stylesheet to be used for transformation.
44: * @throws Exception thrown if any problems happens.
45: * @since Ant 1.4
46: */
47: void setStylesheet(File stylesheet) throws Exception;
48:
49: /**
50: * Add a parameter to be set during the XSL transformation.
51: * @param name the parameter name.
52: * @param expression the parameter value as an expression string.
53: * @throws Exception thrown if any problems happens.
54: * @since Ant 1.3
55: */
56: void addParam(String name, String expression) throws Exception;
57:
58: /**
59: * Perform the transformation of a file into another.
60: * @param infile the input file, probably an XML one. :-)
61: * @param outfile the output file resulting from the transformation
62: * @throws Exception thrown if any problems happens.
63: * @see #setStylesheet(File)
64: * @since Ant 1.4
65: */
66: void transform(File infile, File outfile) throws Exception;
67:
68: } //-- XSLTLiaison
|