Can XML hold binary data?

Status
Not open for further replies.

sms_solver

In the zone
Can XML hold binary data?

Can someone tell whether a XML file can hold binary data. I mean to say can XML element hold binary data for eg a content of gif/jpeg file, so that it can be later extracted from another application

Thankx in adv for the answer :)
 

it_waaznt_me

Coming back to life ..
Hmm.. I guess I didnt understood it .. XML are text files .. They cant hold binary data .. but the rows or column of the database can hold that binary data alright .. that means that GIF or JPEG should be saved as it is and a link to it in the XML ..

Btw .. You should read this page ..

*www.topxml.com/xml/learnxml.asp
 

GNUrag

FooBar Guy
Of course it can hold. XML is designed to be a portable storage which can hold any kind of data.

In this case you may want to use Base64 encoding scheme , even UUEncode is good enough. The only thing is that data will take one third of more space to hold. XML can be used to hold complete movies of DVDs... just that the program parsing XML file should be able to scale to that sizes...

Python comes with a rich library for handeling MIME data, which allows one to convery binary into Base64 in just a few lines of code.
 
Status
Not open for further replies.
Top Bottom