org.weborganic.ox.util
Class XSLT

java.lang.Object
  extended by org.weborganic.ox.util.XSLT

public class XSLT
extends Object

Version:
28 October 2013
Author:
Christophe Lauret

Method Summary
 void clearCache()
          Clears the internal XSLT cache.
static Templates getTemplates(File file)
          Return the XSLT templates from the given style.
static Templates getTemplates(URL url)
          Return the XSLT templates from the given style.
static Templates getTemplatesFromResource(String resource)
          Return the XSLT templates from the given style.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTemplates

public static Templates getTemplates(URL url)
                              throws TransformerConfigurationException,
                                     IOException
Return the XSLT templates from the given style.

Parameters:
url - A URL to a template.
Returns:
the corresponding XSLT templates object or null if the URL was null.
Throws:
TransformerConfigurationException - If XSLT templates could not be loaded from the specified URL.
IOException - If an IO error occur while reading the template

getTemplates

public static Templates getTemplates(File file)
                              throws TransformerConfigurationException,
                                     IOException
Return the XSLT templates from the given style.

Parameters:
file - A file to a template.
Returns:
the corresponding XSLT templates object or null if the URL was null.
Throws:
TransformerConfigurationException - If XSLT templates could not be loaded from the specified URL.
IOException - If an IO error occur while reading the template

getTemplatesFromResource

public static Templates getTemplatesFromResource(String resource)
                                          throws TransformerConfigurationException,
                                                 IOException
Return the XSLT templates from the given style.

This method will firt try to load the resource using the class loader used for this class.

Use this class to load XSLT from the system.

Parameters:
resource - The path to a resource.
Returns:
the corresponding XSLT templates object; or null if the resource could not be found.
Throws:
TransformerConfigurationException - If XSLT templates could not be loaded from the specified resource.
IOException - If an IO error occur while reading the template

clearCache

public void clearCache()
Clears the internal XSLT cache.