From: Nikolai Grigoriev (grig@renderx.com)
Date: Mon Nov 10 2003 - 08:15:23 PST
Andrzej,
> This is not the true. Putting the relative url inside single quotes made
> lookup of relative url's work. For example:
>
> <fo:external-graphic width="1.75in" src="url('images/logo.jpg')"/>
>
> works fine and gets the graphic relative to the current Cocoon context.
URLs should work regardless of the quotes around them. I would like
to ask you a favor: could you please format our Hammer sample
(examples/hammer/*) in your environment? It uses both quoted
and unquoted URLs; so far we didn't notice any difference in processing,
but perhaps your situation is somewhat particular. If your
statement about quotes is true, you should see only the first two
images; please inform us if it is indeed the case.
> > 4) I suppose that's because you try to connect to the webserver
> > running on the localhost from within itself. Have you tried to
> > format the same document on the same server from the command
> > line? You may have to use external IP instead of 'localhost'
> > or move your images to another machine to solve the problem.
> That doesn't make any sense whatsoever. localhost is a perfectly
> valid host name that should be resolved to 127.0.0.1. XEP should
> not care what machine the image is located on, since Java's
> handling of URL's makes this totally transparent, unless XEP
> is doing something very strange internally. And if that is the
> case, I consider this a bug in XEP.
XEP fully relies on Java for processing URLs with protocols
other than 'file:', 'data:', and 'resource:'. If it cannot find the file,
the reason is that Java VM cannot establish the respective connection.
Let me repeat the questions:
- Does the absolute URL work when you run XEP from
the command line (outside Cocoon) on the same data?
- Does the problem apply to 'localhost' links only, or to
all http links from Cocoon? In particular, what happen
if you put the external identity of your host (either
its host name or its external IP) instead of the loopback
in the URL?
Please trust me: knowing these answers will help us to
spot the problem better.
> Note that entering the absolute URL exactly as shown above
> in a browser on the local machine returns the image just fine.
OK, it proves that the URL is correct.
> Could you please look into the XEP code that is handling
> the external-graphic src="url()" attribute? It is my belief
> that there is something in your code that shouldn't be there
> that is causing this.
There is nothing special there: we just build a java.net.URL
object from the string (with an optional base URL), and then
call openStream() on it.
I have a counterbelief that there's something wrong in URL
handling inside your servlet engine. It often happens that
servlet containers replace Java default processing of URIs
with their own protocol handlers. If you kindly run the tests
we asked, it permits at least to exclude this as a possible
cause.
Best regards,
Nikolai Grigoriev
RenderX
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
This archive was generated by hypermail 2.1.5 : Mon Nov 10 2003 - 08:17:50 PST