Multiple XSL Transformers

2002-06-04 Thread Jason Foster

I was wondering if it is possible to have both a Xalan-based and a 
Saxon-based transformer active within Cocoon simultaneously?

I am using Xalan's support for BSF-scriptable extensions in a couple of 
places and quite like it's approach.  Unfortunately the current version of 
Xalan can't deal with DocBook and I don't want to use the backlevel version 
that can.  Saxon, on the other hand, can deal with DocBook without too much 
fuss.

So what I'm hoping is that I can declare a XalanTransformer and a 
SaxonTransformer then set up my pipelines accordingly.  Is this possible?  
If so, can anyone offer any suggestions as to how?

Thanks!

Jason Foster


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Multiple XSL Transformers

2002-06-04 Thread Vadim Gritsenko

 From: Jason Foster [mailto:[EMAIL PROTECTED]]
 
 I was wondering if it is possible to have both a Xalan-based and a
 Saxon-based transformer active within Cocoon simultaneously?
 
 I am using Xalan's support for BSF-scriptable extensions in a couple
of
 places and quite like it's approach.  Unfortunately the current
version of
 Xalan can't deal with DocBook and I don't want to use the backlevel
version
 that can.  Saxon, on the other hand, can deal with DocBook without too
much
 fuss.
 
 So what I'm hoping is that I can declare a XalanTransformer and a
 SaxonTransformer then set up my pipelines accordingly.  Is this
possible?

 If so, can anyone offer any suggestions as to how?

Start from TraxTransformer (search for xslt-processor-role) in Cocoon
2.0.3, or TraxTransformer (search for transformer-factory) in Cocoon
2.1; and follow from there.

Vadim


 Thanks!
 
 Jason Foster
 
 


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Multiple XSL Transformers

2002-06-04 Thread Diana Shannon


On Tuesday, June 4, 2002, at 01:48  PM, Vadim Gritsenko wrote:

 Start from TraxTransformer (search for xslt-processor-role) in Cocoon
 2.0.3, or TraxTransformer (search for transformer-factory) in Cocoon
 2.1; and follow from there.

Does this mean it's possible, Vadim, or that Jason should try it to make 
it work in this way? If it's possible, I'd like to add it to the FAQ for 
xslt topics.

Thanks.

Diana


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Multiple XSL Transformers

2002-06-04 Thread Vadim Gritsenko

 From: Diana Shannon [mailto:[EMAIL PROTECTED]]
 
 
 On Tuesday, June 4, 2002, at 01:48  PM, Vadim Gritsenko wrote:
 
  Start from TraxTransformer (search for xslt-processor-role) in
Cocoon
  2.0.3, or TraxTransformer (search for transformer-factory) in
Cocoon
  2.1; and follow from there.
 
 Does this mean it's possible, Vadim, or that Jason should try it to
make
 it work in this way? If it's possible, I'd like to add it to the FAQ
for
 xslt topics.

I think it's possible also I have not tried.

Vadim


 Thanks.
 
 Diana
 


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Multiple XSL Transformers

2002-06-04 Thread Peter Royal

On Tuesday 04 June 2002 02:05 pm, Vadim Gritsenko wrote:
  From: Diana Shannon [mailto:[EMAIL PROTECTED]]
 
  On Tuesday, June 4, 2002, at 01:48  PM, Vadim Gritsenko wrote:
   Start from TraxTransformer (search for xslt-processor-role) in

 Cocoon

   2.0.3, or TraxTransformer (search for transformer-factory) in

 Cocoon

   2.1; and follow from there.
 
  Does this mean it's possible, Vadim, or that Jason should try it to

 make

  it work in this way? If it's possible, I'd like to add it to the FAQ

 for

  xslt topics.

 I think it's possible also I have not tried.

It is possible. I used the xslt-processor-role variant on 2.0.2 a few months 
back to test XSLTC. It went like this (on 2.0.3, change as needed for SAXON)

Add new component to cocoon.xconf:

component role=org.apache.cocoon.components.xslt.XSLTProcessor/XSLTC
class=org.apache.cocoon.components.xslt.XSLTProcessorImpl
logger=core.xslt-processor
parameter name=use-store value=true/
parameter name=transformer-factory 
value=org.apache.xalan.xsltc.trax.TransformerFactoryImpl/
  /component

And a new transformer to your sitemap:

map:transformer name=xslt-xsltc 
src=org.apache.cocoon.transformation.TraxTransformer
  use-request-parametersfalse/use-request-parameters
  use-browser-capabilities-dbfalse/use-browser-capabilities-db  
xslt-processor-roleorg.apache.cocoon.components.xslt.XSLTProcessor/XSLTC/xslt-processor-role
/map:transformer


-pete

