Sorry about the subject line, but my previous subject "SVG Problem with FOP"
got no replies.  I only just recently learned about the FOP User list; up
till now it hasn't been well advertised.

Your reply was very informative (thank you very much) and from your list of
possible solutions, I've tried #3.  However, it still can't locate the
gradient definition.  It gives the following error "An I/O error occured
while processing the URL 'file:C:/Projects/Dev/Gradient.svg#PurpleToWhite'" 

The exception generated by Batik now identifies the correct file, but still
can't seem to locate the gradient definition.  In the Gradient.svg file I
copied the following:

<svg xmlns="http://www.w3.org/2000/svg";>
  <g>
    <defs>
      <radialGradient id="PurpleToWhite" gradientUnits="objectBoundingBox"
cx=".5" cy=".5" r=".5">
        <stop offset="5%" stop-color="white"/>
        <stop offset="100%" stop-color="rgb(100,0,100)"/>
      </radialGradient>
    </defs>
  </g>
</svg>

I've also tried

<svg xmlns="http://www.w3.org/2000/svg";>
    <defs>
      <radialGradient id="PurpleToWhite" gradientUnits="objectBoundingBox"
cx=".5" cy=".5" r=".5">
        <stop offset="5%" stop-color="white"/>
        <stop offset="100%" stop-color="rgb(100,0,100)"/>
      </radialGradient>
    </defs>
</svg>


I've also tried removing <defs> and <svg> (in a desperate search for a
solution).  Nothing works.

Is there anything I'm doing that is blatantly wrong?  I'm hoping I just
haven't created my Gradient.svg correctly.

Thanks again,
Scott




-----Original Message-----
From: Joerg Pietschmann [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 4:55 AM
To: FOP Dev
Subject: Re: Please help, even if it's just a reply that it can't be
done


"Scott Moore" <[EMAIL PROTECTED]> wrote:
> I cross-posted this several days ago and didn't get a single reply.

Before i get to the meat, a net.cop note: Use meaningful subjects,
don't mention crossposting (even if it is justified in the first place),
don't bother the gurus in the dev lists, there are user lists.

> Is the problem in my XSL-FO?
> Is the problem in my SVG?
> Is the problem with Batik?
> Is the problem with FOP?

Well, ultimately the problem is caused by a somewhat unlucky choice
of the SVG standards group...

> An I/O error occured while processing the URI
> 'file:D:/Projects/Dev/#PurpleToWhite' specified on the element <circle>

The "url(#PurpleToWhite)" in your circle element is a relative URL
which was resolved to the absolute URL in the error message above,
which, as it apparently represents a directory, is not a good source
for SVG gradients.
The reason why you got the absolute URL above depends on how you
invoked FOP and perhaps a few other circumstances. In any case it has
to point to a valid SVG file (or at least XML). This may be somewhat
problematic as you probably generate the SVG inline in the FO tree.

You could try
1. Have a separate SVG file and use it with fo:external-graphics
2. Have a separate SVG which contains only the gradient (and perhaps
   other SVG stuff you want to reference) and point an absolute URL
   to it:
     fill="url(file:///c:/refstuff/grad.svg#PurpleToWhite)"
3. Same as above but use a relative URL
     fill="url(grad.svg#PurpleToWhite)"
   This may be easier to deploy. Put the file in D:/Projects/Dev.
4. Let the URL refer to some location where the gradient could be
   retrieved, for example if the SVG code is embedded in your XSL,
   try fill="url(my.xsl#PurpleToWhite)". Don't know whether this
   works, or whether this is even supposed to work.
Expect a performance hit in all cases.

Ultimately, both FOP and especially Batik should be fixed to make
your code work as expected, but this will not only take some time
but also some efford by a standard committee in order to make the
semantics of this kind of references in embedded SVG clearer.

HTH
J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to