XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
momlee postSubject: Base 64 encoded data embedded in XML in PHP
Author: momlee post
Date: 27 Sep 2006 10:15 AM
Background: I have an XML string Base 64 encoded
How to convert the XML extract the data to convert from base 64 to binary to get the actual .png file.
We have use linux server with php code ?
Thanks
Leela

Posttop
Tony LavinioSubject: Base 64 encoded data embedded in XML in PHP
Author: Tony Lavinio
Date: 27 Sep 2006 12:54 PM
You can use the base-64 adapter in Stylus Studio.
If you write base-64 through it, the output will be binary.

If you had a file that looked like this:
<list>
<item name="image.gif">.....base64data.....</item>
</list>
and you ran the following program on it, you would get
one binary file for each <item> element.

<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="list/file"/>
</xsl:template>
<xsl:template match="file">
<xsl:text>Writing </xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>&#10;</xsl:text>
<xsl:result-document href="{concat('adapter:Base-64?',@name)}">
<xsl:copy-of select="."/>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>

The deployment adapters http://www.stylusstudio.com/deployment/
can be deployed to Linux

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.