external-graphic - problem using relative path
Hi all, I posted a message regarding this problem a couple of weeks ago, but received no reply. I need to reference images ("external-graphic") in my xsl. It seems to work fine when I use the absolute path, but not when I use the relative path. Please find attached my original message - it's a little more detail and contains some sample XSL. Any help on this would be greatly appreciated. TIA, Micheál Micheál HealyEngitech Ltd.[EMAIL PROTECTED] Hi all, I'm using Xalan to create my .fo files from XML and XSL, then rendering pdf's using fop (v.0.19). I'm using JDK 1.3. This is all within a servlet. I'm using Apache and Tomcat together as web server and servlet engine. My problem is when I try to include 'external-graphics'. I want to be able to get the graphics using a relative path over the web server. Problem is, when I put the path "http://localhost/VincentSite/img/checkbox.gif", it works, but "/VincentSite/img/checkbox.gif" doesn't. The strange thing is, I use a dictionary aswell, and I can find that using either "/VincentSite/xml/Dictionary.xml", or "http://localhost/VincentSite/xml/Dictionary.xml", so I know I'm using the correct path. Also, this happens within a larger application which uses relative paths everywhere in the XSL to get images, and has no problems. I've looked elsewhere for a solution to this, and can't seem to find one, so any help would be much appreciated. TIA Micheál Micheál HealyEngitech Ltd.[EMAIL PROTECTED] xsl:choosexsl:when test="PersonalData/Checked='Y'"fo:table-cellfo:block font-size="9pt" line-height="13pt" text-align="start"fo:external-graphic src="/VincentSite/img/chkbxgif-y.gif"//fo:block/fo:table-cell/xsl:whenxsl:otherwisefo:table-cellfo:block font-size="9pt" line-height="13pt" text-align="start"fo:external-graphic src="/VincentSite/img/chkbxgif.gif"//fo:block/fo:table-cell/xsl:otherwise/xsl:choose - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: external-graphic - problem using relative path
try fo:external-graphic src=file:VincentSite/img/chkbxgif-y.gif/ mvh Ronald -Original Message- From: Micheál Healy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 12:16 PM To: [EMAIL PROTECTED] Subject: external-graphic - problem using relative path Hi all, I posted a message regarding this problem a couple of weeks ago, but received no reply. I need to reference images (external-graphic) in my xsl. It seems to work fine when I use the absolute path, but not when I use the relative path. Please find attached my original message - it's a little more detail and contains some sample XSL. Any help on this would be greatly appreciated. TIA, Micheál Micheál Healy Engitech Ltd. [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: external-graphic - problem using relative path
Ronald, Thanks for the suggestion, but unfortuately, it hasn't worked. I still get the following error - Invalid Image URL - error on relative URL : java.lang.NullPointerException. I tried both fo:external-graphic src=file:VincentSite/img/chkbxgif-y.gif/ and fo:external-graphic src=file:/VincentSite/img/chkbxgif-y.gif/ with identical results. I wonder if it's something to do with my configuration, although, as I said, I can read the dictionary using a relative path. Any ideas? Thanks, Micheál - Original Message - From: Ronald Jaramillo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 18, 2001 12:38 PM Subject: RE: external-graphic - problem using relative path try fo:external-graphic src=file:VincentSite/img/chkbxgif-y.gif/ mvh Ronald -Original Message- From: Micheál Healy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 12:16 PM To: [EMAIL PROTECTED] Subject: external-graphic - problem using relative path Hi all, I posted a message regarding this problem a couple of weeks ago, but received no reply. I need to reference images (external-graphic) in my xsl. It seems to work fine when I use the absolute path, but not when I use the relative path. Please find attached my original message - it's a little more detail and contains some sample XSL. Any help on this would be greatly appreciated. TIA, Micheál Micheál Healy Engitech Ltd. [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: external-graphic - problem using relative path
try placing an image (say foo.gif ) on the same directory as the fop.jar . Then write a simple fo file: ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=simple fo:region-body margin-top=3cm/ fo:region-before extent=1.5cm/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-name=simple fo:flow flow-name=xsl-region-body fo:block fo:external-graphic src=file:foo.gif/ /fo:block /fo:flow /fo:page-sequence /fo:root Place it in the same directory and test if from the command line. If this does not work, something is broken with the version of fop you are using. Most probably the path you are using should be relative to where the fop.jar is placed ( this is what works for me, not necesary the best way to do it ) MVH Ronald -Original Message- From: Micheál Healy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 2:44 PM To: [EMAIL PROTECTED] Subject: Re: external-graphic - problem using relative path Ronald, Thanks for the suggestion, but unfortuately, it hasn't worked. I still get the following error - Invalid Image URL - error on relative URL : java.lang.NullPointerException. I tried both fo:external-graphic src=file:VincentSite/img/chkbxgif-y.gif/ and fo:external-graphic src=file:/VincentSite/img/chkbxgif-y.gif/ with identical results. I wonder if it's something to do with my configuration, although, as I said, I can read the dictionary using a relative path. Any ideas? Thanks, Micheál - Original Message - From: Ronald Jaramillo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 18, 2001 12:38 PM Subject: RE: external-graphic - problem using relative path try fo:external-graphic src=file:VincentSite/img/chkbxgif-y.gif/ mvh Ronald -Original Message- From: Micheál Healy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 12:16 PM To: [EMAIL PROTECTED] Subject: external-graphic - problem using relative path Hi all, I posted a message regarding this problem a couple of weeks ago, but received no reply. I need to reference images (external-graphic) in my xsl. It seems to work fine when I use the absolute path, but not when I use the relative path. Please find attached my original message - it's a little more detail and contains some sample XSL. Any help on this would be greatly appreciated. TIA, Micheál Micheál Healy Engitech Ltd. [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]