Sylvain Wallez wrote: > > IMO, we really need the "context:/" (single slash) we talked > about some time ago, that resolves relatively to the > currently executing sitemap (i.e. the one defining the VPC). > Relative sources (with no protocol) must always be resolved > relative to the sitemap where the VPC is called. > However, the implementation of some VPCs, just as in my > example above, needs some resources to be resolved relative > to the sitemap in which the VPC is defined. > > So my example could be rewritten as follows: > > <><map:virtual-generator type="foo"> > <map:generate src="{src}"/> > <map:act type="lang-select"> > <map:transform type="i18n"/> > </map:act> > <map:transform type="xslt" src="context:/stylesheets/{bar}.xsl/> > </map:virtual-generator> > > That way, there is no magical absolutization applied. > > Thoughts? > Yes, this is the "no magic" solution :) which works and which is not bad, but I see one potential problem for users: You have a different behaviour in the same sitemap if you use:
<map:transform type="xslt" src="tylesheets/bar.xsl/> in a virtual component or in a regular pipeline. And this is imho very difficult to explain. We will get thousands of requests saying: "Why can't this nice Cocoon not find my stylesheet"? My first idea was to do it the other way round, so if you want to access a resource of the current sitemap (not the sitemap the VPC is defined in) you use a special protocol (I just name it 'current' for the sake of the example): <map:virtual-generator type="foo"> <map:generate src="current:{src}"/> <map:act type="lang-select"> <map:transform type="i18n"/> </map:act> <map:transform type="xslt" src="stylesheets/{bar}.xsl/> </map:virtual-generator> If in the example from above, {src} is relative, it's resolved relative to the current sitemap; if it's absolute 'current:' is ignored. But for me this looks a little bit ugly as well... Hmmm. Carsten