Luigi Bai wrote:
Hi,
I've got a XML database with images of various sorts of mime-types (jpeg, gif, png, etc) stored in text() nodes as Base64. I have a trivial Base64Serializer that reconstitutes them on the way out. However, I think I'm stuck with a mime-type problem. It seems I have to have a separately instantiated Serializer for each possible mime-type:
correct
<map:select type="mimeSelector"> <map:when test="image/png"> <map:serialize type="base64" mime-type="image/png" /> </map:when> ...etc...
I find this verbose, and annoying to maintain if someone saves an image with a new mime-type.
i agree, others might not.
correct. getMimeType() is called during setup() which is called during pipeline setup before any data is processed.
The Serializer interface has a getMimeType() method which allows a Serializer to declare its mime-type, but only at setup() time (correct me if I'm wrong?). I need to declare the mime-type later; the first
IIRC it works this ways so that cocoon can start streaming SAX events to the client as they roll in, and doesn't have to wait until the serializer is fully finished processing.
Regards Jorg
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
