Re: How to configure TraxProcessor in 2.2?

gelo1234 <[email protected]> Wed, 11 Dec 2019 19:45:58 +0100
Newsgroups gmane.text.xml.cocoon.user
Message-ID <CAPJaKUqfw0C2V4tc76=kdi3hiQ3n=KoR4BcPQ_Cnv-J3JRsqdA@mail.gmail.com>
--000000000000bf2c7d0599720a78
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Wow, you Haka-Smart guy :) No need for a Saxon commercial licence anymore
with Saxon-HE :)
That was what we missed with new Saxon-HE :) Thanks! Good Job!
With C3 (Cocoon 3.0) you can use Java-only code with no cocoon-sitemap
config dependency :)

Such a little thing and I get a big smile on my mouth :)
Man, you made my day!!!

Greetings,
Greg



=C5=9Br., 11 gru 2019 o 14:59 Mark H. Wood <[email protected]> napisa=C5=82(a=
):

> On Tue, Dec 10, 2019 at 11:21:09PM +0100, gelo1234 wrote:
> > I don't think this is the proper way to do this and if it's possible at
> > all. Extension functions are only available in commercial releases of
> Saxon
> > (PE and EE).
> > I'm afraid they are not available in open-source Saxon-HE. We were tryi=
ng
> > to use Saxon-HE with Cocoon 3.0 and extension-functions without success=
.
> > You either have to use OLDER release of Saxon or pay for the license.
>
> No.  Before trying this in Cocoon, I wrote a tiny test application,
> and it succeeded in defining integrated extension functions.
>
> https://github.com/mwoodiupui/confman-demo
>
> What one cannot do in Saxon-HE is register integrated extension
> functions using a configuration file, as one can in -PE or -EE.  This
> is why I need to do configuration in Java.
>
> > wt., 10 gru 2019 o 21:19 Mark H. Wood <[email protected]> napisa=C5=82(a)=
:
> >
> > > On Tue, Dec 10, 2019 at 12:10:41AM +0100, gelo1234 wrote:
> > > > Mark,
> > > >
> > > > Why do you need a Custom XSLT Processor other than Saxon actually??
> Saxon
> > > > should do the right thing. Why wrapping it inside any "upper-level"
> > > > Transformer? It's getting kinda weird. You can always add a new Jav=
a
> > > class
> > > > to standard Cocoon Processors/Transformers.
> > >
> > > Because, as I said, I need to configure Saxon, and Saxon-HE can only
> > > be configured programmatically.  So, if I want to register an
> > > Integrated Extension Function, I have to gain access to the
> > > TransformerFactory being created somewhere in the bowels of Cocoon,
> > > get its Configuration, and call #registerExtensionFunction on that.
> > >
> > > To do this, I've created a class which extends TransformerFactoryImpl=
,
> > > added a @PostConstruct method (which Spring should call after
> > > instantiating the bean) to do the registration, and now I'm trying to
> > > tell Cocoon to use my factory instead of the one that
> > > javax.xml.transform.TransformerFactory will conjure up by default out
> > > of the service provider framework when Saxon is present.
> > >
> > > > https://mrhaki.blogspot.com/2008/09/use-saxon-in-cocoon-22.html
> > >
> > > I've seen that.  So far it hasn't helped.
> > >
> > > > Greetings,
> > > > Greg
> > > >
> > > >
> > > > pon., 9 gru 2019 o 23:02 Mark H. Wood <[email protected]> napisa=C5=
=82(a):
> > > >
> > > > > On Thu, Dec 05, 2019 at 04:13:08PM +0100, Javier Puerto wrote:
> > > > > > I recommend you to use the Spring configuration. I never had th=
is
> > > > > > requirement before but by the error message and the configurati=
on
> > > > > fragment
> > > > > > that you have sent the NPE is caused because you are not passin=
g
> an
> > > > > > instance of "org.dspace.saxon.ConfigurableTransformerFactory",
> you
> > > are
> > > > > > passing a String instead.
> > > > > >
> > > > > > <property name=3D'transformerFactory'
> > > > > >
> > >  value=3D'org.dspace.saxon.ConfigurableTransformerFactory'/>
> > > > > >
> > > > > > IIRC you should change it to:
> > > > > > <property name=3D'transformerFactory'>
> > > > > >   <bean class=3D"org.dspace.saxon.ConfigurableTransformerFactor=
y"/>
> > > > > > </property>
> > > > > >
> > > > > > The attribute "value" is for literal values. You can also defin=
e
> the
> > > bean
> > > > > > with an ID and then use the attribute "ref" with the ID of the
> bean.
> > > > > > I hope that helps.
> > > > >
> > > > > It would have made more sense for this to take a bean reference,
> but
> > > > > the Javadoc for TraxProcessor says that setTransformerFactory()
> takes
> > > > > a String argument.  That seems to be correct:  when I change it t=
o
> a
> > > > > reference, I get:
> > > > >
> > > > > 09-Dec-2019 15:12:39.128 SEVERE [localhost-startStop-24]
> > > > > org.apache.catalina.cor
> > > > > e.StandardContext.listenerStart Exception sending context
> initialized
> > > > > event to l
> > > > > istener instance of class
> > > > > [org.springframework.web.context.ContextLoaderListener
> > > > > ]
> > > > >         org.springframework.beans.factory.BeanCreationException:
> Error
> > > > > creating
> > > > > bean with name 'org.apache.excalibur.xml.xslt.XSLTProcessor/saxon=
'
> > > defined
> > > > > in Se
> > > > > rvletContext resource [/WEB-INF/spring/applicationContext.xml]:
> > > > > Initialization o
> > > > > f bean failed; nested exception is
> > > > > org.springframework.beans.ConversionNotSuppor
> > > > > tedException: Failed to convert property value of type
> > > > > 'org.dspace.saxon.Configu
> > > > > rableTransformerFactory' to required type 'java.lang.String' for
> > > property
> > > > > 'trans
> > > > > formerFactory'; nested exception is
> java.lang.IllegalStateException:
> > > > > Cannot conv
> > > > > ert value of type
> [org.dspace.saxon.ConfigurableTransformerFactory] to
> > > > > required
> > > > > type [java.lang.String] for property 'transformerFactory': no
> matching
> > > > > editors o
> > > > > r conversion strategy found
> > > > >
> > > > > When I change it back to the literal name of the class, the
> > > > > webapp. starts normally.  But it still errors out when it tries t=
o
> run
> > > > > the XSLT transformer.
> > > > >
> > > > > It begins to look as though one can't really wire up TraxProcesso=
r
> > > > > using Spring.  (By this I mean:  using Spring's normal <bean>
> > > > > <property> etc.)  I'm guessing that it blows up because nothing h=
as
> > > > > called #parameterize(Parameters), because #parameterize() knows h=
ow
> > > > > the properties must be set up and makes sure they are all sensibl=
e,
> > > > > and thus something was left unset.
> > > > >
> > > > > I tried adding
> > > > >
> > > > >   log4j.logger.org.apache.excalibur =3D DEBUG
> > > > >   log4j.logger.org.apache.avalon =3D DEBUG
> > > > >
> > > > > to our logging config. but it made no useful difference in the
> > > > > output.  I cannot see what paths are actually being consulted for
> > > > > Cocoon component configuration, but it seems that none of the
> places
> > > > > I've put my .xconf is one of them.
> > > > >
> > > > > > El mi=C3=A9., 4 dic. 2019 a las 22:46, Mark H. Wood (<mwood@iup=
ui.edu
> >)
> > > > > escribi=C3=B3:
> > > > > >
> > > > > > > I'm using Cocoon 2.2.  I need to pass a custom XSLT transform=
er
> > > > > > > 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 th=
e
> > > 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
> > > > > > >
> > > > >
> > > > > --
> > > > > 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
> > > > >
> > >
> > > --
> > > 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
> > >
>
> --
> 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
>

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

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-size:small">Wow=
, you Haka-Smart guy :) No need for a Saxon commercial licence anymore with=
 Saxon-HE :)</div><div class=3D"gmail_default" style=3D"font-size:small">Th=
