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

Re: how to decode Base64 in XSLT?

Subject: Re: how to decode Base64 in XSLT?
From: Ivan Shmakov <oneingray@xxxxxxxxx>
Date: Thu, 15 Apr 2010 09:56:14 +0700
Re:  how to decode Base64 in XSLT?
>>>>> "MK" == Michael Kay <mike@xxxxxxxxxxxx> writes:

 IS> Now, how do I convert these Base64 strings into the respective
 IS> binary strings?

 MK> It rather depends on what you want the output to be. There's no
 MK> such thing as a "binary string" recognized by the XDM type
 MK> system.

	It looks like I'd need a work-around then.

 MK> Perhaps you want a string in which the one and zero bits are
 MK> represented by Unicode characters "0" and "1"? Or in which the
 MK> octets are represented as a space-separated sequence of decimal
 MK> integers (0-255)?

	There, I need a string composed of the characters which, being
	represented in a chosen unibyte encoding, will correspond to the
	sequence of codes that the Base64 string itself encodes.

	As the XSLT program will have:

  <xsl:output method="text" encoding="UNIBYTE-ENCODING" />

	I guess that the character string thus obtained will be
	translated to the intended byte string in the output.

	(Hopefully the implementation won't do any conversions, such as
	CR/LF to LF or vice versa.)

 MK> Whatever the output you want, there isn't very much in the standard
 MK> function library to help you. Saxon has
 MK> saxon:base64Binary-to-octets

 > http://www.saxonica.com/documentation/extensions/functions/base64binarytooctets.html

 MK> which may or may not help you.

	It won't, but saxon:base64Binary-to-string () probably will.
	Thanks!

[...]

-- 
FSF associate member #7257

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.