ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Loading stylesheets from a jar file (<xslt> task)
Date Fri, 17 Jan 2003 16:51:12 GMT
I think the problem lies with <style>, which is the task using the
stylesheet, and which doesn't allow to specify the XSL file using a URL. If
it did, then it would open the door to using custom URL protocols that fetch
files from the classpath for example, as I talked about earlier.

I'll even donate my little (crappy?) implementation of the resource:
protocol to Ant, in all its 120 lines of heavily commented code, and with a
test case for once. --DD

-----Original Message-----
From: Jacob Kjome [] 
Sent: Friday, January 17, 2003 10:42 AM
To: Ant Users List
Subject: Re: Loading stylesheets from a jar file (<xslt> task)

Hello Michael,

You could make your task accept a package path such as...


Then, internally, you could load this as a stream.  I don't know if
that just makes things too non-standard compared to most other Ant
tasks, but it is certainly doable.


Thursday, January 16, 2003, 9:31:47 PM, you wrote:

NM> Does anyone know of a way to load an xsl stylesheet from a jar file
NM> rather than a path off the basedir?

NM> I would like to repackage the javancss stuff to include the stylesheets
NM> in the javancss.jar then load the stylesheet from the jar in ant. This
NM> would ease the issues of having to keep track of both the stylesheets
NM> and the jars separately.

NM> Any ideas?

NM> Thanks,
NM> Mike.

NM> sample code
NM> ===========
NM>     <path id="javancss.cp">
NM>       <pathelement location="${dev.lib.dir}/javancss-xslt.jar"/>
NM>     </path>         
NM>     <taskdef name="javancss" classname="javancss.JavancssAntTask"
NM> classpathref="javancss.cp"/>

NM>     <javancss 
NM>       srcdir          = "${dev.src.dir}"
NM>       packageMetrics  = "true"      
NM>       classMetrics    = "false"     
NM>       functionMetrics = "falase"    
NM>       abortOnFail     = "false"     
NM>       generateReport  = "true"
NM>       outputfile      = "${build.lib.dir}/exception-javancss.xml"  
NM>       format          = "xml"
NM>       includes        = "**/*.java"
NM>     />

NM>     <xslt 
NM>       in="${build.lib.dir}/exception-javancss.xml" 
NM>       out="${build.lib.dir}/exception-javancss.html" 
NM>       style="javancss2html.xsl" 
NM>       classpathref="javancss.cp"
NM>     />  

NM> --
NM> To unsubscribe, e-mail:
NM> For additional commands, e-mail:

Best regards,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message