首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

application/xml and text/xml的差异

2012-10-08 
application/xml and text/xml的区别application/xml and text/xml的区别?经常看到有关xml时提到applicat

application/xml and text/xml的区别

application/xml and text/xml的区别?经常看到有关xml时提到"application/xml" 和 "text/xml"两种类型, 二者功能一模一样,唯一的区别就是编码格式,text/xml忽略xml头所指定编码格式而默认采用us-ascii编码,而application/xml会根据xml头指定的编码格式来编码:?application/xml and text/xml的差异application/xml and text/xml的差异
    Content-type: application/xml; charset="utf-16" {BOM}<?xml version="1.0"?>?

    XML and MIME processors会按照utf-16编码处理该文件

    ?

    例子2:

    ?webservice传输的文件

    ?application/xml and text/xml的差异application/xml and text/xml的差异
      Content-type: application/xml <?xml version='1.0'?>

      XML processors会按照utf-8编码处理该文件

      ?

      例子3:

      ?webservice传输的文件

      ?application/xml and text/xml的差异application/xml and text/xml的差异
        Content-type: application/xml <?xml version='1.0' encoding="ISO-10646-UCS-4"?>

        ?XML processors会按照UCS-4编码处理该文件
        ?

        例子4:

        ?webservice传输的文件

        ?application/xml and text/xml的差异application/xml and text/xml的差异
          Content-type: text/xml {BOM}<?xml version="1.0" encoding="utf-16"?>

          ?XML processors会按照us-ascii,而不是utf-16编码处理该文件

          ?

          参考文档:

          http://www.ietf.org/rfc/rfc2376.txt

          ?

热点排行