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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + sort by variable (11)
-> + [XSLT Recursive Template Help]... (2)
-> + Adding values with document() ... (7)
-> + merging xml files in to single... (2)
-> + Limit description characters i... (2)
-> + problem parsing xml as text in... (2)
-> + Summarize/Distinct (5)
-> + unix epoch seconds to date str... (3)
-> + xml, xslt question (5)
-> + LGCL XSLT transformation (3)
-> + Dynamic include (3)
-> + .rdbxml as XML within Stylus ... (3)
-> + Array of Values From XSL (2)
-> + Problem Saving output (2)
-> - Base 64 encoded data embedded ... (2)
-> ->Base 64 encoded data embe...
-> + XML-XML Mapping (2)
-> - Parameterized 'Document()' ...... (1)
-> + Newbie prob - Elements with sa... (3)
-> - .net 1.1 incorrectly processin... (1)
-> + xs:key and xs:keyref question (5)
-> + pass xsl-variable to javascrip... (2)
-- Previous [1321-1340] [1341-1360] [1361-1380] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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

   
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.