Ok, you got me started. I looked into this and found out the
following ;-)

In the xsl spec., the src attribute for
<fo:external-graphic> is specified to contain a
'<uri-specification>'
For all I know, this is the URI definition as defined in
RFC2396.
Looking into this and comparing the three attribute values
that failed I came up with this:

1) src="logo.jpg"
This should work since 'logo.jpg' is a correct relative URI
according to the BNF

2) src="file:./logo.jpg"
This should also work since 'file:./logo.jpg' defines a
correct absoluteURI.

3) src="file://./logo.jpg"
This defines an absolute URI, but the file:// should be
followed by a 'server' or a 'reg_name' according to the RFC.
I believe that the code parsing the file://./logo.jpg treats
the . after 'file://' as a server name, hence the URL error.

Of the three I got 1 and 2 working using Fop-0.20.2,
Xalan-2.3.0 and Xerces-2.0.0 (which is good, since they s h
o u l d work).
Example 3 failed, complaining about Invalid Image URL -
error on relative URL, which I believe is a correct error
message.
The relative URL really is incorrect.

I also used a relative URI as in
src="/root/path/to/images/image.jpg", which worked. (Note
the missing file:)

Hope this 'clears' up some of the fog.

Rgds///
        Magnus


Klosa Uwe wrote:
> 
> Hello Magnus,
> 
> have you tried this: <fo:external-graphic src="url(image.jpg)"/>
> 
> I found it somewhere in the internet.
> 
> Uwe
> 
> -----Ursprungligt meddelande-----
> Fran: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Magnus Sjoberg
> Skickat: den 13 mars 2002 12:58
> Till: [EMAIL PROTECTED]
> Amne: Re: SV: external-graphic src syntax
> 
> I use Fop 0.20.2 and as long as the path to the imagefile is
> absolute, it works.
> 
> Like so: <fo:external-graphic
> src="file:/abs/path/to/images/image.jpg"/>
> 
> Also, there is an entry in Fop's config.xml where you can
> set the basedir but the comment says 'not implemented'.
> If, and when this entry gets supported, that should be the
> place where you specify the basedir, enabling relative file
> paths.
> 
> ///Magnus
> 
> Klosa Uwe wrote:
> >
> > It works only with fop0_19_0. All fop0_20_x has the same error. I've tried
> > it in two days now.
> >
> > Uwe
> >
> > -----Ursprungligt meddelande-----
> > Fran: Michael Engelhart [mailto:[EMAIL PROTECTED]
> > Skickat: den 12 mars 2002 16:28
> > Till: [EMAIL PROTECTED]
> > Amne: external-graphic src syntax
> >
> > Can someone show me the syntax to using
> > <fo:external-graphic>??
> >
> > I have an image in the same directory as the stylsheet and have tried
> > this syntax:
> >
> > <fo:block text-align="center">
> >      <fo:external-graphic src="logo.jpg"/>
> > </fo:block>
> >
> > this syntax:
> >
> > <fo:block text-align="center">
> >      <fo:external-graphic src="file:./logo.jpg"/>
> > </fo:block>
> >
> > this syntax:
> > <fo:block text-align="center">
> >      <fo:external-graphic src="file://./logo.jpg"/>
> > </fo:block>
> >
> > and none of them work.  I always get this error:
> > [ERROR]: Error while creating area : Error with image URL: ./logo.jpg
> > (No such file or directory) and no base directory is specified
> >
> > I have compared this to the images.fo example document as well as the
> > W3C XSL spec and it doesn't work.
> > I can sort of get it to work using an external url like
> > "http://somewhere.com/logo.jpg"; but when I do it that way my application
> > hangs and never comes back.
> >
> > any ideas??

Reply via email to