Steiner, Priska wrote:
> 
> I would like to make a report with an image in it. When I render the xml and
> the xsl with the image source,  with FOP 0.20.4 out a commandline, it works
> fine. But I have to render it, with exactly the same files in a FOPServlet.
> There it gives me a NullPointerException.

Taking a wild stab in the dark (you'd probably want to provide a stack 
trace for a more accurate guess.. :), the generated file URL isn't valid.

Your file URL will end up looking like:

   file:c:\xsl\bild_1200011229.jpg

There are a few problems with this. First, the URL doesn't have a 
leading '/', or an authority part. Eg:

   file:///c:\xsl\bild_1200011229.jpg

or at least:

   file:/c:\xsl\bild_1200011229.jpg

Next, the ':' character the 'c' is (IIRC) invalid for a URL at that 
point, and either needs to be escaped or replaced with something valid 
(a '|' is usally used)

   file:/c|\xsl\bild_1200011229.jpg

or

   file:///c%3A\xsl\bild_1200011229.jpg

Lastly, you've used '\' as the path separator, not '/', which is also 
invalid in a URL. So, in the end, the URL shoulddl look like:

   file:///c|/xsl/bild_1200011229.jpg

Either you'll want to modify your XML to use a valid URL path component 
and your XSLT to use prepend "file:///" instead of just "file:", or 
modify your XSLT to fixup the Windows file path, turning it into a valid 
URL path component as part of the transformation.

I don't know how lax the JRE on Windows is WRT strict parsing of file 
URLs, but if you fix up all of the above, at least you'll know you're 
referencing your image correctly. :)

HTH,
/mike

-- 
Michael Gratton <[EMAIL PROTECTED]>
Recall Design <http://www.recalldesign.com/>
s: 53 Gilbert Street Adelaide SA 5000 Australia
t: +61 8 8217 0500 f: +61 8 8217 0555

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to