[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Loading XSL files from stylesheet stored into a JA

Subject: Re: Loading XSL files from stylesheet stored into a JAR
From: cmalderez@xxxxxxx
Date: Wed, 18 Feb 2004 14:39:38 +0100
xsl include jsp
I've found how to do it :)

I've created a class which implements the javax.xml.transform.URIResolve
In this class, the function resolve(String href, String base) only use the href 
parameter in order to find required file as resource using getClass
().getResource(href);

Finally, I return a new StreamSource() with the new URL object created above ..

And it works

Thanks anyway :)

Selon cmalderez@xxxxxxx:

> Hello,
> 
> I'm using JBoss v3.2.3 with Tomcat 4.1.29.
> I've build a small Web application using JSP, EJB producing XML document
> (using 
> JDOM) and displaying data as HTML using XSL stylesheets.
> 
> I want to separate some XSL templates into other XSL files and load them from
> 
> my primary XSL stylesheet.
> Easy using: <xsl:include href="foo.xsl"/>
> 
> But all my JSP and XSL files are packaged into a WAR(jar) file and deployed 
> into JBoss with my EJB package.
> The Web Package (WAR file) is mounted using the web-uri: mytool
> The Web Package contains 2 folders 'jsp/' with all JSP pages & 'xsl/' with
> all 
> XSL stylesheets.
> 
> I access to my JSP using this URL http://localhost:8080/mytool/jsp/myjsp.jsp
> In my JSP I can't load my XSL stylesheets as file because they are in a JAR.
> So I load them using the getClass().getResource('myxsl.xsl');
> 
> But how can I specify the correct URI for the second XSL file 'foo.xsl' which
> 
> must be loaded from the 'myxsl.xsl' ?
> I can't use <xsl:include href="foo.xsl"/> anymore ...
> I've noticed that the following line works <xsl:include 
> href="http://localhost:8080/mytool/xsl/foo.xsl"/> ... but I can't let hard 
> configuration like that in XSL files.
> 
> How can I get a correct mount point in order to load the 'foo.xsl' 
> from 'myxsl.xsl' ??
> 
> Thanks !
> 
> 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.