at was what we missed with new Saxon-HE :) Thanks! Good Job!<br></div><div =
class=3D"gmail_default" style=3D"font-size:small">With C3 (Cocoon 3.0) you =
can use Java-only code with no cocoon-sitemap config dependency :)</div><di=
v class=3D"gmail_default" style=3D"font-size:small"><br></div><div class=3D=
"gmail_default" style=3D"font-size:small">Such a little thing and I get a b=
ig smile on my mouth :)</div><div class=3D"gmail_default" style=3D"font-siz=
e:small">Man, you made my day!!!</div><div class=3D"gmail_default" style=3D=
"font-size:small"><br></div><div class=3D"gmail_default" style=3D"font-size=
:small">Greetings,</div><div class=3D"gmail_default" style=3D"font-size:sma=
ll">Greg<br></div><div class=3D"gmail_default" style=3D"font-size:small"><b=
r></div><div class=3D"gmail_default" style=3D"font-size:small"><br></div></=
div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">=
=C5=9Br., 11 gru 2019 o 14:59=C2=A0Mark H. Wood &lt;<a href=3D"mailto:mwood=
@iupui.edu">[email protected]</a>&gt; napisa=C5=82(a):<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex">On Tue, Dec 10, 2019 at 11:21:09PM +01=
00, gelo1234 wrote:<br>
&gt; I don&#39;t think this is the proper way to do this and if it&#39;s po=
ssible at<br>
&gt; all. Extension functions are only available in commercial releases of =
Saxon<br>
&gt; (PE and EE).<br>
&gt; I&#39;m afraid they are not available in open-source Saxon-HE. We were=
 trying<br>
