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
__________________
[ॐ एसएमएस॰सोल्भर ॐ]
Advertisements. Register and be a member of the community to get rid of them.
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 ..
__________________
Sleight of hand and twist of fate...
On a bed of nails she makes me wait...
And I wait without you ...
With or without you ..
----
Batty = Too Busy Now !!!
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.