Internet Engineering Task Force (IETF)                       H. Thompson
Request for Comments: 7303                       University of Edinburgh
Obsoletes: 3023                                                C. Lilley
Updates: 6839                                                        W3C
Category: Standards Track                                      July 2014
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                       H. Thompson
Request for Comments: 7303                       University of Edinburgh
Obsoletes: 3023                                                C. Lilley
Updates: 6839                                                        W3C
Category: Standards Track                                      July 2014
ISSN: 2070-1721
        

XML Media Types

XML媒体类型

Abstract

摘要

This specification standardizes three media types -- application/xml, application/xml-external-parsed-entity, and application/xml-dtd -- for use in exchanging network entities that are related to the Extensible Markup Language (XML) while defining text/xml and text/ xml-external-parsed-entity as aliases for the respective application/ types. This specification also standardizes the '+xml' suffix for naming media types outside of these five types when those media types represent XML MIME entities.

本规范标准化了三种媒体类型——应用程序/xml、应用程序/xml外部解析实体和应用程序/xml dtd——用于交换与可扩展标记语言(xml)相关的网络实体,同时将文本/xml和文本/xml外部解析实体定义为各自应用程序/类型的别名。当这些媒体类型表示xml MIME实体时,本规范还标准化了用于命名这五种类型之外的媒体类型的“+xml”后缀。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7303.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc7303.

Copyright Notice

版权公告

Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2014 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

本文件可能包含2008年11月10日之前发布或公开的IETF文件或IETF贡献中的材料。控制某些材料版权的人员可能未授予IETF信托允许在IETF标准流程之外修改此类材料的权利。在未从控制此类材料版权的人员处获得充分许可的情况下,不得在IETF标准流程之外修改本文件,也不得在IETF标准流程之外创建其衍生作品,除了将其格式化以RFC形式发布或将其翻译成英语以外的其他语言。

Table of Contents

目录

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   4
   2.  Notational Conventions  . . . . . . . . . . . . . . . . . . .   4
     2.1.  Requirements Language . . . . . . . . . . . . . . . . . .   4
     2.2.  Characters, Encodings, Charsets . . . . . . . . . . . . .   4
     2.3.  MIME Entities, XML Entities . . . . . . . . . . . . . . .   5
   3.  Encoding Considerations . . . . . . . . . . . . . . . . . . .   6
     3.1.  XML MIME Producers  . . . . . . . . . . . . . . . . . . .   6
     3.2.  XML MIME Consumers  . . . . . . . . . . . . . . . . . . .   7
     3.3.  The BOM and Encoding Conversions  . . . . . . . . . . . .   8
   4.  XML Media Types . . . . . . . . . . . . . . . . . . . . . . .   9
     4.1.  XML MIME Entities . . . . . . . . . . . . . . . . . . . .   9
     4.2.  Using '+xml' when Registering XML-Based Media Types . . .  11
     4.3.  Registration Guidelines for XML-Based Media Types Not
           Using   '+xml'  . . . . . . . . . . . . . . . . . . . . .  12
   5.  Fragment Identifiers  . . . . . . . . . . . . . . . . . . . .  13
   6.  The Base URI  . . . . . . . . . . . . . . . . . . . . . . . .  14
   7.  XML Versions  . . . . . . . . . . . . . . . . . . . . . . . .  14
   8.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . . .  14
     8.1.  UTF-8 Charset . . . . . . . . . . . . . . . . . . . . . .  15
        
   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   4
   2.  Notational Conventions  . . . . . . . . . . . . . . . . . . .   4
     2.1.  Requirements Language . . . . . . . . . . . . . . . . . .   4
     2.2.  Characters, Encodings, Charsets . . . . . . . . . . . . .   4
     2.3.  MIME Entities, XML Entities . . . . . . . . . . . . . . .   5
   3.  Encoding Considerations . . . . . . . . . . . . . . . . . . .   6
     3.1.  XML MIME Producers  . . . . . . . . . . . . . . . . . . .   6
     3.2.  XML MIME Consumers  . . . . . . . . . . . . . . . . . . .   7
     3.3.  The BOM and Encoding Conversions  . . . . . . . . . . . .   8
   4.  XML Media Types . . . . . . . . . . . . . . . . . . . . . . .   9
     4.1.  XML MIME Entities . . . . . . . . . . . . . . . . . . . .   9
     4.2.  Using '+xml' when Registering XML-Based Media Types . . .  11
     4.3.  Registration Guidelines for XML-Based Media Types Not
           Using   '+xml'  . . . . . . . . . . . . . . . . . . . . .  12
   5.  Fragment Identifiers  . . . . . . . . . . . . . . . . . . . .  13
   6.  The Base URI  . . . . . . . . . . . . . . . . . . . . . . . .  14
   7.  XML Versions  . . . . . . . . . . . . . . . . . . . . . . . .  14
   8.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . . .  14
     8.1.  UTF-8 Charset . . . . . . . . . . . . . . . . . . . . . .  15
        
     8.2.  UTF-16 Charset  . . . . . . . . . . . . . . . . . . . . .  16
     8.3.  Omitted Charset and 8-Bit MIME Entity . . . . . . . . . .  16
     8.4.  Omitted Charset and 16-Bit MIME Entity  . . . . . . . . .  16
     8.5.  Omitted Charset, No Internal Encoding Declaration . . . .  17
     8.6.  UTF-16BE Charset  . . . . . . . . . . . . . . . . . . . .  17
     8.7.  Non-UTF Charset . . . . . . . . . . . . . . . . . . . . .  18
     8.8.  INCONSISTENT EXAMPLE: Conflicting Charset and Internal
           Encoding Declaration  . . . . . . . . . . . . . . . . . .  18
     8.9.  INCONSISTENT EXAMPLE: Conflicting Charset and BOM . . . .  18
   9.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  19
     9.1.  application/xml Registration  . . . . . . . . . . . . . .  19
     9.2.  text/xml Registration . . . . . . . . . . . . . . . . . .  21
     9.3.  application/xml-external-parsed-entity Registration . . .  21
     9.4.  text/xml-external-parsed-entity Registration  . . . . . .  22
     9.5.  application/xml-dtd Registration  . . . . . . . . . . . .  22
     9.6.  The '+xml' Naming Convention for XML-Based Media Types  .  23
       9.6.1.  The '+xml' Structured Syntax Suffix Registration  . .  23
   10. Security Considerations . . . . . . . . . . . . . . . . . . .  25
   11. References  . . . . . . . . . . . . . . . . . . . . . . . . .  27
     11.1.  Normative References . . . . . . . . . . . . . . . . . .  27
     11.2.  Informative References . . . . . . . . . . . . . . . . .  29
   Appendix A.  Why Use the '+xml' Suffix for XML-Based MIME Types?   32
   Appendix B.  Core XML Specifications  . . . . . . . . . . . . . .  32
   Appendix C.  Operational Considerations . . . . . . . . . . . . .  32
     C.1.  General Considerations  . . . . . . . . . . . . . . . . .  33
     C.2.  Considerations for Producers  . . . . . . . . . . . . . .  33
     C.3.  Considerations for Consumers  . . . . . . . . . . . . . .  34
   Appendix D.  Changes from RFC 3023  . . . . . . . . . . . . . . .  34
   Appendix E.  Acknowledgements . . . . . . . . . . . . . . . . . .  35
        
     8.2.  UTF-16 Charset  . . . . . . . . . . . . . . . . . . . . .  16
     8.3.  Omitted Charset and 8-Bit MIME Entity . . . . . . . . . .  16
     8.4.  Omitted Charset and 16-Bit MIME Entity  . . . . . . . . .  16
     8.5.  Omitted Charset, No Internal Encoding Declaration . . . .  17
     8.6.  UTF-16BE Charset  . . . . . . . . . . . . . . . . . . . .  17
     8.7.  Non-UTF Charset . . . . . . . . . . . . . . . . . . . . .  18
     8.8.  INCONSISTENT EXAMPLE: Conflicting Charset and Internal
           Encoding Declaration  . . . . . . . . . . . . . . . . . .  18
     8.9.  INCONSISTENT EXAMPLE: Conflicting Charset and BOM . . . .  18
   9.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  19
     9.1.  application/xml Registration  . . . . . . . . . . . . . .  19
     9.2.  text/xml Registration . . . . . . . . . . . . . . . . . .  21
     9.3.  application/xml-external-parsed-entity Registration . . .  21
     9.4.  text/xml-external-parsed-entity Registration  . . . . . .  22
     9.5.  application/xml-dtd Registration  . . . . . . . . . . . .  22
     9.6.  The '+xml' Naming Convention for XML-Based Media Types  .  23
       9.6.1.  The '+xml' Structured Syntax Suffix Registration  . .  23
   10. Security Considerations . . . . . . . . . . . . . . . . . . .  25
   11. References  . . . . . . . . . . . . . . . . . . . . . . . . .  27
     11.1.  Normative References . . . . . . . . . . . . . . . . . .  27
     11.2.  Informative References . . . . . . . . . . . . . . . . .  29
   Appendix A.  Why Use the '+xml' Suffix for XML-Based MIME Types?   32
   Appendix B.  Core XML Specifications  . . . . . . . . . . . . . .  32
   Appendix C.  Operational Considerations . . . . . . . . . . . . .  32
     C.1.  General Considerations  . . . . . . . . . . . . . . . . .  33
     C.2.  Considerations for Producers  . . . . . . . . . . . . . .  33
     C.3.  Considerations for Consumers  . . . . . . . . . . . . . .  34
   Appendix D.  Changes from RFC 3023  . . . . . . . . . . . . . . .  34
   Appendix E.  Acknowledgements . . . . . . . . . . . . . . . . . .  35
        
1. Introduction
1. 介绍

The World Wide Web Consortium has issued the Extensible Markup Language (XML) 1.0 [XML] and Extensible Markup Language (XML) 1.1 [XML1.1] specifications. To enable the exchange of XML network entities, this specification standardizes three media types (application/xml, application/xml-external-parsed-entity, and application/xml-dtd), two aliases (text/xml and text/xml-external-parsed-entity), and a naming convention for identifying XML-based MIME media types (using '+xml').

万维网联盟发布了可扩展标记语言(XML)1.0[XML]和可扩展标记语言(XML)1.1[XML1.1]规范。为了实现XML网络实体的交换,本规范标准化了三种媒体类型(应用程序/XML、应用程序/XML外部解析实体和应用程序/XML dtd)、两个别名(文本/XML和文本/XML外部解析实体)以及用于标识基于XML的MIME媒体类型的命名约定(使用“+XML”)。

XML has been used as a foundation for other media types, including types in every branch of the IETF media types tree. To facilitate the processing of such types, and in line with the recognition in [RFC6838] of structured syntax name suffixes, a suffix of '+xml' is registered in Section 9.6. This will allow generic XML-based tools -- browsers, editors, search engines, and other processors -- to work with all XML-based media types.

XML已被用作其他媒体类型的基础,包括IETF媒体类型树的每个分支中的类型。为了便于处理此类类型,并符合[RFC6838]中对结构化语法名称后缀的识别,第9.6节中注册了后缀“+xml”。这将允许基于XML的通用工具——浏览器、编辑器、搜索引擎和其他处理器——处理所有基于XML的媒体类型。

This specification replaces [RFC3023]. Major differences are in the areas of alignment of text/xml and text/xml-external-parsed-entity with application/xml and application/xml-external-parsed-entity respectively, the addition of XPointer and XML Base as fragment identifiers and base URIs, respectively, integration of the XPointer Registry and updating of many references.

本规范取代[RFC3023]。主要区别在于分别将text/xml和text/xml外部解析实体与application/xml和application/xml外部解析实体对齐,分别添加XPointer和xml Base作为片段标识符和基本uri,集成XPointer注册表和更新许多引用。

2. Notational Conventions
2. 符号约定
2.1. Requirements Language
2.1. 需求语言

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this specification are to be interpreted as described in [RFC2119].

本规范中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”应按照[RFC2119]中的说明进行解释。

2.2. Characters, Encodings, Charsets
2.2. 字符、编码、字符集

Both XML (in an XML or Text declaration using the encoding pseudo-attribute) and MIME (in a Content-Type header field using the charset parameter) use a common set of labels [IANA-CHARSETS] to identify the MIME charset (mapping from byte stream to character sequence [RFC2978]).

XML(在使用编码伪属性的XML或文本声明中)和MIME(在使用charset参数的内容类型头字段中)都使用一组通用标签[IANA-charset]来标识MIME字符集(从字节流映射到字符序列[RFC2978])。

In this specification, we will use the phrases "charset parameter" and "encoding declaration" to refer to whatever MIME charset is specified by a MIME charset parameter or XML encoding declaration,

在本规范中,我们将使用短语“charset参数”和“编码声明”来表示MIME charset参数或XML编码声明指定的任何MIME字符集,

respectively. We reserve the phrase "character encoding" (or, when the context makes the intention clear, simply "encoding") for the MIME charset actually used in a particular XML MIME entity.

分别地对于在特定XMLMIME实体中实际使用的MIME字符集,我们保留短语“字符编码”(或者,当上下文明确表示意图时,简单地说是“编码”)。

[UNICODE] defines three "encoding forms", namely UTF-8, UTF-16, and UTF-32. As UTF-8 can only be serialized in one way, the only possible label for UTF-8-encoded documents when serialised into MIME entities is "utf-8". UTF-16 XML documents, however, can be serialised into MIME entities in one of two ways: either big-endian, labelled (optionally) "utf-16" or "utf-16be", or little-endian, labelled (optionally) "utf-16" or "utf-16le". See Section 3.3 below for how a Byte Order Mark (BOM) is required when the "utf-16" serialization is used.

[UNICODE]定义了三种“编码形式”,即UTF-8、UTF-16和UTF-32。由于UTF-8只能以一种方式序列化,因此,当UTF-8编码文档序列化为MIME实体时,唯一可能的标签是“UTF-8”。但是,UTF-16 XML文档可以通过以下两种方式之一序列化为MIME实体:大端(可选)标记为“UTF-16”或“UTF-16be”,或小端(可选)标记为“UTF-16”或“UTF-16le”。有关使用“utf-16”序列化时如何要求字节顺序标记(BOM),请参见下面的第3.3节。

