cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Roebuck>
Subject Re: C2: Relative URLs in output vs. <sitemap>
Date Tue, 18 Jul 2000 12:40:07 GMT
> Stuart Roebuck wrote:
> >
> > I've been looking at the <sitemap> and considering issues relating to
> > Cocoon 2 based websites.  One big issue that I can't see an obvious
> > solution to (but that doesn't mean there isn't one :-) ) relates to the 
> > <transformer> based generation of relative links to web based resources 
> > from pages which can be mapped into different spaces in resulting site 
> > hierarchy.
> ...
> > You auto-generate standard parts of each page using a transform which, 
> > amongst other things, creates relative links to a background image used on 
> > every page.  The relative link to this image is "images/background.gif". 
> >
> > As the site expands, you add extra pages, including some news pages,
> > generated by some files called "news/*.xml" and mapped to and called,
> > "somenews.html" and "someothernews.html" (at the root directory).
> > Everything works fine.
> [I know this was not your point and I'm being annoyinly picky, but URI
> space design is really important]

No problem - my example was intended to be as simple as possible.

> Same as above: you should not use extentions in your URI space unless
> you "really" mean it.
> > Then you decide you need to organise things better because you've got all 
> > your pages mapped onto the root directory and run into potential name
> > conflicts, so you change the <sitemap> and map your news pages onto
> > "news/*.html".
> >
> > Suddenly, all your backgrounds disappear, because the links to the
> > background are added by a single XSLT transformer that doesn't know that 
> > the absolute address of the pages it is transforming are different.
> >
> > As far as I am aware, you can't do the checking you would need to fix this 
> > because it would use XSP which is a generator not a transformer.
> Have you thought about using sitemap internal redirection capabilities?

Yes, I have, and this example would allow for that, but it all gets a  
little bit messy if you're having to redirect particular images to  
different paths, particularly if the images do not represent 'standard'  
content, but more specific stuff, e.g. the photo that goes with a  
particular news item on your site.  It also presents issues with regard to  
client-side caching, because the same image used in different places will  
be unnecessarily re-loaded.

Cocoon 2 and its sitemap redirection are going to be really really useful,  
but this is a case where it could become an over-use of redirection, and  
could end up breaking the clean separation of model and view.

It would be much cleaner if, for example, a XSLT sheet could have the  
functionality to convert a site context absolute reference into a relative  
reference based upon the path of the currently requested URI.  The ultimate  
would be if you could reverse process the redirection and allow a  
reference to an absolute resource to be converted to the externally mapped  
URI on the fly.

These suggestions may be daft, but the underlying concern is that most web  
pages link to others using relative paths - relative paths offer  
portability which is very important.  With the flexibility of sitemap  
redirection comes a strong linkage between the redirection and the  
stylesheets and this appears to compromise some of the nice Model/View  
separation that is otherwise the absolute beauty of Cocoon 2.  I raise this  
now, because sitemaps are almost complete (in concept if not in  
implementation), and this seems to be an issue that may be worth  
investigating now.

I hope that makes sense!


View raw message