forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ferdinand Soethe <ferdin...@apache.org>
Subject How to use a different transformer (Was Re: X-Versions supported by Forrest)
Date Wed, 10 Aug 2005 16:59:18 GMT


> Ferdinand Soethe wrote:

>> Antonio Gallardo wrote:

>> Forrest is built on Apache Cocoon. Cocoon can use saxon as the XSLT
>> processor. Saxon supports xpath v2. That means is posible to use xpath v2
>> right now in forrest.

> Thanks. That is good to know. If I really need XPath 2 I'll try to figure out
> how. But I think I'd rather stick with the standard distribution as
> long as I can.

OK, time to follow up on this. I now do need XPATH and XSLT2 and
would like to use Saxon instead.

As far as I understand sitemap.xmap configures

> <map:transformers default="xslt">

Which I read as saying that the default transformer is xslt (further
down resolved to org.apache.cocoon.transformation.TraxTransformer)

and also offers Saxon as an alternative

> <map:transformer name="xslt-saxon"
>          pool-grow="2" pool-max="32" pool-min="8"
>          src="org.apache.cocoon.transformation.TraxTransformer">
>        <use-request-parameters>false</use-request-parameters>
>        <use-browser-capabilities-db>false</use-browser-capabilities-db>
>        <xslt-processor-role>saxon</xslt-processor-role>
>      </map:transformer>

So my conclusion would be that I'd only have to replace

> <map:transformers default="xslt">

with

> <map:transformers default="xslt-saxon">

to use Saxon in my Forrest.


However in main\webapp\WEB-INF\xconf\forrest-core.xconf I found

>  <!--+
>       | XSLT Processor
>       |
>       | 'incremental-processing' (only works with Xalan) allows the XSLT
>       | processor to start the output of the transformation as soon as possible.
>       | if set to false, the transforer waits until the end of the
>       | transformation to deliver the output.
>       | WARNING: * if you enable incremental-processing, you should be aware of
>       |            the following bug:
>       |            http://issues.apache.org/bugzilla/show_bug.cgi?id=13186
>       |          * incremental-processing creates an additional, non-pooled thread.
>       |          * using incremental-processing does not save memory, the input
>       |            tree will still be build completely.
>       |          * incremental processing is a 'static' thing in Xalan: if you
>       |            enable it on one xslt-processor, enable it on all.
>       +-->
>   <xslt-processor logger="core.xslt-processor">
>      <parameter name="use-store" value="true"/>
>      <parameter name="incremental-processing" value="false"/>
>   </xslt-processor>
> 
>   <!--+
>       | XSLT Processor using xsltc from Xalan
>       | For Interpreted Xalan use:
>       | <transformer-factory>org.apache.xalan.processor.TransformerFactoryImpl</transformer-factory>
>       +-->
>   <component class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl" logger="core.xslt-processor"
role="org.apache.excalibur.xml.xslt.XSLTProcessor/xsltc">
>      <parameter name="use-store" value="false"/>
>      <parameter name="transformer-factory" value="org.apache.xalan.xsltc.trax.TransformerFactoryImpl"/>
>   </component>
>   
>   <!--+
>       | Xalan XSLT Processor
>       +-->
>   <component class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl" logger="core.xslt-processor"
role="org.apache.excalibur.xml.xslt.XSLTProcessor/xalan">
>      <parameter name="use-store" value="false"/>
>      <parameter name="incremental-processing" value="false"/>
>      <parameter name="transformer-factory" value="org.apache.xalan.processor.TransformerFactoryImpl"/>
>   </component>
> 
>   <!--+
>       | Saxon XSLT Processor
>       | For old (6.5.2) Saxon use:
>       |  <parameter name="transformer-factory" value="com.icl.saxon.TransformerFactoryImpl"/>
>       | For new (7+) Saxon use:
>       |  <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/>
>   +-->


> <map:transformers default="xslt">

and I'm not sure how these are related. Do I need to worry about that
at all.

And will setting the default transformer also make Forrest use
it for processing XPATH expression (because I see that the above
mentioned file configures that separately)

<!-- Xpath Processor: -->
  <xpath-processor class="org.apache.excalibur.xml.xpath.XPathProcessorImpl" logger="core.xpath-processor"/>

Thanks for any help on this.

--
Ferdinand Soethe


Mime
View raw message