开发者

How to store audio, images, and binary files as XML?

I'm reading a book on .NET, and it says "XML can be used to store any type of data including documents (the l开发者_如何学JAVAatest version of Microsoft Office stores documents using XML), pictures, music, binary files, and database information."

Huh? How can those types of data be stored as XML?


Office documents are actually ZIP files containing compressed files, mostly in XML. When you have an embedded image, it just stores it in the media subdirectory as a binary file. The XML references it by name, but does not contain a base 64 representation of the contents.


You can convert them to base64 and store it in xml: Storing base64 data in XML?


In most of the time you just use base64 encoding and then just save this.

In some cases you can of course use a native xml format that does not require encoding. Such as SVG for vector graphics etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