org.apache.fulcrum.xslt
Class XSLTServiceFacade

java.lang.Object
  extended by org.apache.fulcrum.xslt.XSLTServiceFacade

public class XSLTServiceFacade
extends Object

This is a static accesor class for XSLTService.

Author:
Leon Messerschmidt, Thomas Vandahl

Constructor Summary
XSLTServiceFacade()
           
 
Method Summary
protected static XSLTService getService()
          Utility method for accessing the service implementation
protected static void setService(XSLTService xsltService)
          Static utility method to set the service instance to be used in the facade
 String transform(String xslName, Map params)
          Uses an xsl file without any xml input.
 String transform(String xslName, Node in)
          Uses an xsl file to transform xml input from a DOM note and returns a string containing the transformed output.
 void transform(String xslName, Node in, Writer out)
          Uses an xsl file to transform xml input from a DOM note and writes the output to a writer.
static String transform(String xslName, Reader in)
          Uses an xsl file to transform xml input from a reader and returns a string containing the transformed output.
static void transform(String xslName, Reader in, Writer out)
          Uses an xsl file to transform xml input from a reader and writes the output to a writer.
 void transform(String xslName, Writer out, Map params)
          Uses an xsl file without any xml input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLTServiceFacade

public XSLTServiceFacade()
Method Detail

getService

protected static XSLTService getService()
Utility method for accessing the service implementation

Returns:
a XSLTService implementation instance

setService

protected static void setService(XSLTService xsltService)
Static utility method to set the service instance to be used in the facade

Parameters:
xsltService - the service instance

transform

public static void transform(String xslName,
                             Reader in,
                             Writer out)
                      throws Exception
Uses an xsl file to transform xml input from a reader and writes the output to a writer.

Parameters:
xslName - The name of the file that contains the xsl stylesheet.
in - The reader that passes the xml to be transformed
out - The writer for the transformed output
Throws:
Exception - the transformation failed

transform

public static String transform(String xslName,
                               Reader in)
                        throws Exception
Uses an xsl file to transform xml input from a reader and returns a string containing the transformed output.

Parameters:
xslName - The name of the file that contains the xsl stylesheet.
in - The reader that passes the xml to be transformed
Returns:
the transformed output
Throws:
Exception - the transformation failed

transform

public void transform(String xslName,
                      Node in,
                      Writer out)
               throws Exception
Uses an xsl file to transform xml input from a DOM note and writes the output to a writer.

Parameters:
xslName - The name of the file that contains the xsl stylesheet.
in - The DOM Node to be transformed
out - The writer for the transformed output
Throws:
Exception - the transformation failed

transform

public String transform(String xslName,
                        Node in)
                 throws Exception
Uses an xsl file to transform xml input from a DOM note and returns a string containing the transformed output.

Parameters:
xslName - The name of the file that contains the xsl stylesheet.
in - The DOM Node to be transformed
Returns:
the transformed output
Throws:
Exception - the transformation failed

transform

public String transform(String xslName,
                        Map params)
                 throws Exception
Uses an xsl file without any xml input.

Parameters:
xslName - The name of the file that contains the xsl stylesheet.
params - A set of parameters that will be forwarded to the XSLT
Returns:
the transformed output
Throws:
Exception - the transformation failed

transform

public void transform(String xslName,
                      Writer out,
                      Map params)
               throws Exception
Uses an xsl file without any xml input.

Parameters:
xslName - The name of the file that contains the xsl stylesheet
out - The writer for the transformed output.
params - A set of parameters that will be forwarded to the XSLT
Throws:
Exception - the transformation failed


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.