We do what you propose, but use our build system (an ant script) to call batik http://xmlgraphics.apache.org/batik/ and rasterize the images when going to html. The way we have it set up, when you insert the svg image in XMetaL, a macro sees it's an svg and pops up a dialog asking if you want it rasterized. If so, it converts it to a png and displays the png (since XMetaL can't display svg !?!). The system also runs an xslt on svgs that come from Visio to workaround a Visio bug that causes arrowheads not to appear in pngs rasterized from Visio svg source. I understand that Inkscape http://www.inkscape.org/ <http://www.inkscape.org/> can also convert svgs to other formats from the command line, but I haven't tried it. David
________________________________ From: Colin Shapiro [mailto:[EMAIL PROTECTED] Sent: Friday, August 17, 2007 10:24 AM To: docbook-apps@lists.oasis-open.org Subject: [docbook-apps] Image manipulation via XSLT extensions Hello, "Unfortunately, there is no single graphics file format that meets all needs." - Bob Bob is right. One of the biggest annoyances I have when writing documents is that, when I want to insert a graphic, I must reference and maintain multiple versions of the image file in order to accommodate the various types of output I am producing: <mediaobject> <imageobject role="fo"> <imagedata format="SVG" fileref="figure.svg"/> </imageobject> <imageobject role="html"> <imagedata format="PNG" fileref="figure.png"/> </imageobject> </mediaobject> Let's say I created a figure in SVG, as in the above example. This SVG is my original image source, and in a perfect world, it would be all I'd need to carry around. But, since we can't trust SVGs with our web browsers, I must convert it to PNG and carry around another version of the file for HTML output. What if I actually could only keep the SVG, and have the stylesheet somehow convert the image to alternate formats as needed? If I run the HTML stylesheet, it sees an SVG, and calls an external program--say, ImageMagick--to convert the file to a PNG. This leads me to my question. I know that with processors like Saxon and Xalan, you can write extensions in Java/JavaScript. It seems to me that one would be able to write an extension to call ImageMagick as needed. However, I have absolutely no experience with XSLT extensions, and don't really know where to start. I do know where to find resources on the subject. However, I thought I would first post here to see if anyone has done anything similar, or thought about anything like this before. - Colin