look at this snippet: <!-- Lenya GUI screen --> <map:match pattern="lenya-screen.xsl"> <map:generate src="fallback://lenya/xslt/util/page2xhtml.xsl"/> <map:transform src="lenya/xslt/util/page2xslt.xsl"> <map:parameter name="contextprefix" value="{request:contextPath}"/> </map:transform> <map:serialize type="xml"/> </map:match> page2xhtml.xsl is a stylesheet that renders a page:page to xhtml. page2xslt.xsl is an identity stylesheet with one exception: it matches <xsl:param name="contextprefix"/>, and replaces it with <xsl:param name="contextprefix" select="$contextprefix"/>. can i suggest a new bug severity level "howler"? i don't know what the original intention of this was, but i can't think of anything that could possibly justify such a baroque extravaganza :P unless i'm very much mistaken, this whole shebang could be replaced by <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/> <map:parameter name="contextprefix" value="{request:contextPath}"/> </map:transform> wherever src="cocoon://lenya-screen.xsl" is used...
Created attachment 20219 [details] gets rid of the lenya-screen.xsl stuff altogether removes lenya-screen.xsl from pipelines.xmap, and replaces all occurences by direct calls to webapp/lenya/xslt/util/page2xhtml.xsl.
please review. this patch should not go in before 1.4, as it does not address a bug and might break stuff for users. now we have two remaining ways of styling a cms page: a direct call to webapp/lenya/util/page2xhtml.xsl, and a call to a local resource "style-cms-page" that is declared in many sitemaps (redundantly). this resource additionally does an 1i8n transform and strips namespace nodes. the best solution would be to figure out a way to build a global resource (currently, you can't use resources defined in other sitemaps unfortunately), and to use that everywhere.
(In reply to comment #1) [...] > unless i'm very much mistaken, this whole shebang could be replaced by > <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/> > <map:parameter name="contextprefix" value="{request:contextPath}"/> > </map:transform> > wherever src="cocoon://lenya-screen.xsl" is used... That approach doesn't scale well. Whenever you change the parameter set of the page2xhtml.xsl stylesheet, you'd have to update each call to the stylesheet.
Renaming Lenya 1.4 to 2.0
just as a todo note: this issue could be resolved if we introduced one global post-processing chain for documentes requested via publication urls. it would also get rid of the style-cms-page resource which is being duplicated all over the place. implies that publications must serialize to xml and the global sitemap must do the post-processing. wdyt?