> From: richard.ke...@atos.net
> To: user@ant.apache.org
> Subject: RE: Use of XML Catalog with Ant (xslt task) - request for example
> Date: Fri, 13 Sep 2013 16:08:08 +0000
>
>
>
> Ok, right, good, back on this again for a while after a break .....
>
>
>
> My preference is to do the job entirely within the Ant file, so using
> <classpath> MG><!-- include all necessary jars for taskdef aliased as xslt
> --><path id="classpath">
<fileset dir="${lib.dir}" includes="**/ant-resolver.jar"/>
<fileset dir="${lib.dir}" includes="**/xml-resolver.jar"/>
</path>MG>
or <classpathref>.MG>
<xslt ....classpathref="classpath"/MG>
>
> I won't use -cp, as advised here.
>
> I don't want to have to do any special copying after unpacking so I'd rather
> not copy jars into $ANT_HOME/lib if I don't need to.MG>you want to keep
> preserve $ANT_HOME/lib library for ANT specific jars
>
>
>
> "ant-resolver.jar and xml-resolver.jar "
>
> hang on a moment ............. what are these ?MG>resolver jars allow your
> ant target to 'resolve' either an ivy-file or artifact
MG>as an example lets say you have ivy-file and artifact in myrepo.jar
specified as <jar name="my-local-jar-resolver" file="/home/me/myrepo.jar">
MG>ivy-file would be <ivy
pattern="[organisation]/[module]/ivys/ivy-[revision].xml" />MG>translation:
resolve the ivy configuration file within myrepo.jar which matches the
expression [organisation]/[module]/ivys/ivy-[revision].xml MG>artifact would be
<artifact
pattern="[organisation]/[module]/[type]s/[artifact]-[revision].[type]"
MG>translation: resolve the artifact which matches the expression
[organisation]/[module]/[type]s/[artifact]-[revision].[type]
MG>http://ant.apache.org/ivy/history/latest-milestone/resolver/jar.html
>
> I thought I just needed resolver.jar from xml-commons-resolver-1.2 (assuming
> that's the latest), so what are these two ?
MG>xml-commons-resolver contains your
xml-catalog-resolverMG>org.apache.xml.resolver.tools.CatalogResolverMG>This
class provides a SAX (V6.1+) EntityResolver and a URIResolver from JaxP
>
>
> And (previous response) I don't touch ant-apache-resolver.jar, which is
> already under ant/lib, as it's an internal library
MG>Makes Sense?
>
>
>
>
>
>
> Now, back to catalog-specific issues.
>
> There are three components to resolving urls using a catalog that I haven't
> seen explained clearly yet for Ant.
>
> 1. The resolver. The discussion above is about this. I hope I'm getting
> closer to getting this working, though I can't see it yet.
>
>
>
> 2. The catalog file itself. I have this already as I've been using it from
> Saxon
>
> 3. The Catalog manager properties file. Again I've been using one of these
> from Saxon.
>
>
>
> What is not clear to me is which one of these files needs to be specified in
> the <xmlcatalog> element. Given that the properties file specifies the
> (relative) location of the catalog file itself I assume that's the one I need
> to specify. Can someone please confirm this, or explain otherwise ?
>
>
>
> The thing that's worrying me is that unless all these aspects are sorted then
> the system won't work. And that I can't tell which one is wrong.
>
>
>
> I am seeing the following messages :
>
> "Apache resolver library not found, internal resolver will be used
> Failed to load Apache resolver: java.lang.NoClassDefFoundError:
> org/apache/xml/resolver/tools/CatalogResolver"
>
> Which looks like it's saying I haven't got the resolver loaded.
>
>
>
> I hope someone can help.
>
>
>
>
>
>
>
> Uncertainly,
>
> Still,
>
> Richard.
>
>
>
>
>
>
>
>
>
> Richard Kerry
> BNCS Engineer, SI SOL Telco & Media Vertical Practice
> T: +44 (0)20 82259063[X]<thismessage:/Body.htm#>
> M: +44 (0)7812 325518[X]<thismessage:/Body.htm#>
> G300, Stadium House, Wood Lane, London, W12 7TA
> richard.ke...@atos.net<https://webmail.siemens-it-solutions.com/owa/redir.aspx?C=9fb20d019e3e4cb99344d708709a3177&URL=mailto%3arichard.kerry%40atos.net>
>
> This e-mail and the documents attached are confidential and intended solely
> for the addressee; it may also be privileged. If you receive this e-mail in
> error, please notify the sender immediately and destroy it. As its integrity
> cannot be secured on the Internet, the Atos group liability cannot be
> triggered for the message content. Although the sender endeavours to maintain
> a computer virus-free network, the sender does not warrant that this
> transmission is virus-free and will not be liable for any damages resulting
> from any virus transmitte
> ________________________________
> From: Stefan Bodewig [bode...@apache.org]
> Sent: 31 August 2013 06:59
> To: user@ant.apache.org
> Subject: Re: Use of XML Catalog with Ant (xslt task) - request for example
>
>
> On 2013-08-30, Kerry, Richard wrote:
>
> > I'm still unclear about this. Internally within Ant there seems to be
> > a Classpath that is some combination of CLASSPATH environment
> > variable, -cp parameter, <classpath>, <path id="classpath" >, <path
> > id="class.path" >. <xslt ><classpath /></xslt>.
>
> > Which one can/should I put my resolver's location in ?
>
> <path id="..."/> just defines a PATH like structure. Whether it
> contributes to loading a class or not completely depends on where it is
> used - if at all - via refid. <path id> defines a global variable but
> its id doesn't have any special meaning to Ant.
>
> Whether you put classes into $CLASSPATH or -cp into -lib or $ANT_HOME/lib
> or into nested <classpath> elements influences which classloaders they
> end up in and what you can do with them. Say jar A needs jar B and you
> place jar A in $CLASSPATH then it will not find B if it isn't part of
> $CLASSPATH as well even if you use -lib as $CLASSPATH populates the
> system classloader and -lib a child of the system classloader that is
> invisible to classes loaded via the system classloader.
>
> Some general hints:
>
> * don't use -cp at all. Use the wrapper script shipping with Ant and
> one of the other options.
>
> * don't try to mix where you place your jars that depend on each other.
> In the case of ant-resolver.jar and xml-resolver.jar I'd recommend to
> put them both into $ANT_HOME/lib or use -lib (this is equivalent) but
> never split them. The alternative is to not put them into
> ANT_HOME/lib but use a nested <classpath> holding both of them
> instead.
>
> * if you find yourself having to specify -lib all the time, use
> $ANT_HOME/lib
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org