cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Pietschmann <>
Subject Re: Loading images with relative src
Date Thu, 02 Jan 2003 13:16:46 GMT
On Thursday 02 January 2003 10:58, Anna Afonchenko wrote:
> Hi all.
> I noticed that if I have pipeline like this:
> <map:match pattern="load">
> <map:generate src="" type="html"/>
> <map:serialize type="html"/>
> </map:match>
> Some of the images on the page are not loaded, because they have a relative
> rather than absolue src, e.g. something like src="images/pic.gif" instead
> of src="'

This is really a HTML question, and how browsers resolve URLs.
The images as well as CSS are loaded by the browser and wont
go through the pipeline above.

Suppose the URL "" triggers the pipeline
above. Then if the browser hits an <img src="images/pic.gif"> it will
do a GET request for the URL ""
and so on.

> Now my question is:
> If I want to present the page with all the information present, like images
> and applied external stylesheets through Cocoon. Is there some automated
> way of doing this, or do I have to do this manually, e.g. make an xsl that
> will replace each src and href attribute that doesn't start with http: to
> be absolute by inserting the start of the path into each one?

You can define pipelines redirecting the image and CSS URLs to their
original locations, perhaps if you insert at the end of the match chain
 <map:match pattern="**">
   <map:read src="http://xml.apache.cocoon/{1}/>
(beware: I never tried this).
Writing the XSL for transforming th URLs is another option, but be aware
that parsing the URLs may be more tricky than you expect.


Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message