&gt; to use Saxon-HE with Cocoon 3.0 and extension-functions without succes=
s.<br>
&gt; You either have to use OLDER release of Saxon or pay for the license.<=
br>
<br>
No.=C2=A0 Before trying this in Cocoon, I wrote a tiny test application,<br=
>
and it succeeded in defining integrated extension functions.<br>
<br>
<a href=3D"https://github.com/mwoodiupui/confman-demo" rel=3D"noreferrer" t=
arget=3D"_blank">https://github.com/mwoodiupui/confman-demo</a><br>
<br>
What one cannot do in Saxon-HE is register integrated extension<br>
functions using a configuration file, as one can in -PE or -EE.=C2=A0 This<=
br>
is why I need to do configuration in Java.<br>
<br>
&gt; wt., 10 gru 2019 o 21:19 Mark H. Wood &lt;<a href=3D"mailto:mwood@iupu=
i.edu" target=3D"_blank">[email protected]</a>&gt; napisa=C5=82(a):<br>
&gt; <br>
&gt; &gt; On Tue, Dec 10, 2019 at 12:10:41AM +0100, gelo1234 wrote:<br>
&gt; &gt; &gt; Mark,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Why do you need a Custom XSLT Processor other than Saxon act=
ually?? Saxon<br>
&gt; &gt; &gt; should do the right thing. Why wrapping it inside any &quot;=
upper-level&quot;<br>
&gt; &gt; &gt; Transformer? It&#39;s getting kinda weird. You can always ad=
d a new Java<br>
&gt; &gt; class<br>
&gt; &gt; &gt; to standard Cocoon Processors/Transformers.<br>
&gt; &gt;<br>
&gt; &gt; Because, as I said, I need to configure Saxon, and Saxon-HE can o=
nly<br>
&gt; &gt; be configured programmatically.=C2=A0 So, if I want to register a=
n<br>
&gt; &gt; Integrated Extension Function, I have to gain access to the<br>
&gt; &gt; TransformerFactory being created somewhere in the bowels of Cocoo=
n,<br>
&gt; &gt; get its Configuration, and call #registerExtensionFunction on tha=
t.<br>
&gt; &gt;<br>
&gt; &gt; To do this, I&#39;ve created a class which extends TransformerFac=
toryImpl,<br>
&gt; &gt; added a @PostConstruct method (which Spring should call after<br>
&gt; &gt; instantiating the bean) to do the registration, and now I&#39;m t=
rying to<br>
&gt; &gt; tell Cocoon to use my factory instead of the one that<br>
&gt; &gt; javax.xml.transform.TransformerFactory will conjure up by default=
 out<br>
&gt; &gt; of the service provider framework when Saxon is present.<br>
&gt; &gt;<br>
&gt; &gt; &gt; <a href=3D"https://mrhaki.blogspot.com/2008/09/use-saxon-in-=
cocoon-22.html" rel=3D"noreferrer" target=3D"_blank">https://mrhaki.blogspo=
t.com/2008/09/use-saxon-in-cocoon-22.html</a><br>
&gt; &gt;<br>
&gt; &gt; I&#39;ve seen that.=C2=A0 So far it hasn&#39;t helped.<br>
&gt; &gt;<br>
&gt; &gt; &gt; Greetings,<br>
&gt; &gt; &gt; Greg<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; pon., 9 gru 2019 o 23:02 Mark H. Wood &lt;<a href=3D"mailto:=
[email protected]" target=3D"_blank">[email protected]</a>&gt; napisa=C5=82(a):=
<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On Thu, Dec 05, 2019 at 04:13:08PM +0100, Javier Puerto=
 wrote:<br>
&gt; &gt; &gt; &gt; &gt; I recommend you to use the Spring configuration. I=
 never had this<br>
&gt; &gt; &gt; &gt; &gt; requirement before but by the error message and th=
e configuration<br>
&gt; &gt; &gt; &gt; fragment<br>
&gt; &gt; &gt; &gt; &gt; that you have sent the NPE is caused because you a=
re not passing an<br>
&gt; &gt; &gt; &gt; &gt; instance of &quot;org.dspace.saxon.ConfigurableTra=
nsformerFactory&quot;, you<br>
&gt; &gt; are<br>
&gt; &gt; &gt; &gt; &gt; passing a String instead.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &lt;property name=3D&#39;transformerFactory&#39;<b=
r>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt;=C2=A0 value=3D&#39;org.dspace.saxon.ConfigurableTransformerFactor=
y&#39;/&gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; IIRC you should change it to:<br>
&gt; &gt; &gt; &gt; &gt; &lt;property name=3D&#39;transformerFactory&#39;&g=
t;<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0&lt;bean class=3D&quot;org.dspace.saxo=
n.ConfigurableTransformerFactory&quot;/&gt;<br>
&gt; &gt; &gt; &gt; &gt; &lt;/property&gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; The attribute &quot;value&quot; is for literal val=
ues. You can also define the<br>
&gt; &gt; bean<br>
&gt; &gt; &gt; &gt; &gt; with an ID and then use the attribute &quot;ref&qu=
ot; with the ID of the bean.<br>
&gt; &gt; &gt; &gt; &gt; I hope that helps.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; It would have made more sense for this to take a bean r=
eference, but<br>
&gt; &gt; &gt; &gt; the Javadoc for TraxProcessor says that setTransformerF=
actory() takes<br>
&gt; &gt; &gt; &gt; a String argument.=C2=A0 That seems to be correct:=C2=
=A0 when I change it to a<br>
&gt; &gt; &gt; &gt; reference, I get:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; 09-Dec-2019 15:12:39.128 SEVERE [localhost-startStop-24=
]<br>
&gt; &gt; &gt; &gt; org.apache.catalina.cor<br>
&gt; &gt; &gt; &gt; e.StandardContext.listenerStart Exception sending conte=
xt initialized<br>
&gt; &gt; &gt; &gt; event to l<br>
&gt; &gt; &gt; &gt; istener instance of class<br>
&gt; &gt; &gt; &gt; [org.springframework.web.context.ContextLoaderListener<=
br>
&gt; &gt; &gt; &gt; ]<br>
&gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0org.springframework.be=
ans.factory.BeanCreationException: Error<br>
&gt; &gt; &gt; &gt; creating<br>
&gt; &gt; &gt; &gt; bean with name &#39;org.apache.excalibur.xml.xslt.XSLTP=
rocessor/saxon&#39;<br>
&gt; &gt; defined<br>
&gt; &gt; &gt; &gt; in Se<br>
&gt; &gt; &gt; &gt; rvletContext resource [/WEB-INF/spring/applicationConte=
xt.xml]:<br>
&gt; &gt; &gt; &gt; Initialization o<br>
&gt; &gt; &gt; &gt; f bean failed; nested exception is<br>
&gt; &gt; &gt; &gt; org.springframework.beans.ConversionNotSuppor<br>
&gt; &gt; &gt; &gt; tedException: Failed to convert property value of type<=
br>
&gt; &gt; &gt; &gt; &#39;org.dspace.saxon.Configu<br>
&gt; &gt; &gt; &gt; rableTransformerFactory&#39; to required type &#39;java=
.lang.String&#39; for<br>
&gt; &gt; property<br>
&gt; &gt; &gt; &gt; &#39;trans<br>
&gt; &gt; &gt; &gt; formerFactory&#39;; nested exception is java.lang.Illeg=
alStateException:<br>
&gt; &gt; &gt; &gt; Cannot conv<br>
&gt; &gt; &gt; &gt; ert value of type [org.dspace.saxon.ConfigurableTransfo=
rmerFactory] to<br>
&gt; &gt; &gt; &gt; required<br>
&gt; &gt; &gt; &gt; type [java.lang.String] for property &#39;transformerFa=
ctory&#39;: no matching<br>
&gt; &gt; &gt; &gt; editors o<br>
&gt; &gt; &gt; &gt; r conversion strategy found<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; When I change it back to the literal name of the class,=
 the<br>
