xsl-list
[Top] [All Lists]

RE: [xsl] Converting base64 back to image

2007-10-22 09:51:58
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>