I am using AxKit to provide access to financial statements.  Using
StyleChooser::QueryString, I have made it possible to select whether
to retrieve the statement as HTML, CSV, QIF, OFX, (and hopefully
eventually PDF) by selecting an appropriate stylesheet to transform
the XML statement into the desired output type.

However, I need the content type in the HTTP header to be set
appropriately (application/x-qif, application/x-ofx, etc.)  Where is
the best place to set the content type in AxKit for this purpose?

Note that I am using an XSP taglib to help retrieve the XML statement
and pass it on to the XSL processing chain, so initially I tried using
$r->content_type() in my tag library to set the content type according
to the value of $cgi->param('style').  However, I found that
Language::LibXSLT is overwriting the content type according to the
$stylesheet->media_type (text/xml, text/html, or text/plain) which I
think it gets from the xsl:output "method" attribute in the final
stylesheet.

I saw that there is a 'passthru_type' flag that can be set by the
passthru plugin, but I think the original content type is always XML
for my application, so this wouldn't help.  Should I write my own
plugin to inspect the value of $cgi->param('style'), set the
appropriate content_type, and set the 'passthru_type' flag in
$r->notes()?  That seems like overkill, but it is the only idea I have
at the moment that fits within what I perceive as the "proper AxKit
way of doing things".  (Another idea I have is to create a
'preferred_type' flag, similar to the 'preferred_style' flag in
StyleChooser::QueryString, and patch Language::LibXSLT to use this
flag to set the content type.  Is this a good idea?)

Ken

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to