|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.util.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.xml.AbstractXMLPipe org.apache.cocoon.transformation.AbstractTransformer org.apache.cocoon.transformation.XSLTTransformer
The XSLT stylesheet processor
This Transformer is used to transform the incoming SAX stream using a TrAXProcessor. Use the following sitemap declarations to define, configure and parameterize it:
In the map:sitemap/map:components/map:transformers:<map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer">The <use-request-parameter> configuration forces the transformer to make all request parameters available in the XSLT stylesheet. Note that this has implications for caching of the generated output of this transformer.
<use-request-parameters>false</use-request-parameters> <use-browser-capabilities-db>false</use-browser-capabilities-db> <use-session-info>false</use-session-info> <xslt-processor-role>xslt</xslt-processor-role> <check-includes>true</check-includes> </map:transformer>
The <use-cookies> configuration forces the transformer to make all
cookies from the request available in the XSLT stylesheets.
Note that this has implications for caching of the generated output of this
transformer.
This property is false by default.
The <use-session-info> configuration forces the transformer to make all
of the session information available in the XSLT stylesheetas.
These infos are (boolean values are "true" or "false" strings: session-is-new,
session-id-from-cookie, session-id-from-url, session-valid, session-id.
This property is false by default.
Note that this has implications for caching of the generated output of
this transformer.
The <xslt-processor-role> configuration allows to specify the TrAX processor (defined in
the cocoon.xconf) that will be used to obtain the XSLT processor. This allows to have
several XSLT processors in the configuration (e.g. Xalan, XSLTC, Saxon, ...) and choose
one or the other depending on the needs of stylesheet specificities.
If no processor is specified, this transformer will use the XSLT implementation
that Cocoon uses internally.
The <check-includes> configuration specifies if the included stylesheets are
also checked for changes during caching. If this is set to true (default), the
included stylesheets are also checked for changes; if this is set to false, only
the main stylesheet is checked. Setting this to false improves the performance,
and should be used whenever no includes are in the stylesheet. However, if
you have includes, you have to be careful when changing included stylesheets
as the changes might not take effect immediately. You should touch the main
stylesheet as well.
In a map:sitemap/map:pipelines/map:pipeline:
<map:transform type="xslt" src="stylesheets/yours.xsl">All <parameter> declarations will be made available in the XSLT stylesheet as xsl:variables.
<parameter name="myparam" value="myvalue"/> </map:transform>
Field Summary | |
protected Map |
logicSheetParameters
Logicsheet parameters (protected because used by subclasses) |
protected ServiceManager |
manager
The service manager instance (protected because used by subclasses) |
protected Map |
objectModel
The object model (protected because used by subclasses) |
protected TransformerHandler |
transformerHandler
The trax TransformerHandler |
protected SourceValidity |
transformerValidity
The validity of the Transformer |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
ROLE |
Constructor Summary | |
XSLTTransformer()
|
Method Summary | |
void |
configure(Configuration conf)
Configure this transformer. |
void |
dispose()
Disposable |
void |
endDocument()
Fix for stopping hanging threads of Xalan |
Serializable |
getKey()
Generate the unique key. |
protected Map |
getLogicSheetParameters()
Get the parameters for the logicsheet |
SourceValidity |
getValidity()
Generate the validity object. |
void |
recycle()
Recyclable |
void |
service(ServiceManager manager)
Set the current ServiceManager instance used by this
Serviceable . |
void |
setConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
Set the XMLConsumer that will receive XML data. |
void |
setup(org.apache.cocoon.environment.SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
Set the SourceResolver , the Map with
the object model, the source and sitemap
Parameters used to process the request. |
void |
startDocument()
|
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
characters, comment, endCDATA, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startElement, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
characters, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Field Detail |
protected ServiceManager manager
protected Map objectModel
protected Map logicSheetParameters
protected TransformerHandler transformerHandler
protected SourceValidity transformerValidity
Constructor Detail |
public XSLTTransformer()
Method Detail |
public void configure(Configuration conf) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public void service(ServiceManager manager) throws ServiceException
ServiceManager
instance used by this
Serviceable
.
service
in interface Serviceable
ServiceException
public void setup(org.apache.cocoon.environment.SourceResolver resolver, Map objectModel, String src, Parameters par) throws SAXException, org.apache.cocoon.ProcessingException, IOException
SourceResolver
, the Map
with
the object model, the source and sitemap
Parameters
used to process the request.
setup
in interface org.apache.cocoon.sitemap.SitemapModelComponent
SAXException
org.apache.cocoon.ProcessingException
IOException
public Serializable getKey()
getKey
in interface org.apache.cocoon.caching.CacheableProcessingComponent
public SourceValidity getValidity()
getValidity
in interface org.apache.cocoon.caching.CacheableProcessingComponent
null
if the
component is currently not cacheable.public void setConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
XMLConsumer
that will receive XML data.
setConsumer
in interface org.apache.cocoon.xml.XMLProducer
protected Map getLogicSheetParameters()
public void dispose()
dispose
in interface Disposable
public void recycle()
recycle
in interface Recyclable
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |