ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Use Saxon8 in xslt task
Date Wed, 08 Dec 2004 16:20:38 GMT
Quoting Robert Soesemann <rsoesemann@sapient.com>:

> Thanks,
>
> Could anybody give me an example how to use this user_home/.ant/lib
> solution.
> Would I really need to remove the xslt task front ant/lib or could I
> just include the external saxon jar to the classpath?
>

Just create the directory, drop your saxon jar in there, and Ant will pick it up
as if it was in ANT_HOME/lib right next to the XSLT task.  You won't need to
remove anything in this case.  For instance, here's the path (on Win2k) to my
user_home/.ant/lib...

C:\Documents and Settings\myusername\.ant\lib


Jake


> Regards,
>
> Robert
>
> Quoting Robert Soesemann <rsoesemann@sapient.com>:
>
> > I have my Ant pipeline running inside Eclipse. For some xslt tasks I
> > need to use the optional Saxon 8 XSLT 2.0 processor.
> > I add the path inside the xslt tasks via classpath and processor
> > parameter:
> >
> > E.g.:
> >
> >     	<xslt basedir="${dir}"
> >     		  destdir="${split_dir}"
> >         	  classpath="${lib_dir}\saxon8.jar"
> >               processor="trax"
> >     		  style="${xsl_dir}\split-document.xsl"
> > 	/>
> >
> > And it just works.
> >
> > But when i run the Ant build outside of Eclipse with another Ant (same
> > version) the build fails because the XSLT features get passed to a
> wrong
> > processor.
> >
> > What is the best way to tell Ant that it should use saxon8.jar? I
> don't
> > want to just copy the jar to the ant/lib. Is there a general
> <classpath>
> > task to add external jars to the Ant classpath?
> >
>
> You will run into classloading issues if you try to use a nested
> <classpath> (I
> haven't even checked to see if this is supported by the XSLT task,
> probably
> not) because the <xslt> task is loaded in the parent classloader.  It
> can't
> have a dependency on a library in a child classloader because in Java2
> classloading, the parent can't see the child.  The only way you do this
> is to
> remove the <xslt> task jar from ANT_HOME/lib and define the task using
> <taskdef> and provide a nested <classpath> there.  Your best option,
> which will
> be compatible with all Ant-1.6+ environments, is to put the saxon jar in
> ANT_HOME/lib or user_home/.ant/lib.  I suggest the latter because you
> can then
> blow away your Ant installations without having to worry about
> preserving
> custom jars you added to ANT_HOME/lib.
>
> Jake
>
> > Regards,
> >
> > Robert
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message