UTF-32 has four potential serializations, of which only two (UTF-32BE and UTF-32LE) are given names in [UNICODE]. Support for the various serializations varies widely, and security concerns about their use have been raised (for example, see [Sivonen]). The use of UTF-32 is NOT RECOMMENDED for XML MIME entities.

UTF-32有四种可能的序列化,其中只有两种(UTF-32BE和UTF-32LE)以[UNICODE]命名。对各种序列化的支持差异很大,人们对它们的使用提出了安全问题(例如,请参见[Sivonen])。不建议对XML MIME实体使用UTF-32。

2.3. MIME Entities, XML Entities
2.3. MIME实体、XML实体

As sometimes happens between two communities, both MIME and XML have defined the term entity, with different meanings. Section 2.4 of [RFC2045] says:

正如两个社区之间有时发生的情况一样,MIME和XML都定义了术语实体,含义不同。[RFC2045]第2.4节规定:

The term "entity", refers specifically to the MIME-defined header fields and contents of either a message or one of the parts in the body of a multipart entity.

术语“实体”具体指MIME定义的消息头字段和内容或多部分实体主体中的一个部分。

Section 4 of [XML] says:

[XML]的第4节说:

An XML document may consist of one or many storage units. These are called entities; they all have content and are all (except for the document entity and the external DTD subset) identified by entity name.

XML文档可以由一个或多个存储单元组成。这些被称为实体;它们都有内容,并且都是由实体名称标识的(文档实体和外部DTD子集除外)。

In this specification, "XML MIME entity" is defined as the latter (an XML entity) encapsulated in the former (a MIME entity).

在本规范中,“XML MIME实体”定义为封装在前者(MIME实体)中的后者(XML实体)。

Furthermore, XML provides for the naming and referencing of entities for purposes of inclusion and/or substitution. In this specification, "XML-entity declaration/reference/..." is used to avoid confusion when referring to such cases.

此外,XML还提供了实体的命名和引用,用于包含和/或替换。在本规范中,“XML实体声明/引用/…”用于在引用此类情况时避免混淆。

3. Encoding Considerations
3. 编码注意事项

The registrations below all address issues around character encoding in the same way, by referencing this section.

下面的注册通过参考本节,以相同的方式解决了有关字符编码的所有问题。

As many as three distinct sources of information about character encoding may be present for an XML MIME entity: a charset parameter, a BOM (see Section 3.3 below), and an XML encoding declaration (see Section 4.3.3 of [XML]). Ensuring consistency among these sources requires coordination between entity authors and MIME agents (that is, processes that package, transfer, deliver, and/or receive MIME entities).

XML MIME实体可能有多达三种不同的字符编码信息源:字符集参数、BOM(见下文第3.3节)和XML编码声明(见[XML]第4.3.3节)。确保这些源之间的一致性需要实体作者和MIME代理(即打包、传输、交付和/或接收MIME实体的流程)之间的协调。

The use of UTF-8, without a BOM, is RECOMMENDED for all XML MIME entities.

建议对所有XML MIME实体使用不带BOM的UTF-8。

Some MIME agents will be what we will call "XML-aware", that is, capable of processing XML MIME entities as XML and detecting the XML encoding declaration (or its absence). All three sources of information about encoding are available to them, and they can be expected to be aware of this specification.

一些MIME代理将是我们称之为“XML感知”的代理,即能够将XML MIME实体作为XML处理,并检测XML编码声明(或其缺失)。关于编码的所有三个信息源对他们都是可用的,并且可以期望他们知道这个规范。

Other MIME agents will not be XML-aware; thus, they cannot know anything about the XML encoding declaration. Not only do they lack one of the three sources of information about encoding, they are also less likely to be aware of or responsive to this specification.

其他MIME代理将不支持XML;因此,他们对XML编码声明一无所知。他们不仅缺少关于编码的三个信息源中的一个,而且不太可能知道或响应此规范。

Some MIME agents, such as proxies and transcoders, both consume and produce MIME entities.

一些MIME代理,如代理和转码器,都使用和生成MIME实体。

This mixture of two kinds of agents handling XML MIME entities increases the complexity of the coordination task. The recommendations given below are intended to maximise interoperability in the face of this: on the one hand, by mandating consistent production and encouraging maximally robust forms of production and, on the other, by specifying recovery strategies to maximize the interoperability of consumers when the production rules are broken.

处理XML MIME实体的两种代理的混合增加了协调任务的复杂性。下面给出的建议旨在最大限度地提高互操作性:一方面,通过强制执行一致的生产并鼓励最大限度地强健的生产形式,另一方面,通过指定恢复策略,在生产规则被破坏时最大限度地提高消费者的互操作性。

3.1. XML MIME Producers
3.1. XML MIME生产者

XML-aware MIME producers SHOULD supply a charset parameter and/or an appropriate BOM with non-UTF-8-encoded XML MIME entities that lack an encoding declaration. Such producers SHOULD remove or correct an encoding declaration that is known to be incorrect (for example, as a result of transcoding).

支持XML的MIME生产者应该提供一个字符集参数和/或一个适当的BOM表,该BOM表包含未经编码声明的非UTF-8编码的XML MIME实体。此类生产者应删除或更正已知不正确的编码声明(例如,由于转码)。

XML-aware MIME producers MUST supply an XML text declaration at the beginning of non-UNICODE XML external parsed entities that would otherwise begin with the hexadecimal octet sequences 0xFE 0xFF, 0xFF 0xFE or 0xEF 0xBB 0xBF, in order to avoid the mistaken detection of a BOM.

支持XML的MIME生产者必须在非UNICODE XML外部解析实体的开头提供XML文本声明,否则这些实体将以十六进制八位字节序列0xFE 0xFF、0xFF 0xFE或0xEF 0xBB 0xBF开头,以避免错误检测BOM。

XML-unaware MIME producers MUST NOT supply a charset parameter with an XML MIME entity unless the entity's character encoding is reliably known. Note that this is particularly relevant for central configuration of web servers, where configuring a default for the charset parameter will almost certainly violate this requirement.

XML MIME生产者不得为XML MIME实体提供字符集参数,除非该实体的字符编码是可靠的。请注意,这与web服务器的中心配置特别相关,其中为charset参数配置默认值几乎肯定会违反此要求。

XML MIME producers are RECOMMENDED to provide means for users to control what value, if any, is given to charset parameters for XML MIME entities, for example, by giving users control of the configuration of Web server filename-to-Content-Type-header mappings on a file-by-file or suffix basis.

建议XML MIME生产者为用户提供控制XML MIME实体的字符集参数的值(如果有的话)的方法,例如,通过让用户在逐个文件或后缀的基础上控制Web服务器文件名到内容类型头映射的配置。

3.2. XML MIME Consumers
3.2. XML MIME使用者

For XML MIME consumers, the question of priority arises in cases when the available character encoding information is not consistent. Again, we must distinguish between XML-aware and XML-unaware agents.

对于XML MIME使用者,当可用字符编码信息不一致时,会出现优先级问题。同样,我们必须区分支持XML和不支持XML的代理。

When a charset parameter is specified for an XML MIME entity, the normative component of the [XML] specification leaves the question open as to how to determine the encoding with which to attempt to process the entity. This is true independently of whether or not the entity contains in-band encoding information, that is, either a BOM (Section 3.3) or an XML encoding declaration, both, or neither. In particular, in the case where there is in-band information and it conflicts with the charset parameter, the [XML] specification does not specify which is authoritative. In its (non-normative) Appendix F, it defers to this specification:

