[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Converting base64 back to image

Subject: Converting base64 back to image
From: "Jesper Tverskov" <jesper@xxxxxxxxxxx>
Date: Mon, 22 Oct 2007 12:50:55 +0200
 Converting base64 back to image
Hi list

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?

<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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.