使用CDATA存储原始二进制流? [英] Use CDATA to store raw binary streams?

查看:165
本文介绍了使用CDATA存储原始二进制流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了用节省二进制为Base64 的开销,我在想,如果你可以直接双字节二进制流存储到XML文件中,使用CDATA,或评论它,还是怎么了?

Instead of the overhead with saving binary as Base64, I was wondering if you could directly store double-byte binary streams into XML files, using CDATA, or commenting it out, or something?

推荐答案

您可以将其存储为CDATA,但有一些字节序列将评估该关闭CDATA部分有效的XML的风险。 //www.w3:快速浏览一下 HTTP后.ORG / TR / 2006 / REC-XML的20060816 /#秒CDATA教派,似乎你可以有字符的任意序列除了]]>。看看什么是有效的XML字符了。

You can store it as CDATA, but there's the risk that some byte sequences will evaluate to valid XML that closes the CDATA section. After a quick look at http://www.w3.org/TR/2006/REC-xml-20060816/#sec-cdata-sect, it seems you can have any sequence of chars except "]]>". Have a look at what is a valid XML char too.

这篇关于使用CDATA存储原始二进制流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