cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From li...@kuhnle.net
Subject Manually specifying a mounted sub sitemap's context
Date Fri, 08 Apr 2005 00:47:43 GMT
Hi, I suggest a new parameter for map:mount that specifies the context of 
the sitemap, i.e. the URL against which all relative URLs are resolved. 
Normally, this is the sitemap's own URL, but there are cases where 
specifying a different URL makes things easier.

One is the use of generated sitemaps (see excerpt from a root sitemap 
below). Here the sub sitemaps are generated from a simple XML file and 
mounted with the cocoon:// protocol. With this, the URLs in the sitemap 
for "somepath/" are resolved relative to "cocoon://somepath/", but it 
would be nice to still have them resolved relative to "somepath/", since 
this is were most files used in the sitemap will be. I therefor suggest a 
new attribute "context" for "map:mount" that specifies the sitemap 
context. I will gladly supply a small patch which does this.

Btw: This example is theoretical, as mounting sitemaps with the "cocon://" 
protocol plunges Cocoon into endless recursion, at least with the example 
specified below, see 
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=111140628621975&w=2 . 
This problem would also be solved.

Regards,
Jochen

<!-- Generate sub sitemaps -->
<map:match pattern="**/sitemap.xmap">
    <map:generate type="file" src="{1}/resources.xml"/>
    <map:transform type="xslt" src="context:/resources2sitemap.xsl">
        <map:parameter name="path" value="{1}"/>
    </map:transform>
    <map:serialize type="xml"/>
</map:match>
<!-- Mount sub sitemaps -->
<map:match pattern="*/**">
    <map:mount check-reload="yes" 
src="cocoon:raw://{1}/sitemap.xmap?cocoon-view=" uri-prefix="{1}"/>
    <!-- <map:mount check-reload="yes" 
src="cocoon:raw://{1}/sitemap.xmap?cocoon-view=" uri-prefix="{1}" 
context="{1}/"/> -->
</map:match>



Mime
View raw message