[xsl] XSL-FO transformation: XSL template packed in a JAR

Subject: [xsl] XSL-FO transformation: XSL template packed in a JAR
From: "Aitor San Juan" <asanjuan@xxxxxxxxxxxxxx>
Date: Tue, 19 Jul 2005 08:41:54 +0200
Hi List!

I have developped a Java class to transform an XML file into a PDF file using
FOP. My Java class, the XSL template and a .gif file (the image that will
appear as the logotype in the header of each page of the resulting PDF file)
are packed in a JAR file.

The XSL template uses a relative URL that points to the .gif file, as:
[code]url('./mylogo.gif')[/code]

The transformation completes Ok, BUT the FOP transformation process is unable
to locate the gif file, which in turn tries to locate it as an external file
on the local file system. Both, the XSL template and the .gif file are packed
in the same subdirectory inside the JAR file.

I use something similar to the following line of code to access the XSL
template packed in the JAR:

[code]getClass().getResourceAsStream("/net/bolsabilbao/xsl/xml2pdf.xsl")[/cod
e]

My question: How can I say the FOP processor (or my class, or whoever) that
the .gif file is packed in the JAR?

Any hint or suggestion would be highly appreciated.

Thanks in advance.

Current Thread