cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Josten <Geert.Jos...@daidalos.nl>
Subject Re: XPath function
Date Wed, 22 Jun 2005 06:17:06 GMT
In short:

- download the latest saxon.jar (saxon 8+), free available for non-commercial use i believe..
- add the following to the cocoon.xconf:
   <!--+
       | Saxon XSLT Processor
       | For old (6.5.2) Saxon use:
       |  <parameter name="transformer-factory" value="com.icl.saxon.TransformerFactoryImpl"/>
       | For new (7.x?) Saxon use:
       |  <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/>
       +-->
   <!-- configured for saxon 8 -->
   <component logger="core.xslt-processor"
              role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon"
              class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl">
      <parameter name="use-store" value="true"/>
      <parameter name="incremental-processing" value="false"/>
      <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/>
   </component>

(a similar section is already there)

- add the following to the top-level sitemap (if you want to have it available everywhere):

     <map:transformer logger="sitemap.transformer.saxon" name="saxon" pool-grow="2" pool-max="32"

pool-min="8" src="org.apache.cocoon.transformation.TraxTransformer">
       <use-request-parameters>false</use-request-parameters>
       <use-session-parameters>false</use-session-parameters>
       <use-cookie-parameters>false</use-cookie-parameters>
       <use-browser-capabilities-db>false</use-browser-capabilities-db>
       <xslt-processor-role>saxon</xslt-processor-role>
       <check-includes>true</check-includes>
     </map:transformer>

- and use <transform type="saxon" ... /> instead of <transform type="xslt" ... />

Fun thing is that you can use Xalan and Saxon beside each other and choose for each conversion
which 
parser to use...

I recommend to stick to Xalan (type xslt) for XSLT 1 type stylesheets. Makes it easier to
recognize 
where you are using Saxon exactly.

HTH,
Geert

Roberto Marra wrote:

> Hi Geert & thanx,
> pls, can you give me some tips&tricks how to do that?
> 
> Cheers
> Roberto
> 
> ----- Original Message ----- 
> From: "Geert Josten" <Geert.Josten@daidalos.nl>
> To: <users@cocoon.apache.org>
> Sent: Tuesday, June 21, 2005 3:50 PM
> Subject: Re: XPath function
> 
> 
> 
>>Hi,
>>
>>That function doesn't exist in XPath 1.0:
>>
>>http://www.w3.org/TR/xpath#section-String-Functions
>>
>>But is a XPath 2.0 function:
>>http://www.w3.org/TR/xquery-operators/
>>
>>If you want to use XPath 2.0 functions, you need to configure a XSLT 2
> 
> compliant parser. For
> 
>>instance the latest Saxon parser.
>>
>>Cheers,
>>Geert
>>
>>Roberto Marra wrote:
>>
>>
>>>Hi guys,
>>>I don't know why with Cocoon some xpath function in an XSLT file works
>>>some other not. Let say for instance that " string-length(/string/)"
>>>works but if I try to use " string-join(/(string,string,...),sep/)"
>>>Cocoon return me:
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

-- 
=====================================
NB: het Daidalos kantoor is sinds 22 april
jl. gevestigd op een nieuw adres:

Daidalos BV
Hoekeindsehof 1 - 4
2665 JZ Bleiswijk
tel: +31 (0)10 850 12 00
fax: +31 (0)10 850 11 99

Bovenstaand adres is tevens het postadres.
======================
Geert.Josten@Daidalos.nl
IT-consultant at Daidalos BV

http://www.daidalos.nl/

GPG: 1024D/12DEBB50

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message