&gt; &gt; &gt; &gt; webapp. starts normally.=C2=A0 But it still errors out =
when it tries to run<br>
&gt; &gt; &gt; &gt; the XSLT transformer.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; It begins to look as though one can&#39;t really wire u=
p TraxProcessor<br>
&gt; &gt; &gt; &gt; using Spring.=C2=A0 (By this I mean:=C2=A0 using Spring=
&#39;s normal &lt;bean&gt;<br>
&gt; &gt; &gt; &gt; &lt;property&gt; etc.)=C2=A0 I&#39;m guessing that it b=
lows up because nothing has<br>
&gt; &gt; &gt; &gt; called #parameterize(Parameters), because #parameterize=
() knows how<br>
&gt; &gt; &gt; &gt; the properties must be set up and makes sure they are a=
ll sensible,<br>
&gt; &gt; &gt; &gt; and thus something was left unset.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; I tried adding<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;=C2=A0 =C2=A0log4j.logger.org.apache.excalibur =3D DEBUG=
<br>
&gt; &gt; &gt; &gt;=C2=A0 =C2=A0log4j.logger.org.apache.avalon =3D DEBUG<br=
>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; to our logging config. but it made no useful difference=
 in the<br>
&gt; &gt; &gt; &gt; output.=C2=A0 I cannot see what paths are actually bein=
g consulted for<br>
&gt; &gt; &gt; &gt; Cocoon component configuration, but it seems that none =
of the places<br>
&gt; &gt; &gt; &gt; I&#39;ve put my .xconf is one of them.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; El mi=C3=A9., 4 dic. 2019 a las 22:46, Mark H. Woo=
d (&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
</a>&gt;)<br>
&gt; &gt; &gt; &gt; escribi=C3=B3:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; I&#39;m using Cocoon 2.2.=C2=A0 I need to pas=
s a custom XSLT transformer<br>
&gt; &gt; &gt; &gt; &gt; &gt; factory (that wraps Saxon&#39;s to configure =
it) to TraxProcessor, and<br>
&gt; &gt; the<br>
&gt; &gt; &gt; &gt; &gt; &gt; advice I&#39;ve found in several places aroun=
d the Web doesn&#39;t seem to<br>
&gt; &gt; be<br>
&gt; &gt; &gt; &gt; &gt; &gt; working:=C2=A0 my factory class never gets in=
stantiated.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; I&#39;ve got a file<br>
&gt; &gt; META-INF/cocoon/avalon/cocoon-core-saxon-xslt.xconf:<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &lt;?xml version=3D&quot;1.0&quot; encoding=
=3D&quot;UTF-8&quot;?&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &lt;components&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0&lt;component<br>
&gt; &gt; role=3D&quot;org.apache.excalibur.xml.xslt.XSLTProcessor/saxon&qu=
ot;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0class=3D&quot;org.apache.c=
ocoon.components.xslt.TraxProcessor&quot;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0&lt;parameter name=3D&quot=
;use-store&quot; value=3D&quot;true&quot;/&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0&lt;parameter name=3D&quot=
;transformer-factory&quot;<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; value=3D&quot;org.dspace.saxon.ConfigurableTransformerF=
actory&quot;/&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0&lt;/component&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &lt;/components&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; I also tried copying it to WEB-INF/cocoon and=
 it didnt&#39; seem to<br>
