You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Pe...@bmwna.com on 2002/10/22 16:37:31 UTC

external-graphic image location

I have a servlet that uses xsl:fo stylesheets which are located in the
WEB-INF directory of my webapp. Some of the stylesheets use the
fo:external-graphic tag. How can I get this tag to look in the /images
directory of my webapp? Where is it loking by default?

Thanks.

Peter Giesin

Re: external-graphic image location

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Peter.Giesin@bmwna.com wrote:

> I have a servlet that uses xsl:fo stylesheets which are located in the
> WEB-INF directory of my webapp. Some of the stylesheets use the
> fo:external-graphic tag. How can I get this tag to look in the /images
> directory of my webapp? Where is it loking by default?

You can set baseDir to point there, see 
http://marc.theaimsgroup.com/?l=fop-dev&m=101354604124258&w=2

-- 
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


RE: external-graphic image location

Posted by Roland Neilands <rn...@pulsemining.com.au>.
> > (I assume we are talking about FOP here). From experience 
> > (I am not sure whether it is documented), the default path will be 
> > relative to the fo file itself.

or the xml file (for the -xml option).

> 
> Only for the command line application.
> If FOP runs embedded, relative URLs usualy don't work at all
> until baseDir is explicitely set. There are some JDKs interpreting
> them as files relative to the current directory of the servlet
> container. Absolute URLs work always.
> 
> The next question is probably how to get the value for baseDir.
> The answer is to look up ServletContext.getRealPath().
> 
> J.Pietschmann
> 

Re: external-graphic image location

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Victor Mote wrote:
> (I assume we are talking about FOP here). From experience (I am not sure
> whether it is documented), the default path will be relative to the fo file
> itself.

Only for the command line application.
If FOP runs embedded, relative URLs usualy don't work at all
until baseDir is explicitely set. There are some JDKs interpreting
them as files relative to the current directory of the servlet
container. Absolute URLs work always.

The next question is probably how to get the value for baseDir.
The answer is to look up ServletContext.getRealPath().

J.Pietschmann



RE: external-graphic image location

Posted by Victor Mote <vi...@outfitr.com>.
Peter Giesen wrote:

> I have a servlet that uses xsl:fo stylesheets which are located in the
> WEB-INF directory of my webapp. Some of the stylesheets use the
> fo:external-graphic tag. How can I get this tag to look in the /images
> directory of my webapp? Where is it loking by default?

(I assume we are talking about FOP here). From experience (I am not sure
whether it is documented), the default path will be relative to the fo file
itself. So, if by "xsl:fo stylesheets" you mean the xsl:fo document that is
output from your stylesheet, and if your directory structure is:
    /u/webapp/WEB-INF
    /u/webapp/images

then you could reference the image file as "../images/myimage.jpg" or by
"/u/webapp/images/myimage.jpg".

Victor Mote