|
以文本方式查看主题 - 计算机科学论坛 (http://bbs.xml.org.cn/index.asp) -- 『 XML基础 』 (http://bbs.xml.org.cn/list.asp?boardid=1) ---- 请大家讨论XML文档中能不能嵌入二进制数据 (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=41416) |
|
-- 作者:slimzhao -- 发布时间:12/20/2006 9:52:00 AM -- 请大家讨论XML文档中能不能嵌入二进制数据 我已经在网上搜过, 有下面的办法: 1. 用base64 编码, 本质上还是在XML中存放文本数据 2. 在 CDATA中, 我怀疑这是一个广为流传的误区, 因为w3c 的规范中说CDATA 中放的仍是字符数据, 而且不能含有]]> 这个结束符号. 3. 指向外部entity, 这个不讨论 ============================= 2.7 CDATA Sections [Definition: CDATA sections may occur anywhere character data may occur; they are used to escape blocks of text containing characters which would otherwise be recognized as markup. CDATA sections begin with the string "<![CDATA[" and end with the string "]]>":] Within a CDATA section, only the CDEnd string is recognized as markup, so that left angle brackets and ampersands may occur in their literal form; they need not (and cannot) be escaped using "<" and "&". CDATA sections cannot nest. An example of a CDATA section, in which "<greeting>" and "</greeting>" are recognized as character data, not markup: <![CDATA[<greeting>Hello, world!</greeting>]]> 我的目标是设计一种XML格式, 需要携带大量的任意二进制数据, 要求格式紧凑高效, 欢迎指教
|
|
-- 作者:Qr -- 发布时间:12/20/2006 10:23:00 AM -- XML 实质上就是一个文本文件。 http://bbs.w3china.org/dispbbs.asp?boardID=1&ID=6256 |
|
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
6,414.063ms |