including XSL file(s) from multiple paths

jdharsha used Ask the Experts™

Aim: Include one XSL file into another.

Background: I have configured the relative path to the directory where the common xsl's exist, please find below.

      ByteArrayInputStream bs = new ByteArrayInputStream(template);
      URL commonTemplatesUrl = PdfReportBuilder.class.getResource("/fop/xsl/");
      Source xsltSrc = new StreamSource(bs, commonTemplatesUrl.toExternalForm());

The relative path("/fop/xsl/") exist in a jar file (the jar is included in the classpath of the project).

Problem: I had a requirement to include another XSL file at project level. Because the included templates are only getting picked at the relative path ("/fop/xsl/") I created a folder structure("/fop/xsl/") at the project level. And now the common XSL's i.e from jar file are not getting picked.

Question: Is there a way to configure multiple paths??

please let me know if you need more info.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Extract the common XSLs from jar file and put it in a folder (/fop/xsl) your created in your project along with another XSL files.

Java will look for package structures at project level first. If found then it doesnt search further in jars.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial