Yes you can insert a processing instruction in your XML and set up Cocoon 2 to respect it. In short, you create a "bootstrap" stylesheet which finds the stylesheet you want, and you call it using the "cocoon:" protocol. See http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102003720732535&w=2 It's perhaps not an ideal system, but it works ;-)
Con > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 14 May 2002 10:18 > To: [EMAIL PROTECTED] > Subject: DO NOT REPLY [Bug 9048] New: - Can we pass the name > of the xsl > to used for transformation as a parameter > > > DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG > RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT > <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9048>. > ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND > INSERTED IN THE BUG DATABASE. > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9048 > > Can we pass the name of the xsl to used for transformation as > a parameter > > Summary: Can we pass the name of the xsl to used for > transformation as a parameter > Product: Cocoon 2 > Version: 2.0 > Platform: Other > OS/Version: Other > Status: NEW > Severity: Blocker > Priority: Other > Component: general components > AssignedTo: [EMAIL PROTECTED] > ReportedBy: [EMAIL PROTECTED] > > > Earlier, while using cocoon-I, we created a xml wrapper as below: > > "<?xml version=\"1.0\" encoding=\"UTF-8\" > standalone=\"yes\"?>" + '\n' + > "<?xml-stylesheet href=\"" + reportName + ".xsl\" > type=\"text/xsl\"?>" > + '\n' + > "<report>" + '\n' + > "<reportDate>" + > DateFormat.getDateInstance().format(new Date()) > + "</reportDate>" + '\n' + > reportDef + > "<legal>Nebo, Learnframe, Inc. are registered > trademarks of Learnframe, > Inc. Powered by Learnframe.</legal>" + > "</report>"; > > Xsl name to be used was programmatically generated. From my > reading of cocoon2, > the name of the XSL file to be used in transformation should > be declared ahead > in sitemap.xmap; how would I pass in the name of the xsl file > in a request > object and letting the org.apache.cocoon.transformation to > use the xsl file > passed in the request object instead of what's set in the src > attribute. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]