org.infohazard.maverick.transform
Class XSLTransformFactory

java.lang.Object
  |
  +--org.infohazard.maverick.transform.XSLTransformFactory
All Implemented Interfaces:
TransformFactory

public class XSLTransformFactory
extends java.lang.Object
implements TransformFactory

Version:
$Revision: 1.9 $ $Date: 2002/06/07 10:14:37 $

Factory for creating transformation pipelines using XSLT.

This factory has certain options which can be defined when declaring the factory. The defaults are shown here:

 <transform-factory type="xslt" provider="org.infohazard.maverick.transform.XSLTransformFactory">
   <default-output-type value="text/html"/>
   <template-caching value="preload"/>
   <uri-resolver value=""/>
 </transform-factory>
 

The options for an individual transform are like this:

 <transform type="xslt" path="blah.xsl" output-type="text/plain"/>
 
Author:
Jeff Schnitzer, Scott Hernandez

Field Summary
protected static java.lang.String ATTR_DEFAULT_FINAL_CONTENT_TYPE
          For the factory configuration
protected static java.lang.String ATTR_FINAL_CONTENT_TYPE
           
protected static java.lang.String ATTR_PATH
          For individual transform nodes
protected static java.lang.String ATTR_TEMPLATE_CACHING
           
protected static java.lang.String ATTR_URI_RESOLVER
           
protected static java.lang.String DEFAULT_DEFAULT_FINAL_CONTENT_TYPE
          If the init param for default content type is not specified, this becomes the actual default final content type.
protected  java.lang.String defaultFinalContentType
          Unless specified in individual transform nodes, this is the content type for a successfully completed transformation.
protected  javax.servlet.ServletContext servletCtx
          We need this to be able to look up real pathnames.
protected  int templateCachingStyle
          Should templates be preloaded and cached
protected  javax.xml.transform.URIResolver uriResolver
          Allow the user to override the URI resolver.
protected static java.lang.String VAL_TEMPLATE_CACHING_DISABLED
           
protected static java.lang.String VAL_TEMPLATE_CACHING_LAZY
           
protected static java.lang.String VAL_TEMPLATE_CACHING_PRELOAD
           
 
Constructor Summary
XSLTransformFactory()
           
 
Method Summary
 Transform createTransform(org.jdom.Element transformNode)
          Creates a transform from the element (and any children, if appropriate).
 void init(org.jdom.Element factoryNode, javax.servlet.ServletConfig servletCfg)
          Factories will be initialized with the XML from the configuration file so that they can check for any options defined in child nodes, attributes, etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_DEFAULT_FINAL_CONTENT_TYPE

protected static final java.lang.String ATTR_DEFAULT_FINAL_CONTENT_TYPE
For the factory configuration

See Also:
Constant Field Values

ATTR_TEMPLATE_CACHING

protected static final java.lang.String ATTR_TEMPLATE_CACHING
See Also:
Constant Field Values

VAL_TEMPLATE_CACHING_LAZY

protected static final java.lang.String VAL_TEMPLATE_CACHING_LAZY
See Also:
Constant Field Values

VAL_TEMPLATE_CACHING_PRELOAD

protected static final java.lang.String VAL_TEMPLATE_CACHING_PRELOAD
See Also:
Constant Field Values

VAL_TEMPLATE_CACHING_DISABLED

protected static final java.lang.String VAL_TEMPLATE_CACHING_DISABLED
See Also:
Constant Field Values

ATTR_URI_RESOLVER

protected static final java.lang.String ATTR_URI_RESOLVER
See Also:
Constant Field Values

ATTR_PATH

protected static final java.lang.String ATTR_PATH
For individual transform nodes

See Also:
Constant Field Values

ATTR_FINAL_CONTENT_TYPE

protected static final java.lang.String ATTR_FINAL_CONTENT_TYPE
See Also:
Constant Field Values

DEFAULT_DEFAULT_FINAL_CONTENT_TYPE

protected static final java.lang.String DEFAULT_DEFAULT_FINAL_CONTENT_TYPE
If the init param for default content type is not specified, this becomes the actual default final content type. The default default :-)

See Also:
Constant Field Values

defaultFinalContentType

protected java.lang.String defaultFinalContentType
Unless specified in individual transform nodes, this is the content type for a successfully completed transformation.


templateCachingStyle

protected int templateCachingStyle
Should templates be preloaded and cached


uriResolver

protected javax.xml.transform.URIResolver uriResolver
Allow the user to override the URI resolver.


servletCtx

protected javax.servlet.ServletContext servletCtx
We need this to be able to look up real pathnames.

Constructor Detail

XSLTransformFactory

public XSLTransformFactory()
Method Detail

init

public void init(org.jdom.Element factoryNode,
                 javax.servlet.ServletConfig servletCfg)
          throws ConfigException
Description copied from interface: TransformFactory
Factories will be initialized with the XML from the configuration file so that they can check for any options defined in child nodes, attributes, etc.

Specified by:
init in interface TransformFactory
Parameters:
factoryNode - The XML from which to draw configuration information.
servletCfg - Information about the container.
Throws:
ConfigException - Thrown if configuration is bad.

createTransform

public Transform createTransform(org.jdom.Element transformNode)
                          throws ConfigException
Description copied from interface: TransformFactory
Creates a transform from the element (and any children, if appropriate).

Specified by:
createTransform in interface TransformFactory
Parameters:
transformNode -
Returns:
Throws:
ConfigException