当为XML MIME实体指定字符集参数时,[XML]规范的规范性组件会留下一个问题,即如何确定试图处理该实体的编码。无论实体是否包含带内编码信息(即BOM(第3.3节)或XML编码声明,无论两者是否都包含,这都是正确的。特别是,在存在带内信息并且与charset参数冲突的情况下,[XML]规范没有指定哪个是权威的。在其(非规范性)附录F中,其遵循本规范:

[T]he preferred method of handling conflict should be specified as part of the higher-level protocol used to deliver XML. In particular, please refer to [IETF RFC 3023] or its successor...

[T] 他认为处理冲突的首选方法应该被指定为用于传递XML的高级协议的一部分。具体请参考[IETF RFC 3023]或其后续版本。。。

Accordingly, to conform with deployed processors and content and to avoid conflicting with this or other normative specifications, this specification sets the priority as follows:

因此,为了符合已部署的处理器和内容,并避免与本规范或其他规范性规范冲突,本规范将优先级设置如下:

A BOM (Section 3.3) is authoritative if it is present in an XML MIME entity;

如果BOM(第3.3节)存在于XML MIME实体中,则其具有权威性;

In the absence of a BOM (Section 3.3), the charset parameter is authoritative if it is present.

在没有BOM(第3.3节)的情况下,如果存在字符集参数,则该参数具有权威性。

Whenever the above determines a source of encoding information as authoritative, consumers SHOULD process XML MIME entities based on that information.

每当上面确定编码信息的来源是权威的时,使用者应该基于该信息处理XML MIME实体。

When MIME producers conform to the requirements stated above (Section 3.1, Section 3) inconsistencies will not arise -- the above statement of priorities only has practical impact in the case of non-conforming XML MIME entities. In the face of inconsistencies, no uniform strategy can deliver the 'right' answer every time: the purpose of specifying one here is to encourage convergence over time, first on the part of consumers, then on the part of producers.

当MIME制作者符合上述要求(第3.1节,第3节)时,不会出现不一致——上述优先级声明仅在不符合XML MIME实体的情况下具有实际影响。面对不一致性,没有统一的策略可以每次都给出“正确”的答案:在这里指定一个策略的目的是鼓励随着时间的推移而趋同,首先是消费者,然后是生产者。

For XML-aware consumers, note that Section 4.3.3 of [XML] does _not_ make it an error for the charset parameter and the XML encoding declaration (or the UTF-8 default in the absence of encoding declaration and BOM) to be inconsistent, although such consumers might choose to issue a warning in this case.

对于支持XML的使用者,请注意,[XML]的第4.3.3节没有将字符集参数和XML编码声明(或在没有编码声明和BOM的情况下为UTF-8默认值)不一致视为错误,尽管在这种情况下,这些使用者可能会选择发出警告。

If an XML MIME entity is received where the charset parameter is omitted, no information is being provided about the character encoding by the MIME Content-Type header. XML-aware consumers MUST follow the requirements in section 4.3.3 of [XML] that directly address this case. XML-unaware MIME consumers SHOULD NOT assume a default encoding in this case.

如果接收到的XML MIME实体省略了charset参数,则不会提供MIME内容类型头的字符编码信息。支持XML的消费者必须遵守[XML]第4.3.3节中直接针对这种情况的要求。在这种情况下,不知道XML的MIME使用者不应采用默认编码。

3.3. The BOM and Encoding Conversions
3.3. BOM表和编码转换

Section 4.3.3 of [XML] specifies that UTF-16 XML MIME entities not labelled as "utf-16le" or "utf-16be" MUST begin with a BOM, U+FEFF, which appears as the hexadecimal octet sequence 0xFE 0xFF (big-endian) or 0xFF 0xFE (little-endian). [XML] further states that the BOM is an encoding signature and is not part of either the markup or the character data of the XML document.

[XML]第4.3.3节规定,未标记为“UTF-16le”或“UTF-16be”的UTF-16 XML MIME实体必须以BOM U+FEFF开头,该BOM显示为十六进制八位字节序列0xFE 0xFF(大端号)或0xFF 0xFE(小端号)。[XML]进一步指出,BOM是编码签名,不是XML文档的标记或字符数据的一部分。

Due to the presence of the BOM, applications that convert XML from UTF-16 to an encoding other than UTF-8 MUST strip the BOM before conversion. Similarly, when converting from another encoding into UTF-16, either without a charset parameter or labelled "utf-16", the BOM MUST be added unless the original encoding was UTF-8 and a BOM was already present, in which case it MUST be transcoded into the appropriate UTF-16 BOM.

由于BOM的存在,将XML从UTF-16转换为非UTF-8编码的应用程序必须在转换之前剥离BOM。类似地,当从另一种编码转换为UTF-16(无字符集参数或标记为“UTF-16”)时,必须添加BOM,除非原始编码为UTF-8且BOM已经存在,在这种情况下,必须将其转换为相应的UTF-16 BOM。

Section 4.3.3 of [XML] also allows for UTF-8 XML MIME entities to begin with a BOM, which appears as the hexadecimal octet sequence 0xEF 0xBB 0xBF. This is likewise defined to be an encoding signature, and not part of either the markup or the character data of the XML document.

[XML]第4.3.3节还允许UTF-8 XML MIME实体以BOM开头,BOM显示为十六进制八位字节序列0xEF 0xBB 0xBF。这同样被定义为编码签名,而不是XML文档的标记或字符数据的一部分。

Applications that convert XML from UTF-8 to an encoding other than UTF-16 MUST strip the BOM, if present, before conversion. Applications that convert XML into UTF-8 MAY add a BOM.

将XML从UTF-8转换为UTF-16以外的编码的应用程序必须在转换之前剥离BOM(如果存在)。将XML转换为UTF-8的应用程序可以添加BOM表。

In addition to the MIME charset "utf-16", [RFC2781] introduces "utf-16le" (little-endian) and "utf-16be" (big-endian). When an XML MIME entity is encoded in "utf-16le" or "utf-16be", it MUST NOT begin with the BOM but SHOULD contain an in-band XML encoding declaration. Conversion from UTF-8 or UTF-16 (unlabelled, or labelled with "utf-16") to "utf-16be" or "utf-16le" MUST strip a BOM if present. Conversion from UTF-16 labelled "utf-16le" or "utf-16be" to UTF-16 without a label or labelled "utf-16" MUST add the appropriate BOM. Conversion from UTF-16 labelled "utf-16le" or "utf-16be" to UTF-8 MAY add a UTF-8 BOM, but this is NOT RECOMMENDED.

除了MIME字符集“utf-16”之外,[RFC2781]还引入了“utf-16le”(小端)和“utf-16be”(大端)。当XML MIME实体编码为“utf-16le”或“utf-16be”时,它不能以BOM开头,而是应该包含带内XML编码声明。从UTF-8或UTF-16(未标记或标有“UTF-16”)到“UTF-16be”或“UTF-16le”的转换必须去除BOM(如果存在)。从标有“UTF-16le”或“UTF-16be”的UTF-16转换为不带标签或标有“UTF-16”的UTF-16必须添加相应的BOM表。从标有“UTF-16le”或“UTF-16be”的UTF-16转换为UTF-8可能会添加UTF-8 BOM,但不建议这样做。

Appendix F of [XML] also implies that a UTF-32 BOM may be used in conjunction with UTF-32-encoded documents. As noted above, this specification recommends against the use of UTF-32. If it is used, the same considerations as UTF-16 apply with respect to its being a signature (not part of the document), transcoding into or out of it, and transcoding into or out of the MIME charsets "utf-32le" and "utf-32be". Consumers that do not support UTF-32 SHOULD nonetheless recognise UTF-32 signatures in order to give helpful error messages (instead of treating them as invalid UTF-16).

[XML]的附录F还暗示UTF-32 BOM可与UTF-32编码文档结合使用。如上所述,本规范建议不要使用UTF-32。如果使用,与UTF-16相同的注意事项适用于其作为签名(不是文档的一部分)、在其中转码或转码以及在MIME字符集“UTF-32le”和“UTF-32be”中转码或转码。不支持UTF-32的使用者仍应识别UTF-32签名,以提供有用的错误消息(而不是将其视为无效的UTF-16)。

4. XML Media Types
4. XML媒体类型
4.1. XML MIME Entities
4.1. XML MIME实体

Within the XML specification, XML MIME entities can be classified into four types. In the XML terminology, they are called "document entities", "external DTD subsets", "external parsed entities", and "external parameter entities". Appropriate usage for the types registered below is as follows:

在XML规范中,XML MIME实体可以分为四种类型。在XML术语中,它们被称为“文档实体”、“外部DTD子集”、“外部解析实体”和“外部参数实体”。以下注册类型的适当用法如下:

document entities: The media types application/xml or text/xml, or a more specific media type (see Section 9.6), SHOULD be used.

文档实体:应使用媒体类型application/xml或text/xml,或更具体的媒体类型(见第9.6节)。

external DTD subsets: The media type application/xml-dtd SHOULD be used. The media types application/xml and text/xml MUST NOT be used.

外部DTD子集:应使用媒体类型应用程序/xml DTD。不得使用媒体类型application/xml和text/xml。

external parsed entities: The media types application/xml-external-parsed-entity or text/xml-external-parsed-entity SHOULD be used. The media types application/xml and text/xml MUST NOT be used unless the parsed entities are also well-formed "document entities".

外部解析实体:应使用媒体类型应用程序/xml外部解析实体或文本/xml外部解析实体。除非解析的实体也是格式良好的“文档实体”,否则不得使用媒体类型application/xml和text/xml。

external parameter entities: The media type application/xml-dtd SHOULD be used. The media types application/xml and text/xml MUST NOT be used.

外部参数实体:应使用媒体类型应用程序/xml dtd。不得使用媒体类型application/xml和text/xml。

Note that [RFC3023] (which this specification obsoletes) recommended the use of text/xml and text/xml-external-parsed-entity for document entities and external parsed entities, respectively, but described handling of character encoding that differed from common implementation practice. These media types are still commonly used, and this specification aligns the handling of character encoding with industry practice.

注意,[RFC3023](本规范已废除)建议分别对文档实体和外部解析实体使用text/xml和text/xml外部解析实体,但描述了不同于常见实现实践的字符编码处理。这些媒体类型仍然普遍使用,本规范将字符编码的处理与行业实践保持一致。

Note that [RFC2376] (which is obsolete) allowed application/xml and text/xml to be used for any of the four types, although in practice it is likely to have been rare.

请注意,[RFC2376](已过时)允许将application/xml和text/xml用于这四种类型中的任何一种,尽管在实践中可能很少使用。

Neither external DTD subsets nor external parameter entities parse as XML documents, and while some XML document entities may be used as external parsed entities and vice versa, there are many cases where the two are not interchangeable. XML also has unparsed entities, internal parsed entities, and internal parameter entities, but they are not XML MIME entities.

外部DTD子集和外部参数实体都不能解析为XML文档,尽管一些XML文档实体可以用作外部解析实体,反之亦然,但在许多情况下,这两种实体是不可互换的。XML还具有未解析实体、内部解析实体和内部参数实体,但它们不是XML MIME实体。

Compared to [RFC2376] or [RFC3023], this specification alters the handling of character encoding of text/xml and text/xml-external-parsed-entity, treating them no differently from the respective application/ types. However, application/xml and application/xml-external-parsed-entity are still RECOMMENDED, to avoid possible confusion based on the earlier distinction. The former confusion around the question of default character sets for the two text/ types no longer arises because

与[RFC2376]或[RFC3023]相比,本规范改变了文本/xml和文本/xml外部解析实体的字符编码处理,将它们与相应的应用程序/类型区别对待。但是,仍然建议使用application/xml和application/xml外部解析实体,以避免由于前面的区别而产生混淆。以前关于两种文本/类型的默认字符集问题的混淆不再出现,因为

[RFC7231] changes [RFC2616] by removing the ISO-8859-1 default and not defining any default at all;

[RFC7231]通过删除ISO-8859-1默认值并完全不定义任何默认值来更改[RFC2616];

[RFC6657] updates [RFC2046] to remove the US-ASCII [ASCII] default.

[RFC6657]更新[RFC2046]以删除US-ASCII[ASCII]默认值。

See Section 3 for the now-unified approach to the charset parameter that results.

请参见第3节,了解现在对结果的charset参数的统一方法。

XML provides a general framework for defining sequences of structured data. It is often appropriate to define new media types that use XML but define a specific application of XML, due to domain-specific display, editing, security considerations, or runtime information. Furthermore, such media types may allow only UTF-8 and/or UTF-16 and prohibit other character sets. This specification does not prohibit such media types; in fact, they are expected to proliferate.

XML为定义结构化数据序列提供了通用框架。由于特定于域的显示、编辑、安全考虑或运行时信息,通常适合定义使用XML但定义XML的特定应用程序的新媒体类型。此外,此类媒体类型可能仅允许UTF-8和/或UTF-16,并禁止其他字符集。本规范不禁止此类介质类型;事实上,它们预计会扩散。

However, developers of such media types are RECOMMENDED to use this specification as a basis for their registration. See Section 4.2 for more detailed recommendations on using the '+xml' suffix for registration of such media types.

但是,建议此类媒体类型的开发人员使用此规范作为注册的基础。有关使用“+xml”后缀注册此类媒体类型的更详细建议,请参见第4.2节。

An XML document labeled as application/xml or text/xml, or with a '+xml' media type, might contain namespace declarations, stylesheet-linking processing instructions (PIs), schema information, or other declarations that might be used to suggest how the document is to be processed. For example, a document might have the XHTML namespace and a reference to a Cascading Style Sheets (CSS) stylesheet. Such a document might be handled by applications that would use this information to dispatch the document for appropriate processing. Appendix B lists the core XML specifications that, taken together with [XML] itself, show how to determine an XML document's language-level semantics and suggest how information about its application-level semantics may be locatable.

标记为application/XML或text/XML或带有“+XML”媒体类型的XML文档可能包含名称空间声明、样式表链接处理指令(pi)、模式信息或其他声明,这些声明可用于建议如何处理文档。例如,文档可能具有XHTML名称空间和对级联样式表(CSS)样式表的引用。这样的文档可以由应用程序处理,这些应用程序将使用此信息来分发文档以进行适当的处理。附录B列出了核心XML规范,这些规范与[XML]本身一起展示了如何确定XML文档的语言级语义,并建议如何定位有关其应用程序级语义的信息。

4.2. Using '+xml' when Registering XML-Based Media Types
4.2. 注册基于xml的媒体类型时使用“+xml”

In Section 9.6, this specification updates the registration in [RFC6839] for XML-based MIME types (the '+xml' types).

在第9.6节中,本规范更新了[RFC6839]中基于XML的MIME类型(“+XML”类型)的注册。

When a new media type is introduced for an XML-based format, the name of the media type SHOULD end with '+xml' unless generic XML processing is in some way inappropriate for documents of the new type. This convention will allow applications that can process XML generically to detect that the MIME entity is supposed to be an XML document, verify this assumption by invoking some XML processor, and then process the XML document accordingly. Applications may check for types that represent XML MIME entities by comparing the last four characters of the subtype to the string '+xml'. (However, note that four of the five media types defined in this specification -- text/ xml, application/xml, text/xml-external-parsed-entity, and application/xml-external-parsed-entity -- also represent XML MIME entities while not ending with '+xml'.)

为基于XML的格式引入新媒体类型时,媒体类型的名称应以“+XML”结尾,除非通用XML处理在某种程度上不适用于新类型的文档。此约定将允许能够通用地处理XML的应用程序检测MIME实体是否应该是XML文档,通过调用某个XML处理器验证此假设,然后相应地处理XML文档。应用程序可以通过将子类型的最后四个字符与字符串“+XML”进行比较来检查表示XML MIME实体的类型。(但是,请注意,本规范中定义的五种媒体类型中的四种——text/xml、application/xml、text/xml外部解析实体和application/xml外部解析实体——也表示xml MIME实体,但不以“+xml”结尾。)

NOTE: Section 5.3.2 of [RFC7231] does not support any form of Accept header that will match only '+xml' types. In particular, Accept headers of the form "Accept: */*+xml" are not allowed, and will not work for this purpose.

注:[RFC7231]第5.3.2节不支持任何形式的仅匹配“+xml”类型的接受标头。特别是,不允许使用格式为“Accept:*/+xml”的Accept头,并且不适用于此目的。

Media types following the naming convention '+xml' SHOULD define the charset parameter for consistency, since XML-generic processing by definition treats all XML MIME entities uniformly as regards character encoding information. However, there are some cases that the charset parameter need not be defined. For example:

遵循命名约定“+xml”的媒体类型应定义字符集参数以确保一致性,因为xml通用处理按定义统一处理所有xml MIME实体的字符编码信息。但是,在某些情况下,不需要定义charset参数。例如:

When an XML-based media type is restricted to UTF-8, it is not necessary to define the charset parameter. UTF-8 is the default for XML.

当基于XML的媒体类型限制为UTF-8时,无需定义charset参数。UTF-8是XML的默认值。

When an XML-based media type is restricted to UTF-8 and UTF-16, it might not be unreasonable to omit the charset parameter. Neither UTF-8 nor UTF-16 require XML encoding declarations.

当基于XML的媒体类型被限制为UTF-8和UTF-16时,省略charset参数可能不是不合理的。UTF-8和UTF-16都不需要XML编码声明。

XML generic processing is not always appropriate for XML-based media types. For example, authors of some such media types may wish that the types remain entirely opaque except to applications that are specifically designed to deal with that media type. By NOT following the naming convention '+xml', such media types can avoid XML-generic processing. Since generic processing will be useful in many cases, however -- including in some situations that are difficult to predict ahead of time -- the '+xml' convention is to be preferred unless there is some particularly compelling reason not to use it.

XML通用处理并不总是适用于基于XML的媒体类型。例如,某些此类媒体类型的作者可能希望这些类型保持完全不透明,但专门设计用于处理该媒体类型的应用程序除外。通过不遵循命名约定“+xml”,此类媒体类型可以避免xml通用处理。然而,由于泛型处理在许多情况下都是有用的,包括在某些难以提前预测的情况下,“+xml”约定是首选的,除非有特别令人信服的理由不使用它。

The registration process for specific '+xml' media types is described in [RFC6838]. New XML-based media type registrations in the IETF must follow these guidelines. When other organisations register XML-based media types via the "Specification Required" IANA registration policy [RFC5226], the relevant Media Reviewer should ensure that they use the '+xml' convention, in order to ensure maximum interoperability of their XML-based documents. Only media subtypes that represent XML MIME entities are allowed to register with a '+xml' suffix.

[RFC6838]中描述了特定“+xml”媒体类型的注册过程。IETF中新的基于XML的媒体类型注册必须遵循这些准则。当其他组织通过“规范要求”IANA注册政策[RFC5226]注册基于XML的媒体类型时,相关媒体审查员应确保他们使用“+XML”约定,以确保其基于XML的文档的最大互操作性。只有表示XML MIME实体的媒体子类型才允许使用“+XML”后缀注册。

In addition to the changes described above, the change controller has been changed to be the World Wide Web Consortium (W3C).

除上述变更外,变更控制者已变更为万维网联盟(W3C)。

4.3. Registration Guidelines for XML-Based Media Types Not Using '+xml'
4.3. 不使用“+XML”的基于XML的媒体类型的注册指南

Registrations for new XML-based media types that do _not_ use the '+xml' suffix SHOULD, in specifying the charset parameter and encoding considerations, define them as: "Same as [charset parameter / encoding considerations] of application/xml as specified in RFC 7303".

对于不使用“+XML”后缀的基于XML的新媒体类型的注册,在指定字符集参数和编码注意事项时,应将其定义为:“与RFC 7303中指定的应用程序/XML的[charset参数/编码注意事项]相同”。

Defining the charset parameter is RECOMMENDED, since this information can be used by XML processors to determine authoritatively the character encoding of the XML MIME entity in the absence of a BOM. If there are some reasons not to follow this advice, they SHOULD be included as part of the registration. As shown above, two such reasons are "UTF-8 only" or "UTF-8 or UTF-16 only".

建议定义charset参数,因为在没有BOM表的情况下,XML处理器可以使用此信息权威地确定XML MIME实体的字符编码。如果有某些原因不遵循此建议,则应将其作为注册的一部分。如上所示,有两个原因是“仅限UTF-8”或“仅限UTF-8或UTF-16”。

These registrations SHOULD specify that the XML-based media type being registered has all of the security considerations described in this specification plus any additional considerations specific to that media type.

这些注册应指定正在注册的基于XML的媒体类型具有本规范中描述的所有安全注意事项,以及特定于该媒体类型的任何其他注意事项。

These registrations SHOULD also make reference to this specification in specifying magic numbers, base URIs, and use of the BOM.

在指定幻数、基本URI和BOM的使用时,这些注册还应参考本规范。

These registrations MAY reference the application/xml registration in this document in specifying interoperability and fragment identifier considerations, if these considerations are not overridden by issues specific to that media type.

在指定互操作性和片段标识符注意事项时,如果这些注意事项没有被特定于该媒体类型的问题所覆盖,则这些注册可以参考本文档中的应用程序/xml注册。

5. Fragment Identifiers
5. 片段标识符

Uniform Resource Identifiers (URIs) can contain fragment identifiers (see Section 3.5 of [RFC3986]). Specifying the syntax and semantics of fragment identifiers is devolved by [RFC3986] to the appropriate media type registration.

统一资源标识符(URI)可以包含片段标识符(见[RFC3986]第3.5节)。[RFC3986]将指定片段标识符的语法和语义移交给相应的媒体类型注册。

   The syntax and semantics of fragment identifiers for the XML media
   types defined in this specification are based on the
   [XPointerFramework] W3C Recommendation.  It allows simple names and
   more complex constructions based on named schemes.  When the syntax
   of a fragment identifier part of any URI or Internationalized
   Resource Identifier (IRI) ([RFC3987]) with a retrieved media type
   governed by this specification conforms to the syntax specified in
   [XPointerFramework], conforming applications MUST interpret such
   fragment identifiers as designating whatever is specified by the
   [XPointerFramework] together with any other specifications governing
   the XPointer schemes used in those identifiers that the applications
   support.  Conforming applications MUST support the 'element' scheme
   as defined in [XPointerElement], but need not support other schemes.
        
   The syntax and semantics of fragment identifiers for the XML media
   types defined in this specification are based on the
   [XPointerFramework] W3C Recommendation.  It allows simple names and
   more complex constructions based on named schemes.  When the syntax
   of a fragment identifier part of any URI or Internationalized
   Resource Identifier (IRI) ([RFC3987]) with a retrieved media type
   governed by this specification conforms to the syntax specified in
   [XPointerFramework], conforming applications MUST interpret such
   fragment identifiers as designating whatever is specified by the
   [XPointerFramework] together with any other specifications governing
   the XPointer schemes used in those identifiers that the applications
   support.  Conforming applications MUST support the 'element' scheme
   as defined in [XPointerElement], but need not support other schemes.
        

If an XPointer error is reported in the attempt to process the part, this specification does not define an interpretation for the part.

如果在尝试处理零件时报告XPointer错误,则本规范不定义零件的解释。

A registry of XPointer schemes [XPtrReg] is maintained at the W3C. Generic processors of XML MIME entities SHOULD NOT implement unregistered XPointer schemes ([XPtrRegPolicy] describes requirements and procedures for registering schemes).

W3C维护XPointer方案[XPtrReg]的注册表。XML MIME实体的通用处理器不应实现未注册的XPointer方案([XPtrRegPolicy]描述了注册方案的要求和过程)。

See Section 4.2 for additional requirements that apply when an XML-based media type follows the naming convention '+xml'.

有关基于XML的媒体类型遵循命名约定“+XML”时适用的其他要求,请参见第4.2节。

If [XPointerFramework] and [XPointerElement] are inappropriate for some XML-based media type, it SHOULD NOT follow the naming convention '+xml'.

如果[XPointerFramework]和[XPointerElement]不适合某些基于XML的媒体类型,则不应遵循命名约定“+XML”。

When a URI has a fragment identifier, it is encoded by a limited subset of the repertoire of US-ASCII characters, see [XPointerFramework] for details.

当URI具有片段标识符时,它由US-ASCII字符集的有限子集进行编码,有关详细信息,请参见[XPointerFramework]。

6. The Base URI
6. 基本URI

An XML MIME entity of type application/xml, text/xml, application/ xml-external-parsed-entity, or text/xml-external-parsed-entity MAY use the xml:base attribute, as described in [XMLBase], to embed a base URI in that entity for use in resolving relative URI references (see Section 5.1 of [RFC3986]).

类型为application/XML、text/XML、application/XML外部解析实体或text/XML外部解析实体的XML MIME实体可使用[XMLBase]中所述的XML:base属性在该实体中嵌入基本URI,以用于解析相对URI引用(请参阅[RFC3986]第5.1节)。

Note that the base URI itself might be embedded in a different MIME entity, since the default value for the xml:base attribute can be specified in an external DTD subset or external parameter entity. Since conforming XML processors need not always read and process external entities, the effect of such an external default is uncertain; therefore, its use is NOT RECOMMENDED.

请注意,基本URI本身可能嵌入到不同的MIME实体中,因为xml:base属性的默认值可以在外部DTD子集或外部参数实体中指定。由于一致性XML处理器并不总是需要读取和处理外部实体,因此这种外部默认的效果是不确定的;因此,不建议使用它。

7. XML Versions
7. XML版本

application/xml, application/xml-external-parsed-entity, application/ xml-dtd, text/xml, and text/xml-external-parsed-entity are to be used with [XML]. In all examples herein where version="1.0" is shown, it is understood that version="1.1" might also appear, providing the content does indeed conform to [XML1.1].

application/xml、application/xml外部解析实体、application/xml dtd、text/xml和text/xml外部解析实体将与[xml]一起使用。在本文中显示version=“1.0”的所有示例中,可以理解,version=“1.1”也可能出现,前提是内容确实符合[XML1.1]。

The normative requirement of this specification upon XML documents and processors is to follow the requirements of [XML], Section 4.3.3.

本规范对XML文档和处理器的规范性要求应符合[XML]第4.3.3节的要求。

Except for minor clarifications, that section is substantially identical from the first edition to the current (5th) edition of XML 1.0, and for XML 1.1 first or second edition [XML1.1]. Therefore, references herein to [XML] may be interpreted as referencing any existing version or edition of XML, or any subsequent edition or version that makes no incompatible changes to that section.

除了次要的澄清外,该部分与XML 1.0的第一版到当前(第五版)以及XML 1.1的第一版或第二版[XML1.1]基本相同。因此,本文中对[XML]的引用可能被解释为引用任何现有版本或XML版本,或对该部分没有不兼容更改的任何后续版本或版本。

Specifications and recommendations based on or referring to this RFC SHOULD indicate any limitations on the particular versions or editions of XML to be used.

基于或参考本RFC的规范和建议应指出对所使用的特定XML版本或版本的任何限制。

8. Examples
8. 例子

This section is non-normative. In particular, note that all [RFC2119] language herein reproduces or summarizes the consequences of normative statements already made above, and has no independent normative force, and accordingly does not appear in uppercase.

本节是非规范性的。特别要注意的是,本文中的所有[RFC2119]语言复制或总结了上述规范性陈述的结果,并且没有独立的规范性效力,因此不以大写字母出现。

The examples below give the MIME Content-Type header, including the charset parameter, if present and the XML declaration or Text declaration (which includes the encoding declaration) inside the XML MIME entity. For UTF-16 examples, the Byte Order Mark character appropriately UTF-16 encoded is denoted as "{BOM}", and the XML or Text declaration is assumed to come at the beginning of the XML MIME entity, immediately following the encoded BOM. Note that other MIME headers may be present, and the XML MIME entity will normally contain other data in addition to the XML declaration; the examples focus on the Content-Type header and the encoding declaration for clarity.

下面的示例给出了MIME内容类型头,包括字符集参数(如果存在)以及XML MIME实体内的XML声明或文本声明(包括编码声明)。对于UTF-16示例,UTF-16编码的字节顺序标记字符表示为“{BOM}”,并且假定XML或文本声明位于XML MIME实体的开头,紧跟在编码的BOM之后。请注意,可能存在其他MIME头,XML MIME实体通常将包含XML声明之外的其他数据;为了清晰起见,这些示例将重点放在内容类型头和编码声明上。

Although they show a content type of 'application/xml', all the examples below apply to all five media types declared below in Section 9, as well as to any media types declared using the '+xml' convention (with the exception of the examples involving the charset parameter for any such media types that do not enable its use). See the XML MIME entities table (Section 4.1, Paragraph 1) for discussion of which types are appropriate for which varieties of XML MIME entity.

尽管它们显示的内容类型为“application/xml”,但下面的所有示例均适用于第9节中声明的所有五种媒体类型,以及使用“+xml”约定声明的任何媒体类型(涉及任何此类媒体类型的字符集参数的示例除外,这些媒体类型不允许使用字符集参数)。请参阅XML MIME实体表(第4.1节,第1段),以了解哪些类型适用于哪些种类的XML MIME实体。

8.1. UTF-8 Charset
8.1. UTF-8字符集
   Content-Type: application/xml; charset=utf-8
        
   Content-Type: application/xml; charset=utf-8
        
   <?xml version="1.0" encoding="utf-8"?>
        
   <?xml version="1.0" encoding="utf-8"?>
        

or

   <?xml version="1.0"?>
        
   <?xml version="1.0"?>
        

UTF-8 is the recommended encoding for use with all the media types defined in this specification. Since the charset parameter is provided and there is no overriding BOM, conformant MIME and XML processors must treat the enclosed entity as UTF-8 encoded.

UTF-8是本规范中定义的所有媒体类型的推荐编码。由于提供了charset参数,并且没有覆盖BOM,因此一致性MIME和XML处理器必须将封闭的实体视为UTF-8编码的实体。

If sent using a 7-bit transport (e.g., SMTP [RFC5321]), in general, a UTF-8 XML MIME entity must use a content-transfer-encoding of either quoted-printable or base64. For an 8-bit clean transport (e.g., 8BITMIME ESMTP or NNTP), or a binary clean transport (e.g., BINARY ESMTP or HTTP), no content-transfer-encoding is necessary (or even possible, in the case of HTTP).

如果使用7位传输(例如SMTP[RFC5321])发送,通常情况下,UTF-8 XML MIME实体必须使用引用的可打印或base64的内容传输编码。对于8位干净传输(例如8BITMIME ESMTP或NNTP)或二进制干净传输(例如二进制ESMTP或HTTP),不需要内容传输编码(甚至在HTTP的情况下可能)。

8.2. UTF-16 Charset
8.2. UTF-16字符集
   Content-Type: application/xml; charset=utf-16
        
   Content-Type: application/xml; charset=utf-16
        
   {BOM}<?xml version="1.0" encoding="utf-16"?>
        
   {BOM}<?xml version="1.0" encoding="utf-16"?>
        

or

   {BOM}<?xml version="1.0"?>
        
   {BOM}<?xml version="1.0"?>
        

For the three application/media types defined above, if sent using a 7-bit transport (e.g., SMTP) or an 8-bit clean transport (e.g., 8BITMIME ESMTP or NNTP), the XML MIME entity must be encoded in quoted-printable or base64; for a binary clean transport (e.g., BINARY ESMTP or HTTP), no content-transfer-encoding is necessary (or even possible, in the case of HTTP).

对于上面定义的三种应用程序/媒体类型,如果使用7位传输(例如SMTP)或8位干净传输(例如8BITMIME ESMTP或NNTP)发送,则XML MIME实体必须以引号可打印或base64编码;对于二进制干净传输(例如,二进制ESMTP或HTTP),不需要内容传输编码(甚至在HTTP的情况下可能)。

As described in [RFC2781], the UTF-16 family must not be used with media types under the top-level type "text" except over HTTP or HTTPS (see Section A.2 of HTTP [RFC7231] for details). Hence, one of the two text/media types defined above can be used with this example only when the XML MIME entity is transmitted via HTTP or HTTPS, which use a MIME-like mechanism and are binary-clean protocols and hence do not perform CR and LF transformations and allow NUL octets. Since HTTP is binary clean, no content-transfer-encoding is necessary (or even possible).

如[RFC2781]所述,UTF-16系列不得与顶级类型“文本”下的媒体类型一起使用,HTTP或HTTPS除外(有关详细信息,请参阅HTTP[RFC7231]的A.2节)。因此,只有当XML MIME实体通过HTTP或HTTPS传输时,上述两种文本/媒体类型中的一种才能用于本示例,HTTP或HTTPS使用类似MIME的机制,是二进制干净协议,因此不执行CR和LF转换,并允许NUL八位字节。由于HTTP是二进制干净的,因此不需要(甚至不可能)内容传输编码。

8.3. Omitted Charset and 8-Bit MIME Entity
8.3. 省略的字符集和8位MIME实体
   Content-Type: application/xml
        
   Content-Type: application/xml
        
   <?xml version="1.0" encoding="iso-8859-1"?>
        
   <?xml version="1.0" encoding="iso-8859-1"?>
        

Since the charset parameter is not provided in the Content-Type header and there is no overriding BOM, conformant XML processors must treat the "iso-8859-1" encoding as authoritative. Conformant XML-unaware MIME processors should make no assumptions about the character encoding of the XML MIME entity.

由于内容类型标头中未提供字符集参数,并且没有覆盖BOM,因此符合要求的XML处理者必须将“iso-8859-1”编码视为权威编码。一致的XML MIME处理器不应假设XML MIME实体的字符编码。

8.4. Omitted Charset and 16-Bit MIME Entity
8.4. 省略的字符集和16位MIME实体
   Content-Type: application/xml
        
   Content-Type: application/xml
        
   {BOM}<?xml version="1.0" encoding="utf-16"?>
        
   {BOM}<?xml version="1.0" encoding="utf-16"?>
        

or

   {BOM}<?xml version="1.0"?>
        
   {BOM}<?xml version="1.0"?>
        

This example shows a 16-bit MIME entity with no charset parameter. However, since there is a BOM, conformant processors must treat the entity as UTF-16 encoded.

此示例显示了一个没有字符集参数的16位MIME实体。但是,由于存在BOM,一致性处理者必须将实体视为UTF-16编码。

Omitting the charset parameter is not recommended in conjunction with media types under the top-level type "application" when used with transports other than HTTP or HTTPS. Media types under the top-level type "text" should not be used for 16-bit MIME with transports other than HTTP or HTTPS (see discussion above in Section 8.2, Paragraph 7).

当与HTTP或HTTPS以外的传输一起使用时,不建议在顶级类型“application”下与媒体类型一起省略charset参数。顶级类型“text”下的媒体类型不应用于传输HTTP或HTTPS以外的16位MIME(见上文第8.2节第7段的讨论)。

8.5. Omitted Charset, No Internal Encoding Declaration
8.5. 省略了字符集,没有内部编码声明
   Content-Type: application/xml
        
   Content-Type: application/xml
        
   <?xml version='1.0'?>
        
   <?xml version='1.0'?>
        

In this example, the charset parameter has been omitted, there is no internal encoding declaration, and there is no BOM. Since there is no BOM or charset parameter, the XML processor follows the requirements in Section 4.3.3, and optionally applies the mechanism described in Appendix F (which is non-normative) of [XML] to determine an encoding of UTF-8. Although the XML MIME entity does not contain an encoding declaration, provided the encoding actually _is_ UTF-8, this is a conforming XML MIME entity.

在本例中,省略了charset参数,没有内部编码声明,也没有BOM表。由于没有BOM或字符集参数,XML处理器遵循第4.3.3节中的要求,并选择性地应用[XML]附录F(非规范性)中描述的机制来确定UTF-8的编码。尽管XML MIME实体不包含编码声明,但如果编码实际为UTF-8,则这是一个一致的XML MIME实体。

A conformant XML-unaware MIME processor should make no assumptions about the character encoding of the XML MIME entity.

一致的XML MIME处理器不应假设XML MIME实体的字符编码。

See Section 8.1 for transport-related issues for UTF-8 XML MIME entities.

有关UTF-8 XML MIME实体的传输相关问题,请参见第8.1节。

8.6. UTF-16BE Charset
8.6. UTF-16BE字符集
   Content-Type: application/xml; charset=utf-16be
        
   Content-Type: application/xml; charset=utf-16be
        
   <?xml version='1.0' encoding='utf-16be'?>
        
   <?xml version='1.0' encoding='utf-16be'?>
        

Observe that, as required for this encoding, there is no BOM. Since the charset parameter is provided and there is no overriding BOM, conformant MIME and XML processors must treat the enclosed entity as UTF-16BE encoded.

请注意,按照此编码的要求,没有BOM表。由于提供了charset参数,并且没有覆盖BOM,因此一致性MIME和XML处理器必须将封闭的实体视为UTF-16BE编码。

See also the additional considerations in the UTF-16 example in Section 8.2.

另请参见第8.2节UTF-16示例中的其他注意事项。

8.7. Non-UTF Charset
8.7. 非UTF字符集
   Content-Type: application/xml; charset=iso-2022-kr
        
   Content-Type: application/xml; charset=iso-2022-kr
        
   <?xml version="1.0" encoding="iso-2022-kr"?>
        
   <?xml version="1.0" encoding="iso-2022-kr"?>
        

This example shows the use of a non-UTF character encoding (in this case Hangul, but this example is intended to cover all non-UTF-family character encodings). Since the charset parameter is provided and there is no overriding BOM, conformant processors must treat the enclosed entity as encoded per RFC 1557.

本例显示了非UTF字符编码的使用(在本例中为韩文,但本例旨在涵盖所有非UTF系列字符编码)。由于提供了字符集参数,并且没有覆盖BOM,一致性处理者必须按照RFC 1557的编码处理封闭实体。

Since ISO-2022-KR [RFC1557] has been defined to use only 7 bits of data, no content-transfer-encoding is necessary with any transport: for character sets needing 8 or more bits, considerations such as those discussed above (Sections 8.1 and 8.2) would apply.

由于ISO-2022-KR[RFC1557]已定义为仅使用7位数据,因此任何传输都不需要内容传输编码:对于需要8位或更多位的字符集,应考虑上述(第8.1节和第8.2节)所述的因素。

8.8. INCONSISTENT EXAMPLE: Conflicting Charset and Internal Encoding Declaration

8.8. 不一致示例:冲突的字符集和内部编码声明

   Content-Type: application/xml; charset=iso-8859-1
        
   Content-Type: application/xml; charset=iso-8859-1
        
   <?xml version="1.0" encoding="utf-8"?>
        
   <?xml version="1.0" encoding="utf-8"?>
        

Although the charset parameter is provided in the Content-Type header and there is no BOM and the charset parameter differs from the XML encoding declaration, conformant MIME and XML processors will interoperate. Since the charset parameter is authoritative in the absence of a BOM, conformant processors will treat the enclosed entity as iso-8859-1 encoded. That is, the "UTF-8" encoding declaration will be ignored.

尽管charset参数是在Content Type标头中提供的,并且没有BOM表,并且charset参数与XML编码声明不同,但一致的MIME和XML处理器将进行互操作。由于字符集参数在没有BOM的情况下具有权威性,因此一致性处理者将把封闭的实体视为iso-8859-1编码的实体。也就是说,“UTF-8”编码声明将被忽略。

Conformant processors generating XML MIME entities must not label conflicting character encoding information between the MIME Content-Type and the XML declaration unless they have definitive information about the actual encoding, for example, as a result of systematic transcoding. In particular, the addition by servers of an explicit, site-wide charset parameter default has frequently lead to interoperability problems for XML documents.

生成XML MIME实体的一致处理器不得标记MIME内容类型和XML声明之间冲突的字符编码信息,除非它们具有关于实际编码的确定信息,例如,作为系统转码的结果。特别是,服务器添加的显式、站点范围的字符集参数默认值经常导致XML文档的互操作性问题。

8.9. INCONSISTENT EXAMPLE: Conflicting Charset and BOM
8.9. 不一致示例:字符集和BOM表冲突
   Content-Type: application/xml; charset=iso-8859-1
        
   Content-Type: application/xml; charset=iso-8859-1
        
   {BOM}<?xml version="1.0"?>
        
   {BOM}<?xml version="1.0"?>
        

Although the charset parameter is provided in the Content-Type header, there is a BOM, so MIME and XML processors may not interoperate. Since the BOM parameter is authoritative for conformant XML processors, they will treat the enclosed entity as UTF-16 encoded. That is, the "iso-8859-1" charset parameter will be ignored. XML-unaware MIME processors on the other hand may be unaware of the BOM and so treat the entity as encoded in iso-8859-1.

虽然在内容类型头中提供了charset参数,但是有一个BOM表,因此MIME和XML处理器可能无法互操作。由于BOM参数对于一致的XML处理程序是权威的,因此它们将把封闭的实体视为UTF-16编码的。也就是说,“iso-8859-1”字符集参数将被忽略。另一方面,不知道XML的MIME处理器可能不知道BOM,因此将实体视为iso-8859-1中编码的实体。

Conformant processors generating XML MIME entities must not label conflicting character encoding information between the MIME Content-Type and an entity-initial BOM.

生成XML MIME实体的一致处理器不得标记MIME内容类型和实体初始BOM表之间冲突的字符编码信息。

9. IANA Considerations
9. IANA考虑
9.1. application/xml Registration
9.1. 应用程序/xml注册

Type name: application

类型名称:应用程序

Subtype name: xml

子类型名称:xml

Required parameters: none

所需参数:无

Optional parameters: charset

可选参数:字符集

See Section 3.

见第3节。

Encoding considerations: Depending on the character encoding used, XML MIME entities can consist of 7bit, 8bit, or binary data [RFC6838]. For 7-bit transports, 7bit data, for example, US-ASCII-encoded data, does not require content-transfer-encoding, but 8bit or binary data, for example, UTF-8 or UTF-16 data, MUST be content-transfer-encoded in quoted-printable or base64. For 8-bit clean transport (e.g., 8BITMIME ESMTP [RFC6152] or NNTP [RFC3977]), 7bit or 8bit data, for example, US-ASCII or UTF-8 data, does not require content-transfer-encoding, but binary data, for example, data with a UTF-16 encoding, MUST be content-transfer-encoded in base64. For binary clean transports (e.g., BINARY ESMTP [RFC3030] or HTTP [RFC7230]), no content-transfer-encoding is necessary (or even possible, in the case of HTTP) for 7bit, 8bit, or binary data.

编码注意事项:根据使用的字符编码,XML MIME实体可以由7位、8位或二进制数据组成[RFC6838]。对于7位传输,7位数据(例如,美国ASCII编码的数据)不需要内容传输编码,但8位或二进制数据(例如,UTF-8或UTF-16数据)必须以带引号的可打印或base64格式进行内容传输编码。对于8位干净传输(例如8BITMIME ESMTP[RFC6152]或NNTP[RFC3977]),7bit或8bit数据(例如US-ASCII或UTF-8数据)不需要内容传输编码,但二进制数据(例如UTF-16编码的数据)必须在base64中进行内容传输编码。对于二进制干净传输(例如,二进制ESMTP[RFC3030]或HTTP[RFC7230]),对于7bit、8bit或二进制数据,不需要(甚至在HTTP的情况下可能)进行内容传输编码。

Security considerations: See Section 10.

安全注意事项:见第10节。

Interoperability considerations: XML has proven to be interoperable across both generic and task-specific applications and for import and export from multiple XML authoring and editing tools. Validating processors provide maximum interoperability, because they have to handle all aspects of XML. Although a non-validating

互操作性注意事项:XML已被证明可以跨通用和特定于任务的应用程序进行互操作,并且可以从多个XML创作和编辑工具进行导入和导出。验证处理器提供了最大的互操作性,因为它们必须处理XML的所有方面。虽然是非验证性的

processor may be more efficient, it might not handle all aspects. For further information, see Section 2.9 "Standalone Document Declaration" and Section 5 "Conformance" of [XML] .

处理器可能更高效,但它可能无法处理所有方面。有关更多信息,请参阅[XML]第2.9节“独立文档声明”和第5节“一致性”。

In practice, character set issues have proved to be the biggest source of interoperability problems. The use of UTF-8, and careful attention to the guidelines set out in Section 3, are the best ways to avoid such problems.

在实践中,字符集问题已被证明是互操作性问题的最大来源。使用UTF-8,并仔细注意第3节中规定的指南,是避免此类问题的最佳方法。

Published specification: Extensible Markup Language (XML) 1.0 (Fifth Edition) [XML] or subsequent editions or versions thereof.

已发布规范:可扩展标记语言(XML)1.0(第五版)[XML]或其后续版本或版本。

Applications that use this media type: XML is device, platform, and vendor neutral and is supported by generic and task-specific applications and a wide range of generic XML tools (editors, parsers, Web agents, ...).

使用这种媒体类型的应用程序:XML是设备、平台和供应商中立的,由通用和任务特定的应用程序以及广泛的通用XML工具(编辑器、解析器、Web代理等)支持。

Additional information:

其他信息:

Magic number(s): None.

幻数:无。

Although no byte sequences can be counted on to always be present, XML MIME entities in ASCII-compatible character sets (including UTF-8) often begin with hexadecimal 3C 3F 78 6D 6C ("<?xml"), and those in UTF-16 often begin with hexadecimal FE FF 00 3C 00 3F 00 78 00 6D 00 6C or FF FE 3C 00 3F 00 78 00 6D 00 6C 00 (the BOM followed by "<?xml"). For more information, see Appendix F of [XML].

虽然不能指望总是存在字节序列,但ASCII兼容字符集(包括UTF-8)中的XML MIME实体通常以十六进制3C 3F 78 6D 6C(“XML”)开头,而UTF-16中的XML MIME实体通常以十六进制FE FF 00 3C 00 3F 00 78 00 6D 00 6C或FF FE 3C 00 3F 00 78 00 6D 00 6C 00开头(BOM后跟“<?XML”)。有关更多信息,请参见[XML]的附录F。

File extension(s): .xml

文件扩展名:.xml

Macintosh File Type Code(s): "TEXT"

Macintosh文件类型代码:“文本”

Base URI: See Section 6

基本URI:参见第6节

Person and email address for further information: See Authors' Addresses section

人员和电子邮件地址了解更多信息:请参阅作者地址部分

Intended usage: COMMON

预期用途:普通

Author: See Authors' Addresses section

作者:参见作者地址部分

Change controller: The XML specification is a work product of the World Wide Web Consortium's XML Core Working Group. The W3C has change control over RFC 7303.

变更控制者:XML规范是万维网联盟XML核心工作组的工作成果。W3C对RFC 7303具有变更控制权。

9.2. text/xml Registration
9.2. 文本/xml注册

The registration information for text/xml is in all respects the same as that given for application/xml above (Section 9.1), except that the "Type name" is "text".

text/xml的注册信息在所有方面都与上述application/xml的注册信息相同(第9.1节),只是“Type name”是“text”。

9.3. application/xml-external-parsed-entity Registration
9.3. 应用程序/xml外部解析实体注册

Type name: application

类型名称:应用程序

Subtype name: xml-external-parsed-entity

子类型名称:xml外部解析实体

Required parameters: none

所需参数:无

Optional parameters: charset

可选参数:字符集

See Section 3.

见第3节。

Encoding considerations: Same as for application/xml (Section 9.1).

编码注意事项:与application/xml相同(第9.1节)。

Security considerations: See Section 10.

安全注意事项:见第10节。

Interoperability considerations: XML external parsed entities are as interoperable as XML documents, though they have a less tightly constrained structure and therefore need to be referenced by XML documents for proper handling by XML processors. Similarly, XML documents cannot be reliably used as external parsed entities because external parsed entities are prohibited from having standalone document declarations or DTDs. Identifying XML external parsed entities with their own content type enhances interoperability of both XML documents and XML external parsed entities.

互操作性注意事项:XML外部解析实体与XML文档一样具有互操作性,尽管它们的结构约束较少,因此需要被XML文档引用,以便由XML处理器进行适当处理。类似地,XML文档不能可靠地用作外部解析实体,因为外部解析实体被禁止具有独立的文档声明或DTD。用自己的内容类型标识XML外部解析实体可以增强XML文档和XML外部解析实体的互操作性。

Published specification: Same as for application/xml (Section 9.1).

已发布规范:与application/xml相同(第9.1节)。

Applications which use this media type: Same as for application/xml (Section 9.1).

使用此媒体类型的应用程序:与application/xml相同(第9.1节)。

Additional information:

其他信息:

Magic number(s): Same as for application/xml (Section 9.1).

幻数:与application/xml相同(第9.1节)。

File extension(s): .xml or .ent

文件扩展名:.xml或.ent

Macintosh File Type Code(s): "TEXT"

Macintosh文件类型代码:“文本”

Base URI: See Section 6

基本URI:参见第6节

Person and email address for further information: See Authors' Addresses section.

更多信息,请参阅作者地址部分。

Intended usage: COMMON

预期用途:普通

Author: See Authors' Addresses section.

作者:参见作者地址部分。

Change controller: The XML specification is a work product of the World Wide Web Consortium's XML Core Working Group. The W3C has change control over RFC 7303.

变更控制者:XML规范是万维网联盟XML核心工作组的工作成果。W3C对RFC 7303具有变更控制权。

9.4. text/xml-external-parsed-entity Registration
9.4. text/xml外部解析实体注册

The registration information for text/xml-external-parsed-entity is in all respects the same as that given for application/xml-external-parsed-entity above (Section 9.3), except that the "Type name" is "text".

text/xml外部解析实体的注册信息在所有方面均与上述application/xml外部解析实体的注册信息相同(第9.3节),但“类型名称”为“text”。

9.5. application/xml-dtd Registration
9.5. 应用程序/xml dtd注册

Type name: application

类型名称:应用程序

Subtype name: xml-dtd

子类型名称:xml dtd

Required parameters: none

所需参数:无

Optional parameters: charset

可选参数:字符集

See Section 3.

见第3节。

Encoding considerations: Same as for application/xml (Section 9.1).

编码注意事项:与application/xml相同(第9.1节)。

Security considerations: See Section 10.

安全注意事项:见第10节。

Interoperability considerations: XML DTDs have proven to be interoperable by DTD authoring tools and XML validators, among others.

互操作性注意事项:XML DTD已被证明可以通过DTD创作工具和XML验证器等进行互操作。

Published specification: Same as for application/xml (Section 9.1).

已发布规范:与application/xml相同(第9.1节)。

Applications which use this media type: DTD authoring tools handle external DTD subsets as well as external parameter entities. XML validators may also access external DTD subsets and external parameter entities.

使用此媒体类型的应用程序:DTD创作工具处理外部DTD子集以及外部参数实体。XML验证器还可以访问外部DTD子集和外部参数实体。

Additional information:

其他信息:

Magic number(s): Same as for application/xml (Section 9.1).

幻数:与application/xml相同(第9.1节)。

File extension(s): .dtd or .mod

文件扩展名:.dtd或.mod

Macintosh File Type Code(s): "TEXT"

Macintosh文件类型代码:“文本”

Person and email address for further information: See Authors' Addresses section.

更多信息,请参阅作者地址部分。

Intended usage: COMMON

预期用途:普通

Author: See Authors' Addresses section.

作者:参见作者地址部分。

Change controller: The XML specification is a work product of the World Wide Web Consortium's XML Core Working Group. The W3C has change control over RFC 7303.

变更控制者:XML规范是万维网联盟XML核心工作组的工作成果。W3C对RFC 7303具有变更控制权。

9.6. The '+xml' Naming Convention for XML-Based Media Types
9.6. 基于xml的媒体类型的“+xml”命名约定

This section supersedes the earlier registration of the '+xml' suffix [RFC6839].

本节取代先前注册的“+xml”后缀[RFC6839]。

This specification recommends the use of the '+xml' naming convention for identifying XML-based media types, in line with the recognition in [RFC6838] of structured syntax name suffixes. This allows the use of generic XML processors and technologies on a wide variety of different XML document types at a minimum cost, using existing frameworks for media type registration.

本规范建议使用“+xml”命名约定来标识基于xml的媒体类型,与[RFC6838]中对结构化语法名称后缀的识别一致。这允许使用现有的媒体类型注册框架,以最低的成本在各种不同的XML文档类型上使用通用XML处理器和技术。

See Section 4.2 for guidance on when and how to register a media subtype that is '+xml' based, and Section 4.3 on registering a media subtype for XML but _not_ using '+xml'.

有关何时以及如何注册基于“+xml”的媒体子类型的指南,请参见第4.2节;有关注册xml但不使用“+xml”的媒体子类型的指南,请参见第4.3节。

9.6.1. The '+xml' Structured Syntax Suffix Registration
9.6.1. “+xml”结构化语法后缀注册

Name: Extensible Markup Language (XML)

名称:可扩展标记语言(XML)

   +suffix:  +xml
        
   +suffix:  +xml
        

Reference: RFC 7303

参考:RFC 7303

Encoding considerations: Same as Section 9.1.

编码注意事项:与第9.1节相同。

Fragment identifier considerations: Registrations that use this '+xml' convention MUST also make reference to this document, specifically Section 5, in specifying fragment identifier syntax

片段标识符注意事项:使用此“+xml”约定的注册还必须在指定片段标识符语法时参考本文档,特别是第5节

and semantics, and they MAY restrict the syntax to a specified subset of schemes, except that they MUST NOT disallow barenames or 'element' scheme pointers. They MAY further require support for other registered schemes. They also MAY add additional syntax (which MUST NOT overlap with [XPointerFramework] syntax) together with associated semantics, and they MAY add additional semantics for barename XPointers that, as provided for in Section 5, will only apply when this document does not define an interpretation.

和语义,它们可能会将语法限制为指定的方案子集,但它们不能禁止裸名称或“元素”方案指针。他们可能还需要其他注册计划的支持。他们还可以添加附加语法(不得与[XPointerFramework]语法重叠)和相关语义,并且他们可以为裸名XPointer添加附加语义,如第5节所述,这些语义仅在本文档未定义解释时适用。

In practice, these constraints imply that for a fragment identifier addressed to an instance of a specific "xxx/yyy+xml" type, there are three cases:

实际上,这些约束意味着对于寻址到特定“xxx/yyy+xml”类型实例的片段标识符,有三种情况:

For fragment identifiers matching the syntax defined in [XPointerFramework], where the fragment identifier resolves per the rules specified there, then process as specified there;

对于与[XPointerFramework]中定义的语法匹配的片段标识符,其中片段标识符根据此处指定的规则进行解析,然后按照此处指定的规则进行处理;

For fragment identifiers matching the syntax defined in [XPointerFramework], where the fragment identifier does _not_ resolve per the rules specified there, then process as specified in "xxx/yyy+xml";

对于与[xpointerframew]中定义的语法匹配的片段标识符,如果片段标识符没有按照此处指定的规则解析,则按照“xxx/yyy+xml”中的指定进行处理;

For fragment identifiers _not_ matching the syntax defined in [XPointerFramework], then process as specified in "xxx/ yyy+xml". A fragment identifier of the form "xywh=160,120,320,240", as defined in [MediaFrags], which might be used in a URI for an XML-encoded image, would fall in this category.

对于与[xpointerframew]中定义的语法不匹配的片段标识符,则按照“xxx/yyy+xml”中的指定进行处理。[MediaFrags]中定义的形式为“xywh=160120320240”的片段标识符可能用于XML编码图像的URI中,属于此类。

Interoperability considerations: Same as Section 9.1. See above, and also Section 3, for guidelines on the use of the 'charset' parameter.

互操作性注意事项:与第9.1节相同。有关“charset”参数的使用指南,请参见上文和第3节。

Security considerations: See Section 10.

安全注意事项:见第10节。

Contact: See Authors' Addresses section.

联系方式:参见作者地址部分。

Author: See Authors' Addresses section.

作者:参见作者地址部分。

Change controller: The XML specification is a work product of the World Wide Web Consortium's XML Core Working Group. The W3C has change control over RFC 7303.

变更控制者:XML规范是万维网联盟XML核心工作组的工作成果。W3C对RFC 7303具有变更控制权。

10. Security Considerations
10. 安全考虑

XML MIME entities contain information that may be parsed and further processed by the recipient. These entities may contain, and recipients may permit, explicit system level commands to be executed while processing the data. To the extent that a recipient application executes arbitrary command strings from within XML MIME entities, they may be at risk.

XML MIME实体包含收件人可以解析和进一步处理的信息。这些实体可能包含并且接收者可能允许在处理数据时执行显式系统级命令。如果收件人应用程序从XML MIME实体中执行任意命令字符串,则可能会有风险。

In general, any information stored outside of the direct control of the user -- including CSS style sheets, XSL transformations, XML-entity declarations, and DTDs -- can be a source of insecurity, by either obvious or subtle means. For example, a tiny "whiteout attack" modification made to a "master" style sheet could make words in critical locations disappear in user documents, without directly modifying the user document or the stylesheet it references. Thus, the security of any XML document is vitally dependent on all of the documents recursively referenced by that document.

一般来说,任何存储在用户直接控制之外的信息——包括CSS样式表、XSL转换、XML实体声明和DTD——都可能通过明显或微妙的方式成为不安全的根源。例如,对“主”样式表进行微小的“白化攻击”修改可能会使关键位置的单词在用户文档中消失,而不会直接修改用户文档或其引用的样式表。因此,任何XML文档的安全性在很大程度上取决于该文档递归引用的所有文档。

The XML-entity lists and DTDs for XHTML 1.0 [XHTML], for instance, are likely to be a widely exploited set of resources. They will be used and trusted by many developers, few of whom will know much about the level of security on the W3C's servers, or on any similarly trusted repository.

例如,XHTML1.0[XHTML]的XML实体列表和DTD可能是一组被广泛利用的资源。它们将被许多开发人员使用和信任,其中很少有人知道W3C服务器或任何类似可信存储库上的安全级别。

The simplest attack involves adding declarations that break validation. Adding extraneous declarations to a list of character XML-entities can effectively "break the contract" used by documents. A tiny change that produces a fatal error in a DTD could halt XML processing on a large scale. Extraneous declarations are fairly obvious, but more sophisticated tricks, like changing attributes from being optional to required, can be difficult to track down. Perhaps the most dangerous option available to attackers, when external DTD subsets or external parameter entities or other externally specified defaulting is involved, is redefining default values for attributes: for example, if developers have relied on defaulted attributes for security, a relatively small change might expose enormous quantities of information.

最简单的攻击包括添加破坏验证的声明。向字符XML实体列表中添加无关声明可以有效地“破坏文档使用的契约”。在DTD中产生致命错误的微小更改可能会大规模停止XML处理。无关的声明是相当明显的,但更复杂的技巧,如将属性从可选更改为必需,可能很难找到。当涉及外部DTD子集或外部参数实体或其他外部指定的默认值时,攻击者可用的最危险选项可能是重新定义属性的默认值:例如,如果开发人员依赖默认属性进行安全保护,相对较小的更改可能会暴露大量信息。

Apart from the structural possibilities, another option, "XML-entity spoofing," can be used to insert text into documents, vandalizing and perhaps conveying an unintended message. Because XML permits multiple XML-entity declarations, and the first declaration takes precedence, it is possible to insert malicious content where an XML-entity reference is used, such as by inserting the full text of Winnie the Pooh in place of every occurrence of &mdash;.

除了结构上的可能性之外,还可以使用另一个选项“XML实体欺骗”,将文本插入文档中,破坏文档,或者传递非预期的消息。因为XML允许多个XML实体声明,并且第一个声明优先,所以在使用XML实体引用的地方插入恶意内容是可能的,例如插入Winnie the Pooh的全文来代替每次出现的&mdash;。

Security considerations will vary by domain of use. For example, XML medical records will have much more stringent privacy and security considerations than XML library metadata. Similarly, use of XML as a parameter marshalling syntax necessitates a case by case security review.

安全注意事项因使用领域而异。例如,XML医疗记录比XML库元数据具有更严格的隐私和安全考虑。类似地,使用XML作为参数编组语法需要逐案进行安全审查。

XML may also have some of the same security concerns as plain text. Like plain text, XML can contain escape sequences that, when displayed, have the potential to change the display processor environment in ways that adversely affect subsequent operations. Possible effects include, but are not limited to, locking the keyboard, changing display parameters so subsequent displayed text is unreadable, or even changing display parameters to deliberately obscure or distort subsequent displayed material so that its meaning is lost or altered. Display processors SHOULD either filter such material from displayed text or else make sure to reset all important settings after a given display operation is complete.

XML可能也有一些与纯文本相同的安全问题。与纯文本一样,XML可以包含转义序列,当显示该序列时,可能会以对后续操作产生不利影响的方式更改显示处理器环境。可能的影响包括但不限于锁定键盘、更改显示参数以使后续显示的文本不可读,甚至更改显示参数以故意模糊或扭曲后续显示的材料,从而使其含义丢失或改变。显示处理器应该从显示的文本中过滤这些内容,或者确保在给定的显示操作完成后重置所有重要设置。

With some terminal devices, sending particular character sequences to the display processor can change the output of subsequent key presses. If this is possible the display of a text object containing such character sequences could reprogram keys to perform some illicit or dangerous action when the key is subsequently pressed by the user. In some cases not only can keys be programmed, they can be triggered remotely, making it possible for a text display operation to directly perform some unwanted action. As such, the ability to program keys SHOULD be blocked either by filtering or by disabling the ability to program keys entirely.

对于某些终端设备,向显示处理器发送特定字符序列可以更改后续按键的输出。如果这是可能的,当用户随后按下键时,包含此类字符序列的文本对象的显示可能会重新编程键以执行一些非法或危险的操作。在某些情况下,不仅可以对按键进行编程,还可以远程触发按键,使文本显示操作能够直接执行一些不需要的操作。因此,应通过过滤或完全禁用密钥编程功能来阻止密钥编程功能。

Note that it is also possible to construct XML documents that make use of what XML terms "[XML-]entity references" to construct repeated expansions of text. Recursive expansions are prohibited by [XML] and XML processors are required to detect them. However, even non-recursive expansions may cause problems with the finite computing resources of computers, if they are performed many times. For example, consider the case where XML-entity A consists of 100 copies of XML-entity B, which in turn consists of 100 copies of XML-entity C, and so on.

请注意,还可以使用XML术语“[XML-]实体引用”来构造XML文档,以构造文本的重复扩展。[XML]禁止递归扩展,需要XML处理器来检测它们。然而,即使是非递归扩展,如果执行多次,也可能会导致计算机有限计算资源的问题。例如,考虑XML实体A由XML实体B的100个副本组成的情况,而XML实体B又由XML实体C的100个副本组成,等等。

11. References
11. 工具书类
11.1. Normative References
11.1. 规范性引用文件

[IANA-CHARSETS] IANA, "Character Sets Registry", 2013, <http://www.iana.org/assignments/character-sets/>.

[IANA-CHARSETS]IANA,“字符集注册表”,2013年<http://www.iana.org/assignments/character-sets/>.

[RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996.

[RFC2045]Freed,N.和N.Borenstein,“多用途Internet邮件扩展(MIME)第一部分:Internet邮件正文格式”,RFC 20451996年11月。

[RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, November 1996.

[RFC2046]Freed,N.和N.Borenstein,“多用途Internet邮件扩展(MIME)第二部分:媒体类型”,RFC 20461996年11月。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC2781] Hoffman, P. and F. Yergeau, "UTF-16, an encoding of ISO 10646", RFC 2781, February 2000.

[RFC2781]Hoffman,P.和F.Yergeau,“UTF-16,ISO 10646编码”,RFC 2781,2000年2月。

[RFC2978] Freed, N. and J. Postel, "IANA Charset Registration Procedures", BCP 19, RFC 2978, October 2000.

[RFC2978]Freed,N.和J.Postel,“IANA字符集注册程序”,BCP 19,RFC 2978,2000年10月。

[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005.

[RFC3986]Berners Lee,T.,Fielding,R.,和L.Masinter,“统一资源标识符(URI):通用语法”,STD 66,RFC 3986,2005年1月。

[RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005.

[RFC3987]Duerst,M.和M.Suignard,“国际化资源标识符(IRIs)”,RFC 3987,2005年1月。

[RFC6657] Melnikov, A. and J. Reschke, "Update to MIME regarding "charset" Parameter Handling in Textual Media Types", RFC 6657, July 2012.

[RFC6657]Melnikov,A.和J.Reschke,“关于文本媒体类型中“字符集”参数处理的MIME更新”,RFC 6657,2012年7月。

[RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type Specifications and Registration Procedures", BCP 13, RFC 6838, January 2013.

[RFC6838]Freed,N.,Klensin,J.和T.Hansen,“媒体类型规范和注册程序”,BCP 13,RFC 6838,2013年1月。

[RFC6839] Hansen, T. and A. Melnikov, "Additional Media Type Structured Syntax Suffixes", RFC 6839, January 2013.

[RFC6839]Hansen,T.和A.Melnikov,“其他媒体类型结构化语法后缀”,RFC 6839,2013年1月。

[RFC7230] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, June 2014.

[RFC7230]Fielding,R.和J.Reschke,“超文本传输协议(HTTP/1.1):消息语法和路由”,RFC 7230,2014年6月。

[RFC7231] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, June 2014.

[RFC7231]Fielding,R.和J.Reschke,“超文本传输协议(HTTP/1.1):语义和内容”,RFC 72312014年6月。

[UNICODE] The Unicode Consortium, "The Unicode Standard, Version 7.0.0", (Mountain View, CA: The Unicode Consortium, 2014 ISBN 978-1-936213-09-2), <http://www.unicode.org/versions/Unicode7.0.0/>.

[UNICODE]UNICODE联盟,“UNICODE标准,7.0.0版”(加利福尼亚州山景城:UNICODE联盟,2014年ISBN 978-1-936213-09-2)<http://www.unicode.org/versions/Unicode7.0.0/>.

[XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", W3C Recommendation REC-xml, November 2008, <http://www.w3.org/TR/2008/REC-xml-20081126/>.

[XML]Bray,T.,Paoli,J.,Sperberg McQueen,C.,Maler,E.,和F.Yergeau,“可扩展标记语言(XML)1.0(第五版)”,W3C建议REC XML,2008年11月<http://www.w3.org/TR/2008/REC-xml-20081126/>.

Latest version available at <http://www.w3.org/TR/xml>.

最新版本可于<http://www.w3.org/TR/xml>.

[XML1.1] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., Yergeau, F., and J. Cowan, "Extensible Markup Language (XML) 1.1 (Second Edition)", W3C Recommendation REC-xml, September 2006, <http://www.w3.org/TR/2006/REC-xml11-20060816/>.

[XML1.1]Bray,T.,Paoli,J.,Sperberg McQueen,C.,Maler,E.,Yergeau,F.,和J.Cowan,“可扩展标记语言(XML)1.1(第二版)”,W3C建议REC XML,2006年9月<http://www.w3.org/TR/2006/REC-xml11-20060816/>.

Latest version available at <http://www.w3.org/TR/xml11>.

最新版本可于<http://www.w3.org/TR/xml11>.

[XMLBase] Marsh, J. and R. Tobin, "XML Base (Second Edition)", W3C Recommendation REC-xmlbase-20090128, January 2009, <http://www.w3.org/TR/2009/REC-xmlbase-20090128/>.

[XMLBase]Marsh,J.和R.Tobin,“XML库(第二版)”,W3C建议REC-XMLBase-20090128,2009年1月<http://www.w3.org/TR/2009/REC-xmlbase-20090128/>.

Latest version available at <http://www.w3.org/TR/xmlbase>.

最新版本可于<http://www.w3.org/TR/xmlbase>.

[XPointerElement] Grosso, P., Maler, E., Marsh, J., and N. Walsh, "XPointer element() Scheme", W3C Recommendation REC-XPointer-Element, March 2003, <http://www.w3.org/TR/2003/REC-xptr-element-20030325/>.

[XPointerElement]Grosso,P.,Maler,E.,Marsh,J.,和N.Walsh,“XPointer元素()方案”,W3C建议REC XPointer元素,2003年3月<http://www.w3.org/TR/2003/REC-xptr-element-20030325/>.

Latest version available at <http://www.w3.org/TR/xptr-element>.

最新版本可于<http://www.w3.org/TR/xptr-element>.

[XPointerFramework] Grosso, P., Maler, E., Marsh, J., and N. Walsh, "XPointer Framework", W3C Recommendation REC-XPointer-Framework, March 2003, <http://www.w3.org/TR/2003/REC-xptr-framework-20030325/>.

[XPointerFramework]Grosso,P.,Maler,E.,Marsh,J.,和N.Walsh,“XPointer框架”,W3C建议REC XPointer框架,2003年3月<http://www.w3.org/TR/2003/REC-xptr-framework-20030325/>.

Latest version available at <http://www.w3.org/TR/xptr-framework>.

最新版本可于<http://www.w3.org/TR/xptr-framework>.

[XPtrReg] Hazael-Massieux, D., "XPointer Registry", 2005, <http://www.w3.org/2005/04/xpointer-schemes/>.

[XPtrReg]Hazael Massieux,D.,“XPointer注册表”,2005年<http://www.w3.org/2005/04/xpointer-schemes/>.

[XPtrRegPolicy] Hazael-Massieux, D., "XPointer Scheme Name Registry Policy", 2005, <http://www.w3.org/2005/04/xpointer-policy.html>.

[XPtrRegPolicy]Hazael Massieux,D.,“XPointer方案名称注册政策”,2005年<http://www.w3.org/2005/04/xpointer-policy.html>.

11.2. Informative References
11.2. 资料性引用

[ASCII] American National Standards Institute, "Coded Character Set -- 7-bit American Standard Code for Information Interchange", ANSI X3.4, 1986.

[ASCII]美国国家标准协会,“编码字符集——信息交换用7位美国标准代码”,ANSI X3.41986。

[AWWW] Jacobs, I. and N. Walsh, "Architecture of the World Wide Web, Volume One", W3C Recommendation REC-webarch-20041215, December 2004, <http://www.w3.org/TR/2004/REC-webarch-20041215/>.

[AWWW]Jacobs,I.和N.Walsh,“万维网的体系结构,第一卷”,W3C建议REC-webarch-20041215,2004年12月<http://www.w3.org/TR/2004/REC-webarch-20041215/>.

Latest version available at <http://www.w3.org/TR/webarch>.

最新版本可于<http://www.w3.org/TR/webarch>.

[FYN] Mendelsohn, N., "The Self-Describing Web", W3C TAG Finding selfDescribingDocuments-2009-02-07, February 2009, <http://www.w3.org/2001/tag/doc/ selfDescribingDocuments-2009-02-07.html>.

[FYN]Mendelsohn,N.,“自我描述的网络”,W3C标签查找自我描述文档-2009-02-072009年2月<http://www.w3.org/2001/tag/doc/ selfdescripingdocuments-2009-02-07.html>。

              Latest version available at
              <http://www.w3.org/2001/tag/doc/
              selfDescribingDocuments.html>
        
              Latest version available at
              <http://www.w3.org/2001/tag/doc/
              selfDescribingDocuments.html>
        

[Infoset] Cowan, J. and R. Tobin, "XML Information Set (Second Edition)", W3C Recommendation REC-xml-infoset-20040204, Febuary 2004, <http://www.w3.org/TR/2004/REC-xml-infoset-20040204/>.

[Infoset]Cowan,J.和R.Tobin,“XML信息集(第二版)”,W3C建议REC-XML-Infoset-20040204,2004年2月<http://www.w3.org/TR/2004/REC-xml-infoset-20040204/>.

Latest version available at <http://www.w3.org/TR/xml-infoset/>.

最新版本可于<http://www.w3.org/TR/xml-infoset/>.

[MediaFrags] Troncy, R., Mannens, E., Pfeiffer, S., and D. Van Deursen, "Media Fragments URI 1.0 (basic)", W3C Recommendation media-frags, September 2012, <http://www.w3.org/TR/2012/REC-media-frags-20120925/>.

[MediaFrags]Troncy,R.,Mannens,E.,Pfeiffer,S.,和D.Van Deursen,“媒体碎片URI 1.0(基本)”,W3C推荐媒体碎片,2012年9月<http://www.w3.org/TR/2012/REC-media-frags-20120925/>.

Latest version available at <http://www.w3.org/TR/media-frags>.

最新版本可于<http://www.w3.org/TR/media-frags>.

[RFC1557] Choi, U., Chon, K., and H. Park, "Korean Character Encoding for Internet Messages", RFC 1557, December 1993.

[RFC1557]Choi,U.,Chon,K.,和H.Park,“互联网信息的韩文字符编码”,RFC 15571993年12月。

[RFC2376] Whitehead, E. and M. Murata, "XML Media Types", RFC 2376, July 1998.

[RFC2376]Whitehead,E.和M.Murata,“XML媒体类型”,RFC23761998年7月。

[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.

[RFC2616]菲尔丁,R.,盖蒂斯,J.,莫卧儿,J.,弗莱斯蒂克,H.,马斯特,L.,利奇,P.,和T.伯纳斯李,“超文本传输协议——HTTP/1.1”,RFC 2616,1999年6月。

[RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media Types", RFC 3023, January 2001.

[RFC3023]Murata,M.,St.Laurent,S.,和D.Kohn,“XML媒体类型”,RFC 3023,2001年1月。

[RFC3030] Vaudreuil, G., "SMTP Service Extensions for Transmission of Large and Binary MIME Messages", RFC 3030, December 2000.

[RFC3030]Vaudreuil,G.“用于传输大型和二进制MIME消息的SMTP服务扩展”,RFC 3030,2000年12月。

[RFC3977] Feather, C., "Network News Transfer Protocol (NNTP)", RFC 3977, October 2006.

[RFC3977]Feather,C.,“网络新闻传输协议(NNTP)”,RFC3977,2006年10月。

[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, May 2008.

[RFC5226]Narten,T.和H.Alvestrand,“在RFCs中编写IANA注意事项部分的指南”,BCP 26,RFC 5226,2008年5月。

[RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, October 2008.

[RFC5321]Klensin,J.,“简单邮件传输协议”,RFC 53212008年10月。

[RFC6152] Klensin, J., Freed, N., Rose, M., and D. Crocker, "SMTP Service Extension for 8-bit MIME Transport", STD 71, RFC 6152, March 2011.

[RFC6152]Klensin,J.,Freed,N.,Rose,M.,和D.Crocker,“8位MIME传输的SMTP服务扩展”,STD 71,RFC 6152,2011年3月。

[Sivonen] Sivonen, H. and others, "Mozilla bug: Remove support for UTF-32 per HTML5 spec", October 2011, <https://bugzilla.mozilla.org/show_bug.cgi?id=604317#c6>.

[Sivonen]Sivonen,H.和其他人,“Mozilla bug:根据HTML5规范删除对UTF-32的支持”,2011年10月<https://bugzilla.mozilla.org/show_bug.cgi?id=604317#c6>.

[TAGMIME] Bray, T., Ed., "Internet Media Type registration, consistency of use", April 2004, <http://www.w3.org/2001/tag/2004/0430-mime>.

[TAGMIME]Bray,T.,Ed.“互联网媒体类型注册,使用一致性”,2004年4月<http://www.w3.org/2001/tag/2004/0430-mime>.

[XHTML] Pemberton, S. and et al, "XHTML 1.0: The Extensible HyperText Markup Language", W3C Recommendation xhtml1, December 1999, <http://www.w3.org/TR/2000/REC-xhtml1-20000126/>.

[XHTML]Pemberton,S.和等人,“XHTML 1.0:可扩展超文本标记语言”,W3C建议xhtml1,1999年12月<http://www.w3.org/TR/2000/REC-xhtml1-20000126/>.

Latest version available at <http://www.w3.org/TR/xhtml1>.

最新版本可于<http://www.w3.org/TR/xhtml1>.

[XMLModel] Grosso, P. and J. Kosek, "Associating Schemas with XML documents 1.0 (Third Edition)", W3C Working Group Note NOTE-xml-model-20121009, October 2012, <http://www.w3.org/TR/2012/NOTE-xml-model-20121009/>.

[XMLModel]Grosso,P.和J.Kosek,“将模式与XML文档1.0相关联(第三版)”,W3C工作组注释Note-XML-model-201210009,2012年10月<http://www.w3.org/TR/2012/NOTE-xml-model-20121009/>.

Latest version available at <http://www.w3.org/TR/xml-model>.

最新版本可于<http://www.w3.org/TR/xml-model>.

[XMLNS10] Bray, T., Hollander, D., Layman, A., Tobin, R., and H. Thompson, "Namespaces in XML 1.0 (Third Edition)", W3C Recommendation REC-xml-names-20091208, December 2009, <http://www.w3.org/TR/2009/REC-xml-names-20091208/>.

[XMLNS10]Bray,T.,Hollander,D.,Layman,A.,Tobin,R.,和H.Thompson,“XML 1.0中的名称空间(第三版)”,W3C建议REC-XML-names-20091208,2009年12月<http://www.w3.org/TR/2009/REC-xml-names-20091208/>.

Latest version available at <http://www.w3.org/TR/xml-names>.

最新版本可于<http://www.w3.org/TR/xml-names>.

[XMLNS11] Bray, T., Hollander, D., Layman, A., and R. Tobin, "Namespaces in XML 1.1 (Second Edition)", W3C Recommendation REC-xml-names11-20060816, August 2006, <http://www.w3.org/TR/2006/REC-xml-names11-20060816/>.

[XMLNS11]Bray,T.,Hollander,D.,Layman,A.,和R.Tobin,“XML 1.1中的名称空间(第二版)”,W3C建议REC-XML-names11-20060816,2006年8月<http://www.w3.org/TR/2006/REC-xml-names11-20060816/>.

Latest version available at <http://www.w3.org/TR/xml-names11>.

最新版本可于<http://www.w3.org/TR/xml-names11>.

[XMLSS] Clark, J., Pieters, S., and H. Thompson, "Associating Style Sheets with XML documents 1.0 (Second Edition)", W3C Recommendation REC-xml-stylesheet-20101028, October 2010, <http://www.w3.org/TR/2010/REC-xml-stylesheet-20101028/>.

[XMLSS]Clark,J.,Pieters,S.,和H.Thompson,“将样式表与XML文档1.0相关联(第二版)”,W3C建议REC-XML-stylesheet-20101028,2010年10月<http://www.w3.org/TR/2010/REC-xml-stylesheet-20101028/>.

Latest version available at <http://www.w3.org/TR/xml-stylesheet>.

最新版本可于<http://www.w3.org/TR/xml-stylesheet>.

[XMLid] Marsh, J., Veillard, D., and N. Walsh, "xml:id Version 1.0", W3C Recommendation REC-xml-id-20050909, September 2005, <http://www.w3.org/TR/2005/REC-xml-id-20050909/>.

[XMLid]Marsh,J.,Veillard,D.,和N.Walsh,“xml:id版本1.0”,W3C建议REC-xml-id-20050909,2005年9月<http://www.w3.org/TR/2005/REC-xml-id-20050909/>.

Latest version available at <http://www.w3.org/TR/xml-id>.

最新版本可于<http://www.w3.org/TR/xml-id>.

Appendix A. Why Use the '+xml' Suffix for XML-Based MIME Types?

附录A.为什么对基于xml的MIME类型使用“+xml”后缀?

[RFC3023] contains a detailed discussion of the (at the time) novel use of a suffix, a practice that has since become widespread. Those interested in a historical perspective on this topic are referred to [RFC3023], Appendix A.

[RFC3023]详细讨论了(当时)后缀的新颖用法,这一做法后来变得很普遍。对该主题的历史观点感兴趣的人士请参考附录a中的[RFC3023]。

The registration process for new '+xml' media types is described in [RFC6838].

[RFC6838]中描述了新“+xml”媒体类型的注册过程。

Appendix B. Core XML Specifications
附录B.核心XML规范

The following specifications each articulate key aspects of XML document semantics:

以下规范分别阐述了XML文档语义的关键方面:

Namespaces in XML 1.0 [XMLNS10]/Namespaces in XML 1.1 [XMLNS11]

XML 1.0[XMLNS10]中的名称空间/XML 1.1[XMLNS11]中的名称空间

XML Information Set [Infoset]

XML信息集[信息集]

xml:id [XMLid]

xml:id[XMLid]

XML Base [XMLBase]

XMLBase[XMLBase]

Associating Style Sheets with XML documents [XMLSS]

将样式表与XML文档关联[XMLSS]

Associating Schemas with XML documents [XMLModel]

将模式与XML文档关联[XMLModel]

The W3C Technical Architecture group has produced two documents that are also relevant:

W3C技术架构(Technical Architecture)小组编制了两份同样相关的文件:

The Self-Describing Web [FYN] discusses the overall principles of how document semantics are determined on the Web.

自描述Web[FYN]讨论了如何在Web上确定文档语义的总体原则。

Architecture of the World Wide Web, Volume One [AWWW], Section 4.5.4, discusses the specific role of XML Namespace documents in this process.

《万维网体系结构》,第一卷[AWWW],第4.5.4节,讨论了XML名称空间文档在此过程中的具体作用。

Appendix C. Operational Considerations
附录C.业务考虑

This section provides an informal summary of the major operational considerations that arise when exchanging XML MIME entities over a network.

本节非正式总结了在网络上交换XML MIME实体时出现的主要操作注意事项。

C.1. General Considerations
C.1. 一般考虑

The existence of both XML-aware and XML-unaware agents handling XML MIME entities can compromise introperability. Generic transcoding proxies pose a particular risk in this regard. Detailed advice about the handling of BOMs when transcoding can be found in Section 3.3.

处理XML MIME实体的XML感知和XML不感知代理的存在可能会损害可插入性。在这方面,通用转码代理带来了特殊的风险。有关转码时BOM处理的详细建议,请参见第3.3节。

This specification requires XML consumers to treat BOMs as authoritative: this is in principle a backwards-incompatibility. In practice, serious interoperability issues already exist when BOMs are used. Making BOMs authoritative, in conjunction with the deprecation of the UTF-32 encoding form and the requirement to include an XML encoding declaration in certain cases (Section 3.1), is intended to improve in-practice interoperability as much as possible over time.

该规范要求XML使用者将BOM视为权威:原则上这是向后不兼容。实际上,使用BOM时已经存在严重的互操作性问题。使BOM具有权威性,再加上对UTF-32编码格式的反对,以及在某些情况下包含XML编码声明的要求(第3.1节),旨在随着时间的推移尽可能提高实践中的互操作性。

This specification establishes Section 5 as the basis for interpreting URIs for XML MIME entities that include fragment identifiers, mandates support only for shorthand ("simple name") and 'element'-scheme fragments and deprecates support for unregistered XPointer schemes by XML MIME entity processors. Accordingly, URIs will interoperate best if they use only simple names and 'element'- scheme fragment identifiers, with registered schemes varying widely in the degree of support to be found in generic tools. XPointer scheme authors can only expect generic tool support if they register their schemes.

本规范将第5节作为解释包含片段标识符的XML MIME实体的URI的基础,规定仅支持速记(“简单名称”)和“元素”-方案片段,并禁止XML MIME实体处理器支持未注册的XPointer方案。因此,如果URI只使用简单的名称和“元素”——方案片段标识符,那么它们的互操作性最好,注册的方案在通用工具中的支持程度差别很大。XPointer方案的作者只有在注册其方案时才能期望得到通用工具的支持。

C.2. Considerations for Producers
C.2. 对生产者的考虑

Interoperability for all XML MIME entities is maximized by the use of UTF-8, without a BOM. When UTF-8 is _not_ used, a charset parameter and/or a BOM improve interoperability, particularly when XML-unaware consumers may be involved.

通过使用UTF-8,所有XML MIME实体的互操作性都得到了最大化,而无需BOM。当不使用UTF-8时,字符集参数和/或BOM会提高互操作性,特别是当可能涉及不知道XML的使用者时。

In the very rare case where the substantive content of a non-UNICODE XML external parsed entity begins with the hexadecimal octet sequences 0xFE 0xFF, 0xFF 0xFE or 0xEF 0xBB 0xBF, including an XML text declaration will forestall the mistaken detection of a BOM.

在非常罕见的情况下,非UNICODE XML外部解析实体的实质内容以十六进制八位字节序列0xFE 0xFF、0xFF 0xFE或0xEF 0xBB 0xBF开头,包括XML文本声明将防止错误检测BOM。

The use of UTF-32 for XML MIME entities puts interoperability at very high risk.

对XML MIME实体使用UTF-32会使互操作性面临非常高的风险。

Web-server configurations that supply default charset parameters risk misrepresenting XML MIME entities. Allowing users to control the value of charset parameters improves interoperability.

提供默认字符集参数的Web服务器配置存在误报XML MIME实体的风险。允许用户控制字符集参数的值可以提高互操作性。

Supplying a mistaken charset parameter is worse than supplying none at all. In particular, generic processors such as transcoders, when processing based on a mistaken charset parameter, if they do not fail altogether are likely to produce arbitrarily bogus results from which the original is not recoverable.

提供错误的字符集参数比完全不提供更糟糕。特别是,通用处理器(如转码器)在基于错误的字符集参数进行处理时,如果它们没有完全失败,则可能会产生任意虚假的结果,原始结果无法从中恢复。

C.3. Considerations for Consumers
C.3. 对消费者的考虑

Consumers of XML MIME entities can maximize interoperability by

XML MIME实体的使用者可以通过

1. Taking a BOM as authoritative if it is present in an XML MIME entity;

1. 如果BOM存在于XML MIME实体中,则将其视为权威BOM;

2. In the absence of a BOM, taking a charset parameter as authoritative if it is present.

2. 在没有BOM表的情况下,如果存在字符集参数,则将其作为权威参数。

Assuming a default character encoding in the absence of a charset parameter harms interoperability.

在没有字符集参数的情况下假设默认字符编码会损害互操作性。

Although support for UTF-32 is not required by [XML] itself, and this specification deprecates its use, consumers that check for UTF-32 BOMs can thereby avoid mistakenly processing UTF-32 entities as (invalid) UTF-16 entities.

尽管[XML]本身不需要对UTF-32的支持,并且本规范不推荐使用UTF-32 BOM,但检查UTF-32 BOM的使用者可以避免将UTF-32实体误认为(无效)UTF-16实体。

Appendix D. Changes from RFC 3023
附录D.RFC 3023的变更

There are numerous and significant differences between this specification and [RFC3023], which it obsoletes. This appendix summarizes the major differences only.

本规范与[RFC3023]之间存在许多重大差异,已被淘汰。本附录仅总结了主要差异。

XPointer ([XPointerFramework] and [XPointerElement]) has been added as fragment identifier syntax for all the XML media types, and the XPointer Registry ([XPtrReg]) mentioned

XPointer([XPointerFramework]和[XPointerElement])已添加为所有XML媒体类型的片段标识符语法,以及前面提到的XPointer注册表([XPtrReg])

[XMLBase] has been added as a mechanism for specifying base URIs

[XMLBase]已添加为指定基本URI的机制

The language regarding character sets was updated to correspond to the W3C TAG finding Internet Media Type registration, consistency of use [TAGMIME]

有关字符集的语言已更新,以符合W3C标记查找Internet媒体类型注册、使用一致性[TAGMIME]

Priority is now given to a BOM if present

现在,BOM表(如果存在)具有优先权

Many references are updated, and the existence of XML 1.1 and relevance of this specification to it acknowledged

许多参考文献都已更新,XML 1.1的存在以及本规范与之的相关性已得到确认

A number of justifications and contextualizations that were appropriate when XML was new have been removed, including the whole of the original Appendix A

当XML是新的时,许多合适的理由和上下文已经被删除,包括原始附录A的全部内容

Appendix E. Acknowledgements
附录E.确认书

MURATA Makoto (FAMILY Given) and Alexey Melnikov made early and important contributions to the effort to revise [RFC3023].

MURATA Makoto(家族成员)和Alexey Melnikov对修订[RFC3023]的努力做出了早期和重要的贡献。

This specification reflects the input of numerous participants to the ietf-xml-mime@imc.org, xml-mime@ietf.org, and apps-discuss@ietf.org mailing lists, though any errors are the responsibility of the authors. Special thanks to:

本规范反映了众多参与者对ietf xml的输入-mime@imc.org,xml-mime@ietf.org、和应用程序-discuss@ietf.org邮件列表,尽管任何错误都是作者的责任。特别感谢:

Mark Baker, James Clark, Dan Connolly, Martin Duerst, Ned Freed, Yaron Goland, Bjoern Hoehrmann, Rick Jelliffe, Murray S. Kucherawy, Larry Masinter, David Megginson, S. Moonesamy, Keith Moore, Chris Newman, Gavin Nicol, Julian Reschke, Marshall Rose, Jim Whitehead, Erik Wilde, and participants of the XML activity and the TAG at the W3C.

马克·贝克、詹姆斯·克拉克、丹·康诺利、马丁·杜尔斯、内德·弗里德、雅伦·戈兰、比约恩·霍尔曼、里克·杰利夫、默里·S·库奇拉维、拉里·马斯特、大卫·梅金森、S·穆内塞、基思·摩尔、克里斯·纽曼、加文·尼科尔、朱利安·雷什克、马歇尔·罗斯、吉姆·怀特海、埃里克·王尔德,以及W3C XML活动和标签的参与者。

Jim Whitehead and Simon St. Laurent were editors of [RFC2376] and [RFC3023], respectively.

Jim Whitehead和Simon St.Laurent分别是[RFC2376]和[RFC3023]的编辑。

Authors' Addresses

作者地址

Henry S. Thompson University of Edinburgh

亨利·S·汤普森爱丁堡大学

   EMail: ht@inf.ed.ac.uk
   URI:   http://www.ltg.ed.ac.uk/~ht/
        
   EMail: ht@inf.ed.ac.uk
   URI:   http://www.ltg.ed.ac.uk/~ht/
        

Chris Lilley World Wide Web Consortium 2004, Route des Lucioles - B.P. 93 06902 Sophia Antipolis Cedex France

Chris Lilley World Wide Web Consortium 2004,Route des Lucioles-B.P.93 06902 Sophia Antipolis Cedex法国

   EMail: chris@w3.org
   URI:   http://www.w3.org/People/chris/
        
   EMail: chris@w3.org
   URI:   http://www.w3.org/People/chris/