KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > turbine > services > xslt > TurbineXSLT


1 package org.apache.turbine.services.xslt;
2
3 /*
4  * Copyright 2001-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License")
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import java.io.Reader JavaDoc;
20 import java.io.Writer JavaDoc;
21
22 import org.apache.turbine.services.TurbineServices;
23
24 import org.w3c.dom.Node JavaDoc;
25
26 /**
27  * This is a static accesor class for {@link XSLTService}.
28  *
29  * @author <a HREF="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
30  * @version $Id: TurbineXSLT.java,v 1.4.2.2 2004/05/20 03:06:52 seade Exp $
31  */

32 public class TurbineXSLT
33 {
34     /**
35      * Utility method for accessing the service
36      * implementation
37      *
38      * @return a XSLTService implementation instance
39      */

40     protected static XSLTService getService()
41     {
42         return (XSLTService) TurbineServices
43                 .getInstance().getService(XSLTService.SERVICE_NAME);
44     }
45
46     public static void transform(String JavaDoc xslName, Reader JavaDoc in, Writer JavaDoc out)
47             throws Exception JavaDoc
48     {
49         getService().transform(xslName, in, out);
50     }
51
52     public static String JavaDoc transform(String JavaDoc xslName, Reader JavaDoc in)
53             throws Exception JavaDoc
54     {
55         return getService().transform(xslName, in);
56     }
57
58     public void transform(String JavaDoc xslName, Node JavaDoc in, Writer JavaDoc out)
59             throws Exception JavaDoc
60     {
61         getService().transform(xslName, in, out);
62     }
63
64     public String JavaDoc transform(String JavaDoc xslName, Node JavaDoc in)
65             throws Exception JavaDoc
66     {
67         return getService().transform(xslName, in);
68     }
69 }
70
Popular Tags