dcsimg
How to solve the following problem:!_NEWLINE_!I have a set of...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Lemao_Lemao
Posted On:   Tuesday, August 29, 2000 07:29 AM

How to solve the following problem:
I have a set of import dependencies between XSL files and I would like to package them inside a jar file. If I refer to the main XSL through the packaging directory structure so that I can use getResourceAsStream() it fails to get the imported ones. Apparently set systemId does not work for XSL files as resources inside a Jar file. I am using XERCES/XALAN.

Re: How to solve the following problem:!_NEWLINE_!I have a set of...

Posted By:   Doug_Erickson  
Posted On:   Saturday, March 31, 2001 12:31 AM

Rather than getting the resource as a stream,
use


URL url = getClass().getResource(name);
Source xsl = new StreamSource(url.toExternalForm());
Transformer xform = factory.newTransformer(xsl);

When you supply the system ID, relative references will
be resolved with respect to it. When only the stream is
provided, the processor has no idea where the data is coming
from and can't resolve relative paths.

About | Sitemap | Contact