You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ma...@tiger.com.pl on 2001/09/29 05:08:24 UTC

fop and images on relative paths

Is there a way to make fop to include images described
by relative path e.g.:
<fo:external-graphic src="img/path.jpg" ...

Maciek Kaminski
maciejka@tiger.com.pl

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: fop and images on relative paths

Posted by Gianugo Rabellino <gi...@rabellino.it>.

> Is there a way to make fop to include images described
> by relative path e.g.:
> <fo:external-graphic src="img/path.jpg" ...

Not really, and almost on purpose. I ran into the same problem when writing
the RTF serizalizer and found out that Serializers don't know anything about
the context, which includes the various path informations.

Actually, however, even if has been done on purpose (I understand that it
has to do with caching), this can be seen as a "feature": Cocoon strongly
decouples the physical sources and the virtual URI they are mapped to. This
means that it's ankward, to say the least, to understand what should be
considered the starting point to be used for relative paths.

Suppose you have the following situation: your sitemap matches
/mysite/docs/printer/document.pdf, which resolves in a generation using
/mysite/sources/document.xml and a trasformation using
/mysite/xslt/fo/document.xsl. How should a URI such as "../img/myimg.gif" be
resolved? You have three options:

1. URI mapping: the image resides in /mysite/docs/img/mysite.gif;
2. Source mapping: this resolves in /mysite/img/mysite.gif;
3. Transformation mapping: finally here it would be
/mysite/xslt/img/myimg.gif.

There is no particular reason to prefer one over the other: the solution,
unfortunately, is to stick to absolute link. I'm thinking about writing a
sort of LinkAbsolutizerTransformer which takes the "src" and "href"
attributes, sees if they are relative and acts accordingly setting them to
an absolute value. But I'm not quite sure this would be a good solution.

Meanwhile, absolute links are the way to go.

Ciao,

--
Gianugo Rabellino


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: AW: fop and images on relative paths

Posted by Ed Nixon <ed...@LynnParkPlace.org>.
I think the src attribute requires a URI rather than a relative path 
reference. Consequently, the safest syntax would seem to be something 
involving either file:/// or http:// type identifiers.


At 09:01 AM 29/09/2001 +0200, =?us-ascii?Q?Jorn_Heid?= wrote:
>I have asked nearly the same question and didn't get an answer yet. For now,
>I'm using http:// inside <image xlink:href="http://.."/>
>
>JOERN_HEID
>
>-----Ursprungliche Nachricht-----
>Von: maciejka@tiger.com.pl [mailto:maciejka@tiger.com.pl]
>Gesendet: Samstag, 29. September 2001 05:08
>An: cocoon-users@xml.apache.org
>Betreff: fop and images on relative paths
>
>
>Is there a way to make fop to include images described
>by relative path e.g.:
><fo:external-graphic src="img/path.jpg" ...
>
>Maciek Kaminski
>maciejka@tiger.com.pl
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>




---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


AW: fop and images on relative paths

Posted by Jorn Heid <he...@fh-heilbronn.de>.
I have asked nearly the same question and didn't get an answer yet. For now,
I'm using http:// inside <image xlink:href="http://.."/>

JOERN_HEID

-----Ursprungliche Nachricht-----
Von: maciejka@tiger.com.pl [mailto:maciejka@tiger.com.pl]
Gesendet: Samstag, 29. September 2001 05:08
An: cocoon-users@xml.apache.org
Betreff: fop and images on relative paths


Is there a way to make fop to include images described
by relative path e.g.:
<fo:external-graphic src="img/path.jpg" ...

Maciek Kaminski
maciejka@tiger.com.pl

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>