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

how to decode Base64 in XSLT?

Subject: how to decode Base64 in XSLT?
From: Ivan Shmakov <oneingray@xxxxxxxxx>
Date: Thu, 15 Apr 2010 03:06:34 +0700
 how to decode Base64 in XSLT?
	I'm developing an XML representation for the .torrent files.  It
	was quite trivial to convert the XML bit like, e. g.:

<?xml version="1.0" ?> <!-- -*- XML -*- -->
<torrent
   xmlns="http://www.siamics.net/~ivan/xmlns/xmltorrent">

  <announce>http://TRACKER:PORT/announce</announce>
  <comment>COMMENT</comment>
  <created-by>CREATED-BY</created-by>
  <info>
    <length>31454056</length>
    <name>nomad3.ncep.noaa.gov/pub/gfs1p0/gfs20100320/gfs.t12z.pgrbf96</name>
    <piece-length>262144</piece-length>
  </info>
</torrent>

	to the b.torrent formatb.  However, one of the most important
	parts of the .torrent file is the bpiecesb field, containing the
	SHA1 digests of the chunks represented as a single long binary
	string.  To my mind, it's reasonable to have such a field
	encoded in Base64, like:

<torrent ...>
  ...
  <info>
    ...
    <pieces>
      <digest>TCvyo4Na18vWlW19+pirwGKKMoU=</digest>
      <digest>hnWGTGoiouUIZWjX861YIxyMYaM=</digest>
      ...
    </pieces>
  </info>
</torrent>

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

--
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.