|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.turbine.services.xslt.TurbineXSLTService
Implementation of the Turbine XSLT Service. It transforms xml with a given xsl file. XSL stylesheets are compiled and cached (if the property in TurbineResources.properties is set) to improve speeds.
Field Summary | |
protected boolean |
caching
Property to control the caching of StyleSheetRoots. |
protected java.lang.String |
path
Path to style sheets used for tranforming well-formed XML documents. |
Fields inherited from class org.apache.turbine.services.BaseService |
configuration, name, serviceBroker |
Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
Fields inherited from interface org.apache.turbine.services.xslt.XSLTService |
SERVICE_NAME, STYLESHEET_CACHING, STYLESHEET_CACHING_DEFAULT, STYLESHEET_PATH, STYLESHEET_PATH_DEFAULT |
Constructor Summary | |
TurbineXSLTService()
|
Method Summary | |
protected javax.xml.transform.Templates |
compileTemplates(java.net.URL source)
Compile Templates from an input URL. |
protected javax.xml.transform.Templates |
getTemplates(java.lang.String xslName)
Retrieves Templates. |
void |
init()
Initialize the TurbineXSLT Service. |
java.lang.String |
transform(java.lang.String xslName,
org.w3c.dom.Node in)
Execute an xslt |
java.lang.String |
transform(java.lang.String xslName,
org.w3c.dom.Node in,
java.util.Map params)
Execute an xslt |
void |
transform(java.lang.String xslName,
org.w3c.dom.Node in,
java.io.Writer out)
Execute an xslt |
void |
transform(java.lang.String xslName,
org.w3c.dom.Node in,
java.io.Writer out,
java.util.Map params)
Execute an xslt |
java.lang.String |
transform(java.lang.String xslName,
java.io.Reader in)
Execute an xslt |
java.lang.String |
transform(java.lang.String xslName,
java.io.Reader in,
java.util.Map params)
Execute an xslt |
void |
transform(java.lang.String xslName,
java.io.Reader in,
java.io.Writer out)
Execute an xslt |
void |
transform(java.lang.String xslName,
java.io.Reader in,
java.io.Writer out,
java.util.Map params)
Execute an xslt |
protected void |
transform(java.lang.String style,
javax.xml.transform.Source in,
javax.xml.transform.Result out,
java.util.Map params)
Transform the input source into the output source using the given style |
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, init, init, shutdown |
Methods inherited from class org.apache.turbine.services.BaseService |
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.turbine.services.Service |
getConfiguration, getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, init, setInitableBroker, shutdown |
Field Detail |
protected boolean caching
protected java.lang.String path
Constructor Detail |
public TurbineXSLTService()
Method Detail |
public void init() throws InitializationException
init
in interface Initable
init
in class TurbineBaseService
InitializationException
protected javax.xml.transform.Templates compileTemplates(java.net.URL source) throws java.lang.Exception
java.lang.Exception
protected javax.xml.transform.Templates getTemplates(java.lang.String xslName) throws java.lang.Exception
This method is synchronized on the xsl cache so that a thread does not attempt to load a StyleSheetRoot from the cache while it is still being compiled.
java.lang.Exception
protected void transform(java.lang.String style, javax.xml.transform.Source in, javax.xml.transform.Result out, java.util.Map params) throws javax.xml.transform.TransformerException, java.io.IOException, java.lang.Exception
style
- the stylesheet parameterin
- the input sourceout
- the output sourceparams
- XSLT parameter for the style sheet
javax.xml.transform.TransformerException
java.io.IOException
java.lang.Exception
public void transform(java.lang.String xslName, java.io.Reader in, java.io.Writer out) throws java.lang.Exception
transform
in interface XSLTService
xslName
- The name of the file that contains the xsl stylesheet.in
- The reader that passes the xml to be transformedout
- The writer for the transformed output
java.lang.Exception
public java.lang.String transform(java.lang.String xslName, java.io.Reader in) throws java.lang.Exception
transform
in interface XSLTService
xslName
- The name of the file that contains the xsl stylesheet.in
- The reader that passes the xml to be transformed
java.lang.Exception
public void transform(java.lang.String xslName, org.w3c.dom.Node in, java.io.Writer out) throws java.lang.Exception
transform
in interface XSLTService
xslName
- The name of the file that contains the xsl stylesheet.in
- The DOM Node to be transformedout
- The writer for the transformed output
java.lang.Exception
public java.lang.String transform(java.lang.String xslName, org.w3c.dom.Node in) throws java.lang.Exception
transform
in interface XSLTService
xslName
- The name of the file that contains the xsl stylesheet.
java.lang.Exception
public void transform(java.lang.String xslName, java.io.Reader in, java.io.Writer out, java.util.Map params) throws java.lang.Exception
transform
in interface XSLTService
xslName
- The name of the file that contains the xsl stylesheet.in
- The reader that passes the xml to be transformedout
- The writer for the transformed outputparams
- A set of parameters that will be forwarded to the XSLT
java.lang.Exception
public java.lang.String transform(java.lang.String xslName, java.io.Reader in, java.util.Map params) throws java.lang.Exception
transform
in interface XSLTService
xslName
- The name of the file that contains the xsl stylesheet.in
- The reader that passes the xml to be transformedparams
- A set of parameters that will be forwarded to the XSLT
java.lang.Exception
public void transform(java.lang.String xslName, org.w3c.dom.Node in, java.io.Writer out, java.util.Map params) throws java.lang.Exception
transform
in interface XSLTService
xslName
- The name of the file that contains the xsl stylesheet.in
- The DOM Node to be transformedout
- The writer for the transformed outputparams
- A set of parameters that will be forwarded to the XSLT
java.lang.Exception
public java.lang.String transform(java.lang.String xslName, org.w3c.dom.Node in, java.util.Map params) throws java.lang.Exception
transform
in interface XSLTService
xslName
- The name of the file that contains the xsl stylesheet.params
- A set of parameters that will be forwarded to the XSLT
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |