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 17:24:48 GMT
A follow-up thought to my previous post:

How about implementing the concept of a site context absolute reference,  
perhaps with syntax like:


which would be equivalent to:

Then provide a Cocoon transformer that will convert a context:// reference  
to a relative reference based upon the external URI of the referring page.


Image that we have a context within which the file:


Is mapped to an external URI:

with the Cocoon 2 mapping:

	<map:match pattern="*.html">
		<map:generate src="data/{1}.xml" />

The style sheet transforms that follow result in an HTML file containing a  
context based absolute reference to a graphic of the form:


A final context-links-transform converts this into a relative link, taking  
account of the current page URI ("a_news_story.html").  This results in  
the relative link:


However, during a re-organisation all the news files are re-located on the  
site map and the mapping becomes:

	<map:match pattern="news/*.html">
		<map:generate src="data/{1}.xml" />

With the current Cocoon setup this would break any generated HTML link to  
the background file "images/background.gif" which would (unintentionally)  
link to the file "news/images/background.gif".

With the concept of the context based link the context-links-transform  
would detect that the current page URI was "news/a_news_story.html" and  
change the relative link to:


... just a thought,


View raw message