&gt; &gt; work<br>
&gt; &gt; &gt; &gt; &gt; &gt; there either.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; I do have &lt;configurator:settings/&gt; and =
&lt;avalon:bridge/&gt; in the<br>
&gt; &gt; Spring<br>
&gt; &gt; &gt; &gt; &gt; &gt; config.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; Is there some way to debug component configur=
ation and see if the<br>
&gt; &gt; file<br>
&gt; &gt; &gt; &gt; &gt; &gt; is even being looked for (and where *is* conf=
iguration looking)?<br>
&gt; &gt; The<br>
&gt; &gt; &gt; &gt; &gt; &gt; Cocoon site directs me to Excalibur, which di=
rects me to Avalon,<br>
&gt; &gt; which<br>
&gt; &gt; &gt; &gt; &gt; &gt; says that Avalon is wound up and directs me b=
ack to Excalibur....<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; I&#39;ve also tried to configure the thing us=
ing Spring:<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0&lt;bean name=3D&#39;org.a=
pache.excalibur.xml.xslt.XSLTProcessor/saxon&#39;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0class=
=3D&#39;org.apache.cocoon.components.xslt.TraxProcessor&#39;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0init-=
method=3D&#39;initialize&#39;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0destr=
oy-method=3D&#39;dispose&#39;&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;!--property nam=
e=3D&#39;use-store&#39; value=3D&#39;true&#39;/--&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;property name=
=3D&#39;transformerFactory&#39;<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;=C2=A0 value=3D&#39;org.dspace.saxon.ConfigurableTransfo=
rmerFactory&#39;/&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0&lt;/bean&gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; but so far I&#39;m missing something:=C2=A0 T=
raxProcessor.sourceToSAX<br>
&gt; &gt; throws an<br>
&gt; &gt; &gt; &gt; &gt; &gt; NPE.=C2=A0 I&#39;m probably not setting the p=
arameters correctly -- there<br>
&gt; &gt; isn&#39;t<br>
&gt; &gt; &gt; &gt; &gt; &gt; a setter for use-store at all, for example.<b=
r>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; I&#39;ve found any number of pages that tell =
me Avalon configuration is<br>
&gt; &gt; &gt; &gt; &gt; &gt; being replaced by Spring, but nothing practic=
al on how to convert<br>
&gt; &gt; &gt; &gt; &gt; &gt; Avalon configuration (such as the first sampl=
e above) to Spring, or<br>
&gt; &gt; &gt; &gt; &gt; &gt; even how to write fresh Spring configuration =
for Cocoon components.<br>
&gt; &gt; &gt; &gt; &gt; &gt; It would be nice to know how to do this even =
if I wind up using the<br>
&gt; &gt; &gt; &gt; &gt; &gt; Avalon approach with the present task.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt; &gt; &gt; Mark H. Wood<br>
&gt; &gt; &gt; &gt; &gt; &gt; Lead Technology Analyst<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; University Library<br>
&gt; &gt; &gt; &gt; &gt; &gt; Indiana University - Purdue University Indian=
apolis<br>
&gt; &gt; &gt; &gt; &gt; &gt; 755 W. Michigan Street<br>
&gt; &gt; &gt; &gt; &gt; &gt; Indianapolis, IN 46202<br>
&gt; &gt; &gt; &gt; &gt; &gt; 317-274-0749<br>
&gt; &gt; &gt; &gt; &gt; &gt; <a href=3D"http://www.ulib.iupui.edu" rel=3D"=
noreferrer" target=3D"_blank">www.ulib.iupui.edu</a><br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt; Mark H. Wood<br>
&gt; &gt; &gt; &gt; Lead Technology Analyst<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; University Library<br>
&gt; &gt; &gt; &gt; Indiana University - Purdue University Indianapolis<br>
&gt; &gt; &gt; &gt; 755 W. Michigan Street<br>
&gt; &gt; &gt; &gt; Indianapolis, IN 46202<br>
&gt; &gt; &gt; &gt; 317-274-0749<br>
&gt; &gt; &gt; &gt; <a href=3D"http://www.ulib.iupui.edu" rel=3D"noreferrer=
" target=3D"_blank">www.ulib.iupui.edu</a><br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Mark H. Wood<br>
&gt; &gt; Lead Technology Analyst<br>
&gt; &gt;<br>
&gt; &gt; University Library<br>
&gt; &gt; Indiana University - Purdue University Indianapolis<br>
&gt; &gt; 755 W. Michigan Street<br>
&gt; &gt; Indianapolis, IN 46202<br>
&gt; &gt; 317-274-0749<br>
&gt; &gt; <a href=3D"http://www.ulib.iupui.edu" rel=3D"noreferrer" target=
=3D"_blank">www.ulib.iupui.edu</a><br>
&gt; &gt;<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" target=3D"_blank">=
www.ulib.iupui.edu</a><br>
</blockquote></div>

--000000000000bf2c7d0599720a78--