-- 
peter royal - [EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Multiple XSL Transformers

2002-06-04 Thread Jason Foster

 It is possible. I used the xslt-processor-role variant on 2.0.2 a few 
 months
 back to test XSLTC. It went like this (on 2.0.3, change as needed for 
 SAXON)

It's the change as needed that's currently the problem.  All of the 
references I've found involve people dropping in the Saxon jar.  I'm 
still looking for the proper class to include as the transformer-factory, 
as suggested by Vadim.

Jason


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Multiple XSL Transformers

2002-06-04 Thread Vadim Gritsenko

 From: Jason Foster [mailto:[EMAIL PROTECTED]]
 
  It is possible. I used the xslt-processor-role variant on 2.0.2 a
few
  months
  back to test XSLTC. It went like this (on 2.0.3, change as needed
for
  SAXON)
 
 It's the change as needed that's currently the problem.  All of the
 references I've found involve people dropping in the Saxon jar.  I'm
 still looking for the proper class to include as the
transformer-factory,
 as suggested by Vadim.

com\icl\saxon\TransformerFactoryImpl?

Vadim

 
 Jason


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Multiple XSL Transformers

2002-06-04 Thread Peter Royal

On Tuesday 04 June 2002 02:19 pm, Jason Foster wrote:
  It is possible. I used the xslt-processor-role variant on 2.0.2 a few
  months
  back to test XSLTC. It went like this (on 2.0.3, change as needed for
  SAXON)

 It's the change as needed that's currently the problem.  All of the
 references I've found involve people dropping in the Saxon jar.  I'm
 still looking for the proper class to include as the transformer-factory,
 as suggested by Vadim.

com.icl.saxon.TransformerFactoryImpl
-pete

-- 
peter royal - [EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Multiple XSL Transformers

2002-06-04 Thread Jason Foster

snip/

OK, here's my status report...

Short Version
   - the moment you drop saxon.jar into WEB-INF/lib, you use Saxon for 
everything

Long Version
   - place a copy of saxon.jar in WEB-INF/lib
   - create two transformers as follows:

   map:transformers default=xslt
 map:transformer logger=sitemap.transformer.xslt name=xslt 
 pool-grow=2 pool-max=32 pool-min=8 
 src=org.apache.cocoon.transformation.TraxTransformer
   use-request-parametersfalse/use-request-parameters
   use-browser-capabilities-dbfalse/use-browser-capabilities-db
   use-delifalse/use-deli
 transformer-
 factoryorg.apache.xalan.processor.TransformerFactoryImpl/transformer-factory
 /map:transformer


 map:transformer name=saxslt pool-grow=2 pool-max=32 pool-min=8
  src=org.apache.cocoon.transformation.TraxTransformer
   use-request-parametersfalse/use-request-parameters
   use-browser-capabilities-dbfalse/use-browser-capabilities-db
 transformer-
 factorycom.icl.saxon.TransformerFactoryImpl/transformer-factory
 /map:transformer

   - edit simple-page2html.xsl to include the following line:

 xsl:value-of select=system-property('xsl:vendor')/

   - leave the sitemap entry as follows:

map:match pattern=hello.html
 map:generate src=docs/samples/hello-page.xml/
 map:transform src=stylesheets/page/simple-page2html.xsl type=xslt
 /
 map:serialize type=html/
/map:match

   - start cocoon
   - http://127.0.0.1:8080/cocoon/hello.html is served by SAXON 6.5.2 from 
Michael Kay

Looks like the system is simply picking up Saxon regardless of the value of 
transformer-factory.

Any suggestions as to how to proceed?  All of my changes have been to 
sitemap.xmap, not to cocoon.xconf (like anyone really knows the difference!
).

Jason Foster


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Multiple XSL Transformers

2002-06-04 Thread Jason Foster

Victory!

Using the HEAD branch and the instructions given earlier, everything seems 
to be working.  Someone should probably patch the webapp sitemap to make 
sure that the xslt transformer explicitly sets

   transformer-factory
 org.apache.xalan.processor.TransformerFactoryImpl
   /transformer-factory

... so that the system is completely and obviously deterministic.  When 
debugging this kind of thing

   xsl:value-of select=system-property('xsl:vendor')/

... is a great tool.

Thanks for your help.  Now I'm on to DocBook.

Jason Foster


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Multiple XSL Transformers

2002-06-04 Thread Peter Royal

On Tuesday 04 June 2002 05:17 pm, Jason Foster wrote:
 Looks like the system is simply picking up Saxon regardless of the value of
 transformer-factory.

 Any suggestions as to how to proceed?  All of my changes have been to
 sitemap.xmap, not to cocoon.xconf (like anyone really knows the difference!
 ).

Are you using the HEAD branch from CVS (2.1) or the 2_0_3 branch? If you're 
using 2_0_3, you need to follow the pieces I sent earlier. If you're using 
HEAD, there's probably a bug somewhere but I can't help any further since I'm 
using 2_0_3.
-pete

-- 
peter royal - [EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]