home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Copyright 1999-2004 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
- <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "document-v10.dtd">
-
- <document>
- <header>
- <title>XSLT Transformer</title>
- <version>0.9</version>
- <type>Technical document</type>
- <authors>
- <person name="Carsten Ziegeler" email="cziegeler@apache.org"/>
- <person name="Sylvain Wallez" email="sylvain@apache.org"/>
- </authors>
- <abstract>This document describes the xslt transformer of Cocoon.</abstract>
- </header>
- <body>
- <s1 title="Trax/XSLT Transformer">
- <p>The xslt transformer reads an xsl document from the local file system or from any url.
- It transforms the sax stream using this stylesheet.</p>
- <p>The xslt transformer is the default transformer .</p>
- <ul>
- <li>Name : xslt</li>
- <li>Class: org.apache.cocoon.transformation.TraxTransformer</li>
- <li>Cacheable: yes - uses the last modification date of the xsl document for validation.</li>
- </ul>
- <p>The xslt transformer is configurable. You can specify one or more of
- the following configuration information:</p>
- <ul>
- <li>use-request-parameters: true|false - Setting this to true makes all
- request parameters available in the XSLT stylesheet. Note that this might
- have issues concerning cachability of the generated output of this transformer,
- the caching algorithm not only checks the last modification date but also
- all values of the request parameters.
- This property is false by default. If set to true the values of a request
- parameter is available using a variable in the xslt with the name of the parameter.</li>
- <li>use-browser-capabilities-db: true|false - This configuration forces the transformer to make all
- properties from the browser capability database available in the XSLT stylesheet as.
- Note that this might have issues concerning cachability of the generated output of this
- transformer as the caching algorithm adds this values to the validation phase.
- The default for this property is false.</li>
- <li>use-cookies: true|false - This configuration forces the transformer to make all
- cookies from the request available in the XSLT stylesheetas.
- Note that this might have issues concerning cachability of the generated output of this
- transformer. This property is false by default.</li>
- <li>xslt-processor-role: [role name] - This configuration allows to specify the XSLT processor (see below)
- that will be used by its role name. This allows to have several XSLT processors in the configuration
- (e.g. Xalan and Saxon) and choose one or the other depending on the needs of stylesheet
- specificities. This property defaults to "org.apache.cocoon.components.xslt.XSLTProcessor"
- which is the standard role name for an XSLTProcessor.</li>
- </ul>
- <p>The "use-request-parameters" and "use-browser-capabilities-db" configuration
- of a transformer can be changed for one single pipeline by specifying
- parameters with the same name:</p>
- <source>
- <![CDATA[
- <map:transform src="stylesheet.xsl" type="xslt"/>
- <!-- The type attribute can be omitted as it is the default transformer. -->
- ]]>
- </source>
- <p>The "use-request-parameters" and "use-browser-capabilities-db" configuration
- of a transformer can be changed for one single pipeline by specifying
- parameters with the same name:</p>
- <source>
- <![CDATA[
- <map:transform src="stylesheet.xsl">
- <map:parameter name="use-request-parameters" value="true"/>
- </map:transform>
- ]]>
- </source>
- <p>In addition all other parameters to the transformer are
- available in the stylesheet as <xsl:param/>s (These values
- are also used in the caching algorithm.)</p>
- </s1>
- <s1 title="The XSLT Processor">
- <p>The XSLT Transformer uses a component called XSLTProcessor. This component is
- configured in the cocoon.xconf. You can configure it as follows:</p>
- <ul>
- <li>use-store: true|false - If set to true it forces the xslt processor
- to put the generated templates from the XSLT stylesheet into the
- system store. This property is true by default.</li>
- <li>transformer-factory: [class name] - tells the transformer to use a particular
- implementation of javax.xml.transform.TransformerFactory. This allows to force the use of
- a given TRAX implementation (e.g. xalan or saxon) if several are available in the classpath.
- If this property is not set, the transformer uses the standard TRAX mechanism
- (TransformerFactory.newInstance()).</li>
- </ul>
- </s1>
- </body>
- </document>
-