You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ross Burton <ro...@itzinteractive.com> on 2001/02/22 00:55:47 UTC

[C2] Updated SVG Serializer

Hi,

I'm currently trying to convince my dialup connection to say connected to
xml.apache.org long enough to commit the changes...

* new Batik
* improved serializer
* slightly modified sitemap

The serializer now can configure the transcoders (Batik's terminology for
a SVG -> Image class).  This sounds easy but Batik is configured through
Hints and Keys - totally typesafe and extendable but a pig to code...

<serializer name="svg2jpg" ...>
  <parameter name="background_color" type="color" value="#00FF00"/>
</serializer>

The "name" attribute of the parameter tag is the name of the key in the
transcoder (current coding conventions in Batik mean this value is always
converted to uppercase and has "KEY_" appended).  The "type" attribute is
the type of object to interpret the value as - currently string, float,
int and color.  This can and will be extended as needed.  The "value"
attribute is the value of this parameter, it is used to construct the
appropriate object.  This Key is retrieved from the transcoder through
reflection and the assigned.

To Do:
1) document the new procedure of customising the transcoders, and the
assumptions they make
2) implement a mapping from MIME types to transcoder classes - this is one
feature which was lost when the Batik team upgraded the transcoder API.
3) more types of parameters
4) anything else?

Regards, and I hope it works! :-)
Ross Burton