1 package org.apache.turbine.services.xslt;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.io.Reader;
20 import java.io.Writer;
21
22 import org.apache.turbine.services.Service;
23
24 import org.w3c.dom.Node;
25
26 /***
27 * The Turbine XSLT Service is used to transform xml with a xsl stylesheet.
28 * The service makes use of the Xalan xslt engine available from apache.
29 *
30 * @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
31 * @version $Id: XSLTService.java,v 1.5.2.2 2004/05/20 03:06:52 seade Exp $
32 */
33 public interface XSLTService
34 extends Service
35 {
36 /*** Service name */
37 String SERVICE_NAME = "XSLTService";
38
39 /*** Name of the Style sheet path property */
40 String STYLESHEET_PATH = "path";
41
42 /*** Property for caching the stylesheets */
43 String STYLESHEET_CACHING = "cache";
44
45 /***
46 * Uses an xsl file to transform xml input from a reader and writes the
47 * output to a writer.
48 *
49 * @param xslName The name of the file that contains the xsl stylesheet.
50 * @param in The reader that passes the xml to be transformed
51 * @param out The writer for the transformed output
52 */
53 void transform(String xslName, Reader in, Writer out) throws Exception;
54
55 /***
56 * Uses an xsl file to transform xml input from a reader and returns a
57 * string containing the transformed output.
58 *
59 * @param xslName The name of the file that contains the xsl stylesheet.
60 * @param in The reader that passes the xml to be transformed
61 */
62 String transform(String xslName, Reader in) throws Exception;
63
64 /***
65 * Uses an xsl file to transform xml input from a DOM note and writes the
66 * output to a writer.
67 *
68 * @param xslName The name of the file that contains the xsl stylesheet.
69 * @param in The DOM Node to be transformed
70 * @param out The writer for the transformed output
71 */
72 void transform(String xslName, Node in, Writer out) throws Exception;
73
74 /***
75 * Uses an xsl file to transform xml input from a DOM note and returns a
76 * string containing the transformed output.
77 *
78 * @param xslName The name of the file that contains the xsl stylesheet.
79 * @param out The writer for the transformed output
80 */
81 String transform(String xslName, Node in) throws Exception;
82 }