You might try...

<map:pipeline>
      <map:match type="wildcard" pattern="[some pattern]">
            <map:act type="request">
                  <map:parameter name="parameters"  value="true" />
                  <map:generate type="file" src="foo">
                  <map:transform src="{reportName}.xsl" >
                  <map:serialize type="html" />
            </map:act>
      </map:match>
</map:pipeline>

Assuming you have a parameter in the request object named "reportName" whose
value is "bar",  this pipeline will apply the stylesheet "bar.xsl" to the xml
found in the file specified by the "foo" URI.   The "request" action with
"parameters" set to true makes all request parameters available to sitemap.  See
comments in org.apache.cocoon.acting.RequestParamAction.java.

There are other ways to do this sort of thing.  Cocoon 2 offers *much* more
flexibility and power than simple Cocoon1 example you cite.  You can even apply
a stylesheet built dynamically using another pipeline.  Search through user list
or developer list for posts about cocoon: pseudoprotocol, request generator,
dynamic stylesheets, actions, etc.  And study sitemaps found in  /cocoon and
/cocoon/samples.

BTW, definitely NOT a bug.

Hope this helps,
--Michael



                                                                                       
                        
                      [EMAIL PROTECTED]                                                
                        
                      rg                       To:       [EMAIL PROTECTED]     
                        
                                               cc:                                     
                        
                      05/13/02 03:18 PM        Subject:  DO NOT REPLY [Bug 9048] New:  
-     Can we pass the   
                      Please respond to         name of the xsl to used for 
transformation as a parameter      
                      cocoon-dev                                                       
                        
                                                                                       
                        
                                                                                       
                        




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]

Reply via email to