Re: How to configure TraxProcessor in 2.2?

warrell harries <[email protected]> Thu, 5 Dec 2019 06:19:56 +0000
Newsgroups gmane.text.xml.cocoon.user
Message-ID <CAL-6e7toE4BHKndi6cS3d2Nh3RiZRKo-H1yz4nLWcBJjry8J6Q@mail.gmail.com>
--000000000000de0f220598eeebe3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Mark,

I never could get 2.2 working =F0=9F=98=82

However, I'm using 2.12 every day, all over the world - mostly with Saxon
for XSLT 2.0

All I can advise, use 2.12...

Best regards

Warrell





On Wed, 4 Dec 2019, 9:46 pm Mark H. Wood, <[email protected]> wrote:

> I'm using Cocoon 2.2.  I need to pass a custom XSLT transformer
> factory (that wraps Saxon's to configure it) to TraxProcessor, and the
> advice I've found in several places around the Web doesn't seem to be
> working:  my factory class never gets instantiated.
>
> I've got a file META-INF/cocoon/avalon/cocoon-core-saxon-xslt.xconf:
>
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
> <components>
>   <component role=3D"org.apache.excalibur.xml.xslt.XSLTProcessor/saxon"
>     class=3D"org.apache.cocoon.components.xslt.TraxProcessor">
>     <parameter name=3D"use-store" value=3D"true"/>
>     <parameter name=3D"transformer-factory"
>                value=3D"org.dspace.saxon.ConfigurableTransformerFactory"/=
>
>   </component>
> </components>
>
> I also tried copying it to WEB-INF/cocoon and it didnt' seem to work
> there either.
>
> I do have <configurator:settings/> and <avalon:bridge/> in the Spring
> config.
>
> Is there some way to debug component configuration and see if the file
> is even being looked for (and where *is* configuration looking)?  The
> Cocoon site directs me to Excalibur, which directs me to Avalon, which
> says that Avalon is wound up and directs me back to Excalibur....
>
>
>
> I've also tried to configure the thing using Spring:
>
>     <bean name=3D'org.apache.excalibur.xml.xslt.XSLTProcessor/saxon'
>           class=3D'org.apache.cocoon.components.xslt.TraxProcessor'
>           init-method=3D'initialize'
>           destroy-method=3D'dispose'>
>       <!--property name=3D'use-store' value=3D'true'/-->
>       <property name=3D'transformerFactory'
>                 value=3D'org.dspace.saxon.ConfigurableTransformerFactory'=
/>
>     </bean>
>
> but so far I'm missing something:  TraxProcessor.sourceToSAX throws an
> NPE.  I'm probably not setting the parameters correctly -- there isn't
> a setter for use-store at all, for example.
>
> I've found any number of pages that tell me Avalon configuration is
> being replaced by Spring, but nothing practical on how to convert
> Avalon configuration (such as the first sample above) to Spring, or
> even how to write fresh Spring configuration for Cocoon components.
> It would be nice to know how to do this even if I wind up using the
> Avalon approach with the present task.
>
> --
> Mark H. Wood
> Lead Technology Analyst
>
> University Library
> Indiana University - Purdue University Indianapolis
> 755 W. Michigan Street
> Indianapolis, IN 46202
> 317-274-0749
> www.ulib.iupui.edu
>

--000000000000de0f220598eeebe3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">Hi Mark,<div dir=3D"auto"><br></div><div dir=3D"auto">I n=
ever could get 2.2 working =F0=9F=98=82</div><div dir=3D"auto"><br></div><d=
iv dir=3D"auto">However, I&#39;m using 2.12 every day, all over the world -=
 mostly with Saxon for XSLT 2.0</div><div dir=3D"auto"><br></div><div dir=
=3D"auto">All I can advise, use 2.12...</div><div dir=3D"auto"><br></div><d=
iv dir=3D"auto">Best regards=C2=A0</div><div dir=3D"auto"><br></div><div di=
r=3D"auto">Warrell=C2=A0</div><div dir=3D"auto"><br></div><div dir=3D"auto"=
><br></div><div dir=3D"auto"><br></div><div dir=3D"auto"><br></div></div><b=
r><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, =
4 Dec 2019, 9:46 pm Mark H. Wood, &lt;<a href=3D"mailto:[email protected]">mw=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;=
m using Cocoon 2.2.=C2=A0 I need to pass a custom XSLT transformer<br>
factory (that wraps Saxon&#39;s to configure it) to TraxProcessor, and the<=
br>
advice I&#39;ve found in several places around the Web doesn&#39;t seem to =
be<br>
working:=C2=A0 my factory class never gets instantiated.<br>
<br>
I&#39;ve got a file META-INF/cocoon/avalon/cocoon-core-saxon-xslt.xconf:<br=
>
<br>
&lt;?xml version=3D&quot;1.0&quot; encoding=3D&quot;UTF-8&quot;?&gt;<br>
&lt;components&gt;<br>
=C2=A0 &lt;component role=3D&quot;org.apache.excalibur.xml.xslt.XSLTProcess=
or/saxon&quot;<br>
=C2=A0 =C2=A0 class=3D&quot;org.apache.cocoon.components.xslt.TraxProcessor=
&quot;&gt;<br>
=C2=A0 =C2=A0 &lt;parameter name=3D&quot;use-store&quot; value=3D&quot;true=
&quot;/&gt;<br>
=C2=A0 =C2=A0 &lt;parameter name=3D&quot;transformer-factory&quot;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0value=3D&quot;org.ds=
pace.saxon.ConfigurableTransformerFactory&quot;/&gt;<br>
=C2=A0 &lt;/component&gt;<br>
&lt;/components&gt;<br>
<br>
I also tried copying it to WEB-INF/cocoon and it didnt&#39; seem to work<br=
>
there either.<br>
<br>
I do have &lt;configurator:settings/&gt; and &lt;avalon:bridge/&gt; in the =
Spring<br>
config.<br>
<br>
Is there some way to debug component configuration and see if the file<br>
is even being looked for (and where *is* configuration looking)?=C2=A0 The<=
br>
Cocoon site directs me to Excalibur, which directs me to Avalon, which<br>
says that Avalon is wound up and directs me back to Excalibur....<br>
<br>
<br>
<br>
I&#39;ve also tried to configure the thing using Spring:<br>
<br>
=C2=A0 =C2=A0 &lt;bean name=3D&#39;org.apache.excalibur.xml.xslt.XSLTProces=
sor/saxon&#39;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 class=3D&#39;org.apache.cocoon.component=
s.xslt.TraxProcessor&#39;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 init-method=3D&#39;initialize&#39;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 destroy-method=3D&#39;dispose&#39;&gt;<b=
r>
=C2=A0 =C2=A0 =C2=A0 &lt;!--property name=3D&#39;use-store&#39; value=3D&#3=
9;true&#39;/--&gt;<br>
=C2=A0 =C2=A0 =C2=A0 &lt;property name=3D&#39;transformerFactory&#39;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 value=3D&#39;org.ds=
pace.saxon.ConfigurableTransformerFactory&#39;/&gt;<br>
=C2=A0 =C2=A0 &lt;/bean&gt;<br>
<br>
but so far I&#39;m missing something:=C2=A0 TraxProcessor.sourceToSAX throw=
s an<br>
NPE.=C2=A0 I&#39;m probably not setting the parameters correctly -- there i=
sn&#39;t<br>
a setter for use-store at all, for example.<br>
<br>
I&#39;ve found any number of pages that tell me Avalon configuration is<br>
being replaced by Spring, but nothing practical on how to convert<br>
Avalon configuration (such as the first sample above) to Spring, or<br>
even how to write fresh Spring configuration for Cocoon components.<br>
It would be nice to know how to do this even if I wind up using the<br>
Avalon approach with the present task.<br>
<br>
-- <br>
Mark H. Wood<br>
Lead Technology Analyst<br>
<br>
University Library<br>
Indiana University - Purdue University Indianapolis<br>
755 W. Michigan Street<br>
Indianapolis, IN 46202<br>
317-274-0749<br>
<a href=3D"http://www.ulib.iupui.edu" rel=3D"noreferrer noreferrer" target=
=3D"_blank">www.ulib.iupui.edu</a><br>
</blockquote></div>

--000000000000de0f220598eeebe3--