That approach looks like it would work, well. Another way I have done this in the past on non-cocoon systems is with extra path information in the URL.
That is, http://yourhost/somescript/theFile.csv Where some somescript is the servlet, JSP, CGI script or whatever. Internet Explorer And Windows loves to have that filename suffix! MIME types aren't enough some of the time. The question is timely for me, because I am about to work on this and will report how I did it. ...Peter =?iso-8859-1?Q?Karl_=D8ie?= writes: > if i get this right, the easiest way would be to put up a new match in the > pipeline; > > <map:match pattern="**.cvs"> > <dostuff/> > <map:serialize type="text"/> > </map:match> > > <map:match pattern="**.html"> > <dostuff/> > <map:serialize type="html"/> > </map:match> > > <map:match pattern="**.xml"> > <dostuff/> > <map:serialize type="xml"/> > </map:match> > > then the cvs file would get the name some-page.cvs ?!? > > mvh karl > > > -----Original Message----- > From: Baer Peter [mailto:[EMAIL PROTECTED]] > Sent: 15. februar 2002 11:31 > To: [EMAIL PROTECTED] > Subject: Re: RE: XML --> CSV file download to client > > > > "text/plain" works, but I still have the file name problem... > > <[EMAIL PROTECTED]> wrote: > >you could just try "test/plain" for csv ... > > > Peter Christoph Alexander Bär wrote: > > Thanks for the quick response. Although the two of us are German, > > obviously, let's stick to English with respect to the other users of > > this mailing list. ;-) > > > > I have this... > > > > <xsl:processing-instruction name="cocoon-format"> > > type="text/x-csv" > > </xsl:processing-instruction> > > > > and get that... > > > > java.lang.Exception: No formatter for type "text/x-csv" > > > > That's why I wonder, if this MIME type is supported, at all, by C1. > > > > Unfortunately we were so far unable to get C2 running the way we need > > it, which probably means that we cannot use the sitemap trick suggested > > in the thread on xml writing to a file. > > > > > > Kubanek, Petr wrote: > > > >>> (1) > >>> When a user clicks on a specific hyperlink, a CSV file should be > >>> created and sent to him. The file should not have the name of the > >>> page called. Instead of .xml the file extension must be .csv. > >>> > >>> For the moment, it is good enough to have the user right-click on > >>> the hyperlink in order to get the file downloaded instead having it > >>> displayed in their browser. But the filename is the name of the page, > >>> which is not what we want... > >>> > >>> I've read the thread "writing xml to file" and others on this list. > >>> Do I really have to change the sitemap, here? Or is there any other > >>> way to change the file name? Is changing the sitemap the only means > >>> to avoid having the content of the file enclosed in XML tags? > >>> > >> > >> You have to change mime type. How browser save file is browser > >> dependinding > >> - are you serving dynamic or static CVS files? > >> > >> > >>> (2) > >>> There's a MIME type for CSV (x-csv). What is the exact syntax to > >>> set this MIME type? > >>> > >>> type=text/x-csv > >>> > >>> results in an error message. Can it be that the type is not supported > >>> by Cocoon? > >>> > >> > >> Most probably type="text/x-csv". Hochkomas sind wichtig! > >> > >> > >>> Environment: > >>> Cocoon 1.8.2 (sorry, despite all the gentle support on > >>> the list we couldn't get C2 running with X, and we don't have the time > >>> for experiments, right now) > >>> Tomcat 3.2.4 > >>> SuSE Linux 7.3. > >>> Xfree86 4.1 > >>> Blackdown J2SDK 1.3.1-02a > >>> > >>> Thanks! > >>> > >>> -- > >>> +-------------------------------+----------------------------- > >>> --------+ > >>> | >>> mailto:[EMAIL PROTECTED] <<< | > >>> +------------------------------------------------------------- > >>> --------+ > >>> > >>> > >>> --------------------------------------------------------------------- > >>> Please check that your question has not already been answered in the > >>> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> > >>> > >>> To unsubscribe, e-mail: <[EMAIL PROTECTED]> > >>> For additional commands, e-mail: <[EMAIL PROTECTED]> > >>> > > > > > > > -- > +-------------------------------+-------------------------------------+ > | Peter C. A. Bär | Siemens Business Services & Co. OHG | > | Fon +49.911.654-2387 | Von-der-Tann-Str. 30-31 | > | Fax +49.911.654-2108 | 90439 Nürnberg | > | | Deutschland | > +-------------------------------+-------------------------------------+ > | >>> mailto:[EMAIL PROTECTED] <<< | > +---------------------------------------------------------------------+ > > > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> > > > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>