01: package org.apache.turbine.services.xslt;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "License"); you may not use this file except in compliance
10: * with the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17: * KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations
19: * under the License.
20: */
21:
22: import java.io.Reader;
23: import java.io.Writer;
24: import java.util.Map;
25:
26: import org.apache.turbine.services.TurbineServices;
27: import org.w3c.dom.Node;
28:
29: /**
30: * This is a static accesor class for {@link XSLTService}.
31: *
32: * @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
33: * @author <a href="thomas.vandahl@tewisoft.de">Thomas Vandahl</a>
34: * @version $Id: TurbineXSLT.java 534527 2007-05-02 16:10:59Z tv $
35: */
36: public class TurbineXSLT {
37: /**
38: * Utility method for accessing the service
39: * implementation
40: *
41: * @return a XSLTService implementation instance
42: */
43: protected static XSLTService getService() {
44: return (XSLTService) TurbineServices.getInstance().getService(
45: XSLTService.SERVICE_NAME);
46: }
47:
48: public static void transform(String xslName, Reader in, Writer out)
49: throws Exception {
50: getService().transform(xslName, in, out);
51: }
52:
53: public static String transform(String xslName, Reader in)
54: throws Exception {
55: return getService().transform(xslName, in);
56: }
57:
58: public void transform(String xslName, Node in, Writer out)
59: throws Exception {
60: getService().transform(xslName, in, out);
61: }
62:
63: public String transform(String xslName, Node in) throws Exception {
64: return getService().transform(xslName, in);
65: }
66:
67: public static void transform(String xslName, Reader in, Writer out,
68: Map params) throws Exception {
69: getService().transform(xslName, in, out, params);
70: }
71:
72: public static String transform(String xslName, Reader in, Map params)
73: throws Exception {
74: return getService().transform(xslName, in, params);
75: }
76:
77: public void transform(String xslName, Node in, Writer out,
78: Map params) throws Exception {
79: getService().transform(xslName, in, out, params);
80: }
81:
82: public String transform(String xslName, Node in, Map params)
83: throws Exception {
84: return getService().transform(xslName, in, params);
85: }
86: }
|