001: package org.apache.turbine.services.xslt;
002:
003: /*
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021:
022: import java.io.Reader;
023: import java.io.Writer;
024: import java.util.Map;
025:
026: import org.apache.turbine.services.Service;
027: import org.w3c.dom.Node;
028:
029: /**
030: * The Turbine XSLT Service is used to transform xml with a xsl stylesheet.
031: * The service makes use of the Xalan xslt engine available from apache.
032: *
033: * @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
034: * @author <a href="thomas.vandahl@tewisoft.de">Thomas Vandahl</a>
035: * @version $Id: XSLTService.java 534527 2007-05-02 16:10:59Z tv $
036: */
037: public interface XSLTService extends Service {
038: /** Service name */
039: String SERVICE_NAME = "XSLTService";
040:
041: /** Name of the Style sheet path property */
042: String STYLESHEET_PATH = "path";
043:
044: /** Default value of the Style sheet path */
045: String STYLESHEET_PATH_DEFAULT = "/";
046:
047: /** Property for caching the stylesheets */
048: String STYLESHEET_CACHING = "cache";
049:
050: /** Default for caching the stylesheets */
051: boolean STYLESHEET_CACHING_DEFAULT = false;
052:
053: /**
054: * Uses an xsl file to transform xml input from a reader and writes the
055: * output to a writer.
056: *
057: * @param xslName The name of the file that contains the xsl stylesheet.
058: * @param in The reader that passes the xml to be transformed
059: * @param out The writer for the transformed output
060: */
061: void transform(String xslName, Reader in, Writer out)
062: throws Exception;
063:
064: /**
065: * Uses an xsl file to transform xml input from a reader and returns a
066: * string containing the transformed output.
067: *
068: * @param xslName The name of the file that contains the xsl stylesheet.
069: * @param in The reader that passes the xml to be transformed
070: */
071: String transform(String xslName, Reader in) throws Exception;
072:
073: /**
074: * Uses an xsl file to transform xml input from a DOM note and writes the
075: * output to a writer.
076: *
077: * @param xslName The name of the file that contains the xsl stylesheet.
078: * @param in The DOM Node to be transformed
079: * @param out The writer for the transformed output
080: */
081: void transform(String xslName, Node in, Writer out)
082: throws Exception;
083:
084: /**
085: * Uses an xsl file to transform xml input from a DOM note and returns a
086: * string containing the transformed output.
087: *
088: * @param xslName The name of the file that contains the xsl stylesheet.
089: * @param out The writer for the transformed output
090: */
091: String transform(String xslName, Node in) throws Exception;
092:
093: /**
094: * Uses an xsl file to transform xml input from a reader and writes the
095: * output to a writer.
096: *
097: * @param xslName The name of the file that contains the xsl stylesheet.
098: * @param in The reader that passes the xml to be transformed
099: * @param out The writer for the transformed output
100: * @param params A set of parameters that will be forwarded to the XSLT
101: */
102: void transform(String xslName, Reader in, Writer out, Map params)
103: throws Exception;
104:
105: /**
106: * Uses an xsl file to transform xml input from a reader and returns a
107: * string containing the transformed output.
108: *
109: * @param xslName The name of the file that contains the xsl stylesheet.
110: * @param in The reader that passes the xml to be transformed
111: * @param params A set of parameters that will be forwarded to the XSLT
112: */
113: String transform(String xslName, Reader in, Map params)
114: throws Exception;
115:
116: /**
117: * Uses an xsl file to transform xml input from a DOM note and writes the
118: * output to a writer.
119: *
120: * @param xslName The name of the file that contains the xsl stylesheet.
121: * @param in The DOM Node to be transformed
122: * @param out The writer for the transformed output
123: * @param params A set of parameters that will be forwarded to the XSLT
124: */
125: void transform(String xslName, Node in, Writer out, Map params)
126: throws Exception;
127:
128: /**
129: * Uses an xsl file to transform xml input from a DOM note and returns a
130: * string containing the transformed output.
131: *
132: * @param xslName The name of the file that contains the xsl stylesheet.
133: * @param out The writer for the transformed output
134: * @param params A set of parameters that will be forwarded to the XSLT
135: */
136: String transform(String xslName, Node in, Map params)
137: throws Exception;
138: }
|