You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by John Francis <jf...@his.co.uk> on 2000/11/15 14:04:50 UTC

Importing Stylesheets when the importing stylesheet has been loaded from a JAR

 I wish to release the stylesheet files I use in a jar with the server that
uses them.
 I can load the primary stylesheet using the standard class loader
"InputStream inStr = getClass().getResourceAsStream(primaryXSLFilename)".
However this imports some stylesheets which I wish to maintain separately,
but should be loaded from the same "directory" in the jar file.
 Is there some way of telling xalan to use the class loader rather than the
file system to load files ?

 Thanks, and thanks for xalan,xerces,ant etc... in the first place.

Re: Importing Stylesheets when the importing stylesheet has been loaded from a JAR

Posted by Fergus Gallagher <Fe...@OrbisUK.com>.
If you open using an InputStream, the location information is lost so any 
xsl:import or xsl:include can't know where to look.

Is I understand it, you should be able to specify

         XSLTInputSource("jar:<url>!/{entry}")

and then any imported stylesheets would be relative to that.   However, 
this appears to be broken (in Xalan 1 at least) and you have to specify a 
full URL :-(

Fergus


At 13:04 15/11/00 +0000, John Francis wrote:

>  I wish to release the stylesheet files I use in a jar with the server that
>uses them.
>  I can load the primary stylesheet using the standard class loader
>"InputStream inStr = getClass().getResourceAsStream(primaryXSLFilename)".
>However this imports some stylesheets which I wish to maintain separately,
>but should be loaded from the same "directory" in the jar file.
>  Is there some way of telling xalan to use the class loader rather than the
>file system to load files ?
>
>  Thanks, and thanks for xalan,xerces,ant etc... in the first place.

-- 
Fergus Gallagher
Orbis
http://www.orbisuk.com/
+44-(0)20-8987 0717