RE: [xsl] Converting base64 back to image

Subject: RE: [xsl] Converting base64 back to image
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 22 Oct 2007 17:51:23 +0100
> At the moment I use the following and it works fine. But is 
> it the way to do it in 2007? Is it possible to use 
> xsl:result-document instead of java.io.FileOutputStream?

No, there's no way to write binary output using xsl:result-document.

Michael Kay
http://www.saxonica.com/

> 
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema";
> xmlns:saxon="http://saxon.sf.net/";
> xmlns:fos="java.io.FileOutputStream">
> <xsl:template match="/">
>    <xsl:variable name="img" select="concat('c:\test\jesper', 
> '.jpg')"/>
>    <xsl:variable name="fos" select="fos:new(string($img))"/>
>    <xsl:value-of select="fos:write($fos, 
> saxon:base64Binary-to-octet(xs:base64Binary(my-base64-encoded-
> image)))"/>
>    <xsl:value-of select="fos:close($fos)"/> </xsl:template> 
> </xsl:stylesheet>
> 
> Cheers,
> Jesper Tverskov
> 
> www.xmlkurser.dk
> www.xmlplease.com

Current Thread