Alaska Software Inc. - Extract from XML application/octet-stream
Username: Password:
AuthorTopic: Extract from XML application/octet-stream
Bengt OveliusExtract from XML application/octet-stream
on Tue, 05 Apr 2005 11:01:42 +0200
Is there some functionality in  asinet  xbase  xb2net ??
to transform  this part of a XML file
to a binary file   BXQ.BIN  ???

Best regards
Bengt Ovelius









Part of the XML-file

    <ItemKey>
     <BinName>BXQ.BIN</BinName>
     <MimeType>application/octet-stream</MimeType>
   <Data>SFRNMl9MSUMgRW5jcnlwdGVkIGtleSAyb8KNzLS/psO2xK5orqhkZWiZo6WmhD21uYqltnS4t9Bn
psi3iKeaonmrlKShpaxyfLeIxZLAs7rWs8GiZUE8hIN3rse4yJ/ApmKWnKWfhIabo1qCfbimpLDK
gofHoYhueL6Nd8GyqcGjp3THrfR9b2q3tou2vLJwuYi4tOeYsYAyrcHCxIHFu2LW1NbhuIDQ3kuV
58zE14Llq5fT1mRrs7+Nbbmh3NnR3mXK3p3n1uXZpZ/I1JF+gYZ4ecTAr768cKrPqsfbU7TU5p1y
fsWfyaq4nbS74dja49jT05rctpe45+mTkpxsQTx3enzDr8BqrOVvL721xayIhp+cXYJ9qqC4sMqL
jKurvNPb07qdem60tayxeqZ/v8+uaKuVRWy+w3K4oLadw3SRuGW20+PbtdjJisKv5N3Gy9Pek+Pa
xqbRy+pGPbKlq56gonxZnZiYqWt0ea6/daqqsZqhq5aVMXu6iYZvlsaxwqSHqLx7m3s9ubXGYKfM
w6XHl6d5zpt/e8PQqL2qf7R1rZimqJe4qXh5a3Viaq6iraeEsJNqk7Ktn5iPq51apqypl5OjqH14
oaWIkqKpkVSkpq23obBWnmqwqKlWoJlwb3g=</Data>
   </ItemKey>
Phil Ide
Re: Extract from XML application/octet-stream
on Tue, 05 Apr 2005 17:51:26 +0100
Bengt,

> Is there some functionality in  asinet  xbase  xb2net ??
> to transform  this part of a XML file
> to a binary file   BXQ.BIN  ???

You can do this with Xb2.NET.  The secret is in the fact that the <data>
tag is base64 encoded.

  aXml := xbXML2Array( cXMLDocument )
  cData := xbXMLGetNode( aXml, "Data" )
  cData := xbBase64Decode( cData )

   you might want to fetch the filename from the
   xml file as well
  nH := FCreate( 'BQX.BIN' )
  if nH <> 0
     FWrite(nH,cData)
     FClose(nH)
  endif

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

We've been through so much together and most of it was your fault!
Bengt OveliusRe: Extract from XML application/octet-stream
on Tue, 05 Apr 2005 19:12:39 +0200
Thanks Phil,


> We've been through so much together and most of it was your fault!
I guess you are right !