Internet Engineering Task Force (IETF)                          A. Bryan
Request for Comments: 5854                                  T. Tsujikawa
Category: Standards Track                                       N. McNab
ISSN: 2070-1721
                                                                P. Poeml
                                                             MirrorBrain
                                                               June 2010
        
Internet Engineering Task Force (IETF)                          A. Bryan
Request for Comments: 5854                                  T. Tsujikawa
Category: Standards Track                                       N. McNab
ISSN: 2070-1721
                                                                P. Poeml
                                                             MirrorBrain
                                                               June 2010
        

The Metalink Download Description Format

Metalink下载描述格式

Abstract

摘要

This document specifies Metalink, an XML-based download description format. Metalink describes download locations (mirrors), cryptographic hashes, and other information. Clients can transparently use this information to reliably transfer files.

此文档指定Metalink,一种基于XML的下载描述格式。Metalink描述下载位置(镜像)、加密哈希和其他信息。客户端可以透明地使用此信息可靠地传输文件。

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/rfc5854.

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

Copyright Notice

版权公告

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

版权所有(c)2010 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许可证中所述的无担保。

Table of Contents

目录

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
     1.1.  Examples . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.2.  Namespace and Version  . . . . . . . . . . . . . . . . . .  5
     1.3.  Notational Conventions . . . . . . . . . . . . . . . . . .  5
   2.  Metalink Documents . . . . . . . . . . . . . . . . . . . . . .  6
   3.  Common Metalink Constructs . . . . . . . . . . . . . . . . . .  7
     3.1.  Text Constructs  . . . . . . . . . . . . . . . . . . . . .  7
     3.2.  Date Constructs  . . . . . . . . . . . . . . . . . . . . .  8
   4.  Metalink Element Definitions . . . . . . . . . . . . . . . . .  8
     4.1.  Container Elements . . . . . . . . . . . . . . . . . . . .  8
       4.1.1.  The "metalink:metalink" Element  . . . . . . . . . . .  8
       4.1.2.  The "metalink:file" Element  . . . . . . . . . . . . .  9
       4.1.3.  The "metalink:pieces" Element  . . . . . . . . . . . . 12
     4.2.  Metadata Elements  . . . . . . . . . . . . . . . . . . . . 12
       4.2.1.  The "metalink:copyright" Element . . . . . . . . . . . 12
       4.2.2.  The "metalink:description" Element . . . . . . . . . . 13
       4.2.3.  The "metalink:generator" Element . . . . . . . . . . . 13
       4.2.4.  The "metalink:hash" Element  . . . . . . . . . . . . . 14
       4.2.5.  The "metalink:identity" Element  . . . . . . . . . . . 15
       4.2.6.  The "metalink:language" Element  . . . . . . . . . . . 15
       4.2.7.  The "metalink:logo" Element  . . . . . . . . . . . . . 16
       4.2.8.  The "metalink:metaurl" Element . . . . . . . . . . . . 16
       4.2.9.  The "metalink:origin" Element  . . . . . . . . . . . . 18
       4.2.10. The "metalink:os" Element  . . . . . . . . . . . . . . 18
       4.2.11. The "metalink:published" Element . . . . . . . . . . . 18
       4.2.12. The "metalink:publisher" Element . . . . . . . . . . . 18
       4.2.13. The "metalink:signature" Element . . . . . . . . . . . 19
       4.2.14. The "metalink:size" Element  . . . . . . . . . . . . . 20
       4.2.15. The "metalink:updated" Element . . . . . . . . . . . . 20
       4.2.16. The "metalink:url" Element . . . . . . . . . . . . . . 20
       4.2.17. The "metalink:version" Element . . . . . . . . . . . . 21
   5.  Extending Metalink . . . . . . . . . . . . . . . . . . . . . . 21
     5.1.  Extensions from Non-Metalink Vocabularies  . . . . . . . . 21
     5.2.  Extensions to the Metalink Vocabulary  . . . . . . . . . . 21
     5.3.  Processing Foreign Markup  . . . . . . . . . . . . . . . . 22
     5.4.  Extension Elements . . . . . . . . . . . . . . . . . . . . 22
       5.4.1.  Simple Extension Elements  . . . . . . . . . . . . . . 22
       5.4.2.  Structured Extension Elements  . . . . . . . . . . . . 23
   6.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 23
     6.1.  XML Namespace Registration . . . . . . . . . . . . . . . . 23
     6.2.  application/metalink4+xml MIME type  . . . . . . . . . . . 23
   7.  Security Considerations  . . . . . . . . . . . . . . . . . . . 24
     7.1.  Digital Signatures . . . . . . . . . . . . . . . . . . . . 25
     7.2.  URIs and IRIs  . . . . . . . . . . . . . . . . . . . . . . 26
     7.3.  Spoofing . . . . . . . . . . . . . . . . . . . . . . . . . 26
     7.4.  Cryptographic Hashes . . . . . . . . . . . . . . . . . . . 26
        
   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
     1.1.  Examples . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.2.  Namespace and Version  . . . . . . . . . . . . . . . . . .  5
     1.3.  Notational Conventions . . . . . . . . . . . . . . . . . .  5
   2.  Metalink Documents . . . . . . . . . . . . . . . . . . . . . .  6
   3.  Common Metalink Constructs . . . . . . . . . . . . . . . . . .  7
     3.1.  Text Constructs  . . . . . . . . . . . . . . . . . . . . .  7
     3.2.  Date Constructs  . . . . . . . . . . . . . . . . . . . . .  8
   4.  Metalink Element Definitions . . . . . . . . . . . . . . . . .  8
     4.1.  Container Elements . . . . . . . . . . . . . . . . . . . .  8
       4.1.1.  The "metalink:metalink" Element  . . . . . . . . . . .  8
       4.1.2.  The "metalink:file" Element  . . . . . . . . . . . . .  9
       4.1.3.  The "metalink:pieces" Element  . . . . . . . . . . . . 12
     4.2.  Metadata Elements  . . . . . . . . . . . . . . . . . . . . 12
       4.2.1.  The "metalink:copyright" Element . . . . . . . . . . . 12
       4.2.2.  The "metalink:description" Element . . . . . . . . . . 13
       4.2.3.  The "metalink:generator" Element . . . . . . . . . . . 13
       4.2.4.  The "metalink:hash" Element  . . . . . . . . . . . . . 14
       4.2.5.  The "metalink:identity" Element  . . . . . . . . . . . 15
       4.2.6.  The "metalink:language" Element  . . . . . . . . . . . 15
       4.2.7.  The "metalink:logo" Element  . . . . . . . . . . . . . 16
       4.2.8.  The "metalink:metaurl" Element . . . . . . . . . . . . 16
       4.2.9.  The "metalink:origin" Element  . . . . . . . . . . . . 18
       4.2.10. The "metalink:os" Element  . . . . . . . . . . . . . . 18
       4.2.11. The "metalink:published" Element . . . . . . . . . . . 18
       4.2.12. The "metalink:publisher" Element . . . . . . . . . . . 18
       4.2.13. The "metalink:signature" Element . . . . . . . . . . . 19
       4.2.14. The "metalink:size" Element  . . . . . . . . . . . . . 20
       4.2.15. The "metalink:updated" Element . . . . . . . . . . . . 20
       4.2.16. The "metalink:url" Element . . . . . . . . . . . . . . 20
       4.2.17. The "metalink:version" Element . . . . . . . . . . . . 21
   5.  Extending Metalink . . . . . . . . . . . . . . . . . . . . . . 21
     5.1.  Extensions from Non-Metalink Vocabularies  . . . . . . . . 21
     5.2.  Extensions to the Metalink Vocabulary  . . . . . . . . . . 21
     5.3.  Processing Foreign Markup  . . . . . . . . . . . . . . . . 22
     5.4.  Extension Elements . . . . . . . . . . . . . . . . . . . . 22
       5.4.1.  Simple Extension Elements  . . . . . . . . . . . . . . 22
       5.4.2.  Structured Extension Elements  . . . . . . . . . . . . 23
   6.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 23
     6.1.  XML Namespace Registration . . . . . . . . . . . . . . . . 23
     6.2.  application/metalink4+xml MIME type  . . . . . . . . . . . 23
   7.  Security Considerations  . . . . . . . . . . . . . . . . . . . 24
     7.1.  Digital Signatures . . . . . . . . . . . . . . . . . . . . 25
     7.2.  URIs and IRIs  . . . . . . . . . . . . . . . . . . . . . . 26
     7.3.  Spoofing . . . . . . . . . . . . . . . . . . . . . . . . . 26
     7.4.  Cryptographic Hashes . . . . . . . . . . . . . . . . . . . 26
        
   8.  References . . . . . . . . . . . . . . . . . . . . . . . . . . 27
     8.1.  Normative References . . . . . . . . . . . . . . . . . . . 27
     8.2.  Informative References . . . . . . . . . . . . . . . . . . 28
   Appendix A.  Acknowledgements and Contributors . . . . . . . . . . 30
   Appendix B.  RELAX NG Compact Schema . . . . . . . . . . . . . . . 31
   Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
        
   8.  References . . . . . . . . . . . . . . . . . . . . . . . . . . 27
     8.1.  Normative References . . . . . . . . . . . . . . . . . . . 27
     8.2.  Informative References . . . . . . . . . . . . . . . . . . 28
   Appendix A.  Acknowledgements and Contributors . . . . . . . . . . 30
   Appendix B.  RELAX NG Compact Schema . . . . . . . . . . . . . . . 31
   Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
        
1. Introduction
1. 介绍

Metalink is a document format based on Extensible Markup Language (XML) that describes a file or list of files to be downloaded from a server. Metalinks can list a number of files, each with an extensible set of attached metadata. Each listed file can have a description, multiple cryptographic hashes, and a list of Uniform Resource Identifiers (URIs) from which it is available.

Metalink是一种基于可扩展标记语言(XML)的文档格式,它描述了要从服务器下载的文件或文件列表。Metalinks可以列出许多文件,每个文件都有一组可扩展的附加元数据。每个列出的文件都可以有一个描述、多个加密哈希和一个统一资源标识符(URI)列表,从中可以使用该文件。

Often, identical copies of a file are accessible in multiple locations on the Internet over a variety of protocols, such as File Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), and Peer-to-Peer (P2P). In some cases, users are shown a list of these multiple download locations (mirror servers) and must manually select one based on geographical location, priority, or bandwidth. This is done to distribute the load across multiple servers, and to give human users the opportunity to choose a download location that they expect to work best for them.

通常,可以通过各种协议在Internet上的多个位置访问文件的相同副本,如文件传输协议(FTP)、超文本传输协议(HTTP)和对等(P2P)。在某些情况下,用户会看到这些多个下载位置(镜像服务器)的列表,并且必须根据地理位置、优先级或带宽手动选择一个。这样做是为了将负载分布到多个服务器上,并让用户有机会选择一个他们希望最适合自己的下载位置。

At times, individual servers can be slow, outdated, or unreachable, but this cannot be determined until the download has been initiated. This can lead to the user canceling the download and needing to restart it. During downloads, errors in transmission can corrupt the file. There are no easy ways to repair these files. For large downloads, this can be especially troublesome. Any of the number of problems that can occur during a download lead to frustration on the part of users, and bandwidth wasted with retransmission.

有时,个别服务器可能运行缓慢、过时或无法访问,但在启动下载之前无法确定这一点。这可能导致用户取消下载并需要重新启动。在下载过程中,传输错误会损坏文件。修复这些文件没有简单的方法。对于大型下载,这可能特别麻烦。下载过程中可能出现的任何问题都会导致用户感到沮丧,并导致带宽因重新传输而浪费。

Knowledge about availability of a download on mirror servers can be acquired and maintained by the operators of the origin server or by a third party. This knowledge, together with cryptographic hashes, digital signatures, and more, can be stored in a machine-readable Metalink file. The Metalink file can transfer this knowledge to the user agent, which can peruse it in automatic ways or present the information to a human user. User agents can fall back to alternate mirrors if the current one has an issue. Thereby, clients are enabled to work their way to a successful download under adverse circumstances. All this can be done transparently to the human user and the download is much more reliable and efficient. In contrast, a

有关镜像服务器上下载可用性的知识可以由源服务器的运营商或第三方获取和维护。这些知识以及加密哈希、数字签名等可以存储在机器可读的Metalink文件中。Metalink文件可以将这些知识传递给用户代理,用户代理可以自动阅读这些知识或将信息呈现给人类用户。如果当前镜像出现问题,用户代理可以退回到备用镜像。因此,客户机能够在不利环境下成功下载。所有这些都可以对人类用户透明地完成,下载更加可靠和高效。相比之下,一个

traditional HTTP redirect to one mirror conveys only comparatively minimal information -- a referral to a single server, and there is no provision in the HTTP protocol to handle failures.

传统的HTTP重定向到一个镜像只传递相对最小的信息——对单个服务器的引用,HTTP协议中没有处理故障的规定。

Other features that some clients provide include multi-source downloads, where chunks of a file are downloaded from multiple mirrors (and optionally, Peer-to-Peer) simultaneously, which frequently results in a faster download. Metalinks can leverage HTTP, FTP, and Peer-to-Peer protocols together, because regardless of the protocol over which the Metalink was obtained, it can make a resource accessible through other protocols. If the Metalink was obtained from a trusted source, included verification metadata can solve trust issues when downloading files from replica servers operated by third parties. Metalinks also provide structured information about downloads that can be indexed by search engines.

一些客户机提供的其他功能包括多源下载,其中文件块同时从多个镜像(以及可选的对等镜像)下载,这通常会加快下载速度。Metalink可以同时利用HTTP、FTP和对等协议,因为不管Metalink是通过什么协议获得的,它都可以通过其他协议访问资源。如果Metalink是从受信任的源获得的,则包含的验证元数据可以解决从第三方操作的副本服务器下载文件时的信任问题。Metalinks还提供有关下载的结构化信息,这些信息可以被搜索引擎索引。

1.1. Examples
1.1. 例子

A brief, Metalink Document that describes a single file:

描述单个文件的简短Metalink文档:

   <?xml version="1.0" encoding="UTF-8"?>
   <metalink xmlns="urn:ietf:params:xml:ns:metalink">
     <file name="example.ext">
       <size>14471447</size>
       <url>ftp://ftp.example.com/example.ext</url>
       <url>http://example.com/example.ext</url>
       <metaurl mediatype="torrent">
       http://example.com/example.ext.torrent</metaurl>
     </file>
   </metalink>
        
   <?xml version="1.0" encoding="UTF-8"?>
   <metalink xmlns="urn:ietf:params:xml:ns:metalink">
     <file name="example.ext">
       <size>14471447</size>
       <url>ftp://ftp.example.com/example.ext</url>
       <url>http://example.com/example.ext</url>
       <metaurl mediatype="torrent">
       http://example.com/example.ext.torrent</metaurl>
     </file>
   </metalink>
        

A more extensive Metalink Document that describes two files:

更广泛的Metalink文档,描述了两个文件:

 <?xml version="1.0" encoding="UTF-8"?>
 <metalink xmlns="urn:ietf:params:xml:ns:metalink">
   <published>2009-05-15T12:23:23Z</published>
   <file name="example.ext">
     <size>14471447</size>
     <identity>Example</identity>
     <version>1.0</version>
     <language>en</language>
     <description>
     A description of the example file for download.
     </description>
     <hash type="sha-256">f0ad929cd259957e160ea442eb80986b5f01...</hash>
     <url location="de"
          priority="1">ftp://ftp.example.com/example.ext</url>
        
 <?xml version="1.0" encoding="UTF-8"?>
 <metalink xmlns="urn:ietf:params:xml:ns:metalink">
   <published>2009-05-15T12:23:23Z</published>
   <file name="example.ext">
     <size>14471447</size>
     <identity>Example</identity>
     <version>1.0</version>
     <language>en</language>
     <description>
     A description of the example file for download.
     </description>
     <hash type="sha-256">f0ad929cd259957e160ea442eb80986b5f01...</hash>
     <url location="de"
          priority="1">ftp://ftp.example.com/example.ext</url>
        
     <url location="fr"
          priority="1">http://example.com/example.ext</url>
     <metaurl mediatype="torrent"
          priority="2">http://example.com/example.ext.torrent</metaurl>
   </file>
   <file name="example2.ext">
     <size>14471447</size>
     <identity>Example2</identity>
     <version>1.0</version>
     <language>en</language>
     <description>
     Another description for a second file.
     </description>
     <hash type="sha-256">2f548ce50c459a0270e85a7d63b2383c5523...</hash>
     <url location="de"
          priority="1">ftp://ftp.example.com/example2.ext</url>
     <url location="fr"
          priority="1">http://example.com/example2.ext</url>
     <metaurl mediatype="torrent"
          priority="2">http://example.com/example2.ext.torrent</metaurl>
   </file>
 </metalink>
        
     <url location="fr"
          priority="1">http://example.com/example.ext</url>
     <metaurl mediatype="torrent"
          priority="2">http://example.com/example.ext.torrent</metaurl>
   </file>
   <file name="example2.ext">
     <size>14471447</size>
     <identity>Example2</identity>
     <version>1.0</version>
     <language>en</language>
     <description>
     Another description for a second file.
     </description>
     <hash type="sha-256">2f548ce50c459a0270e85a7d63b2383c5523...</hash>
     <url location="de"
          priority="1">ftp://ftp.example.com/example2.ext</url>
     <url location="fr"
          priority="1">http://example.com/example2.ext</url>
     <metaurl mediatype="torrent"
          priority="2">http://example.com/example2.ext.torrent</metaurl>
   </file>
 </metalink>
        
1.2. Namespace and Version
1.2. 名称空间和版本

The XML Namespaces URI [REC-xml-names] for the XML data format described in this specification is:

本规范中描述的XML数据格式的XML名称空间URI[REC XML names]为:

   urn:ietf:params:xml:ns:metalink
        
   urn:ietf:params:xml:ns:metalink
        

For convenience, this data format may be referred to as "Metalink", which this specification uses internally.

为方便起见,此数据格式可称为“Metalink”,本规范在内部使用。

1.3. Notational Conventions
1.3. 符号约定

This specification describes conformance of Metalink Documents. Additionally, it places some requirements on Metalink Processors.

本规范描述了Metalink文档的一致性。此外,它对Metalink处理器提出了一些要求。

This specification uses the namespace prefix "metalink:" for the Namespace URI identified in Section 1.2, above. Note that the choice of namespace prefix is arbitrary and not semantically significant.

本规范使用名称空间前缀“metalink:”作为上文第1.2节中标识的名称空间URI。请注意,名称空间前缀的选择是任意的,在语义上并不重要。

Metalink is specified using terms from the XML Infoset [REC-xml-infoset]. However, this specification uses a shorthand for two common terms: the phrase "Information Item" is omitted when naming Element Information Items and Attribute Information Items. Therefore, when this specification uses the term "element," it is referring to an Element Information Item in Infoset terms. Likewise,

Metalink是使用XML信息集[REC XML Infoset]中的术语指定的。然而,本规范使用两个常用术语的缩写:在命名元素信息项和属性信息项时省略短语“信息项”。因此,当本规范使用术语“元素”时,它指的是Infoset术语中的元素信息项。同样地

when it uses the term "attribute," it is referring to an Attribute Information Item.

当它使用术语“属性”时,它指的是属性信息项。

Some sections of this specification are illustrated with fragments of a non-normative RELAX NG Compact schema [RELAX-NG]. However, the text of this specification provides the definition of conformance. A complete schema appears in Appendix B.

本规范的某些部分用非标准RELAX-NG紧凑模式[RELAX-NG]的片段进行了说明。然而,本规范的文本提供了一致性的定义。完整的模式见附录B。

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14, [RFC2119], as scoped to those conformance targets.

本文件中的关键词“必须”、“不得”、“要求”、“应”、“不得”、“应”、“不应”、“建议”、“可”和“可选”应按照BCP 14、[RFC2119]中的描述进行解释,并适用于这些合规性目标。

2. Metalink Documents
2. Metalink文档

This specification describes Metalink Documents.

本规范描述了Metalink文档。

A Metalink Document describes a file or group of files, how to access them, and metadata that identifies them. Its root is the metalink: metalink element.

Metalink文档描述一个文件或一组文件、如何访问它们以及标识它们的元数据。它的根是metalink:metalink元素。

   namespace metalink = "urn:ietf:params:xml:ns:metalink"
   start = metalinkMetalink
        
   namespace metalink = "urn:ietf:params:xml:ns:metalink"
   start = metalinkMetalink
        

Metalink Documents are specified in terms of the XML Information Set, serialized as XML 1.0 [REC-xml] and identified with the "application/ metalink4+xml" media type.

Metalink文档根据XML信息集指定,序列化为xml1.0[recxml],并用“application/metalink4+XML”媒体类型标识。

Metalink Documents MUST be well-formed XML. This specification does not define a Document Type Definition (DTD) for Metalink Documents, and hence it does not require them to be valid (in the sense used by XML).

Metalink文档必须是格式良好的XML。本规范没有为Metalink文档定义文档类型定义(DTD),因此不要求它们有效(在XML使用的意义上)。

Metalink allows the use of Internationalized Resource Identifiers (IRIs), encoded according to [RFC3987]. Every URI [RFC3986] is also an IRI, so a URI may be used wherever an IRI is named below. There is one special consideration: when an IRI that is not also a URI is given for dereferencing, it MUST be mapped to a URI using the steps in Section 3.1 of [RFC3987].

Metalink允许使用根据[RFC3987]编码的国际化资源标识符(IRI)。每个URI[RFC3986]也是一个IRI,因此在下面命名IRI的任何地方都可以使用URI。有一个特别的注意事项:当为解引用而提供的IRI不是URI时,必须使用[RFC3987]第3.1节中的步骤将其映射到URI。

Any element defined by this specification MAY have an xml:lang attribute, whose content indicates the natural language for the element and its descendents. The language context is only significant for elements and attributes declared to be "Language-Sensitive" by this specification. Requirements regarding the content and interpretation of xml:lang are specified in XML 1.0 [REC-xml], Section 2.12.

本规范定义的任何元素都可能具有xml:lang属性,其内容表示元素及其子代的自然语言。语言上下文仅对本规范声明为“语言敏感”的元素和属性有效。xml 1.0[REC xml]第2.12节规定了有关xml:lang的内容和解释的要求。

   metalinkCommonAttributes =
      attribute xml:lang { metalinkLanguageTag }?,
      undefinedAttribute*
        
   metalinkCommonAttributes =
      attribute xml:lang { metalinkLanguageTag }?,
      undefinedAttribute*
        

All leading and trailing whitespace is part of the element content and MUST NOT be ignored. Consequently, it is disallowed for elements where the defined type does not allow whitespace, such as dates, integers, or IRIs. Some XML-generating implementations erroneously insert whitespace around values by default, and such implementations will generate invalid Metalink Documents.

所有前导和尾随空格都是元素内容的一部分,不能忽略。因此,对于定义的类型不允许空白的元素,例如日期、整数或虹膜,它是不允许的。默认情况下,某些生成XML的实现会在值周围错误地插入空格,这样的实现将生成无效的Metalink文档。

Metalink Documents that do not follow this specification are invalid and SHOULD NOT be used by Metalink Processors.

不遵循此规范的Metalink文档无效,Metalink处理器不应使用这些文档。

Metalink is an extensible format. See Section 5 of this document for a full description of how Metalink Documents can be extended.

Metalink是一种可扩展格式。有关如何扩展Metalink文档的完整说明,请参见本文档第5节。

3. Common Metalink Constructs
3. 通用Metalink构造

Many Metalink elements share common structures. This section defines those structures and their requirements for convenient reference by the appropriate element definitions.

许多Metalink元素共享公共结构。本节定义了这些结构及其要求,以便于通过适当的元素定义进行参考。

When an element is identified as being a particular kind of construct, it inherits the corresponding requirements from that construct's definition in this section.

当一个元素被标识为一种特殊类型的构造时,它将从本节中该构造的定义继承相应的需求。

3.1. Text Constructs
3.1. 文本结构

A Text construct contains human-readable text, usually short in length.

文本构造包含人类可读的文本,通常长度较短。

metalinkTextConstruct = metalinkCommonAttributes, text

metalinkTextConstruct=metalinkCommonAttributes,text

For example, a metalink:description with text content:

例如,包含文本内容的metalink:description:

... <description> A description of the example file for download. </description> ...

... <description>下载示例文件的说明</说明>。。。

The content of the Text construct MUST NOT contain child elements. Such text is intended to be presented to humans in a readable fashion. Thus, whitespace could be collapsed (including line

文本构造的内容不能包含子元素。这样的文本旨在以可读的方式呈现给人类。因此,空格可以折叠(包括行)

breaks), and text could be displayed using typographic techniques such as justification and proportional fonts.

可以使用排版技术(如对齐和比例字体)显示文本。

3.2. Date Constructs
3.2. 日期结构

A Date construct is an element whose content MUST conform to the "date-time" production in [RFC3339]. In addition, an uppercase "T" character MUST be used to separate date and time, and an uppercase "Z" character MUST be present in the absence of a numeric time zone offset.

日期构造是一个元素,其内容必须符合[RFC3339]中的“日期-时间”产品。此外,必须使用大写“T”字符分隔日期和时间,如果没有数字时区偏移,则必须使用大写“Z”字符。

metalinkDateConstruct = metalinkCommonAttributes, xsd:dateTime

metalinkDateConstruct=metalinkCommonAttributes,xsd:dateTime

Such date values happen to be compatible with the following specifications: [ISO.8601.1988], [NOTE-datetime-19980827], and [REC-xmlschema-2-20041028].

这些日期值恰好与以下规范兼容:[ISO.8601.1988],[NOTE-datetime-19980827]和[REC-xmlschema-2-20041028]。

Example Date constructs:

日期构造示例:

... <updated>2010-05-01T12:15:02Z</updated> ... <updated>2010-05-01T12:15:02.25Z</updated> ... <updated>2010-05-01T12:15:02+01:00</updated> ... <updated>2010-05-01T12:15:02.25+01:00</updated> ...

... <更新日期:2010-05-01T12:15:02Z<更新日期:2010-05-01T12:15:02.25Z<更新时间>2010-05-01T12:15:02+01:00<更新时间>2010-05-01T12:15:02.25+01:00。。。

4. Metalink Element Definitions
4. Metalink元素定义
4.1. Container Elements
4.1. 容器元素
4.1.1. The "metalink:metalink" Element
4.1.1. “metalink:metalink”元素

The "metalink:metalink" element is the document (i.e., top-level) element of a Metalink Document, acting as a container for metadata and data associated with the listed files. It contains one or more metalink:file child elements that consist of Metadata elements.

“metalink:metalink”元素是metalink文档的文档(即顶级)元素,充当与列出的文件关联的元数据和数据的容器。它包含一个或多个metalink:file子元素,这些子元素由元数据元素组成。

metalinkMetalink = element metalink:metalink { metalinkCommonAttributes, (metalinkFile+ & metalinkGenerator? & metalinkOrigin?

metalinkMetalink=元素metalink:metalink{metalinkCommonAttributes,(metalinkFile+&metalinkGenerator?&metalinkOrigin?)?

& metalinkPublished? & metalinkUpdated? & extensionElement*) }

&Metalink已出版?&metalinkUpdated?&extensionElement*)}

The following child elements are defined by this specification (note that the presence of some of these elements is required):

本规范定义了以下子元素(请注意,其中一些元素是必需的):

o metalink:metalink elements MUST contain one or more metalink:file elements.

o metalink:metalink元素必须包含一个或多个metalink:file元素。

o metalink:metalink elements MAY contain exactly one metalink: generator element and MUST NOT contain more than one such element.

o metalink:metalink元素只能包含一个metalink:generator元素,并且不能包含多个此类元素。

o metalink:metalink elements SHOULD contain exactly one metalink: origin element and MUST NOT contain more than one such element.

o metalink:metalink元素应该只包含一个metalink:origin元素,并且不能包含多个这样的元素。

o metalink:metalink elements MAY contain exactly one metalink: published element and MUST NOT contain more than one such element.

o metalink:metalink元素只能包含一个metalink:published元素,并且不能包含多个此类元素。

o metalink:metalink elements MAY contain exactly one metalink: updated element and MUST NOT contain more than one such element.

o metalink:metalink元素只能包含一个metalink:updated元素,并且不能包含多个此类元素。

4.1.1.1. Providing Textual Content
4.1.1.1. 提供文本内容

Experience teaches that downloads providing textual content are, in general, more useful than those that do not. Some applications (one example is full-text indexers) require a minimum amount of text to function reliably and predictably. Metalink publishers should be aware of this. It is RECOMMENDED that each metalink:file element contain a non-empty metalink:description element, a non-empty metalink:identity element, a non-empty metalink:version element, and a non-empty metalink:publisher element when these elements are present. However, the absence of metalink:description, metalink: identity, metalink:version, and metalink:publisher is not an error, and Metalink Processors MUST NOT fail to function correctly as a consequence of such an absence.

经验告诉我们,提供文本内容的下载通常比不提供文本内容的下载更有用。一些应用程序(全文索引器就是一个例子)需要最少的文本量才能可靠和可预测地运行。Metalink发布者应该意识到这一点。建议每个metalink:file元素包含非空metalink:description元素、非空metalink:identity元素、非空metalink:version元素和非空metalink:publisher元素(当这些元素存在时)。但是,缺少metalink:description、metalink:identity、metalink:version和metalink:publisher并不是一个错误,metalink处理器不能因此而无法正常工作。

4.1.2. The "metalink:file" Element
4.1.2. “metalink:file”元素

The "metalink:file" element represents an individual file, acting as a container for metadata and data associated with the file. Each unique file described in a Metalink Document MUST have its own metalink:file element.

“metalink:file”元素表示单个文件,充当与该文件关联的元数据和数据的容器。Metalink文档中描述的每个唯一文件都必须有自己的Metalink:file元素。

All metalink:url elements contained in each metalink:file element SHOULD lead to identical files. That is, each metalink:url element should be an alternative location for the same file and each

每个metalink:file元素中包含的所有metalink:url元素都应该指向相同的文件。也就是说,每个metalink:url元素都应该是同一文件和每个

metalink:metaurl element should provide metadata to retrieve the same file in another way, such as a Peer-to-Peer network. Refer to Sections 4.2.8 and 4.2.16 for more information.

metalink:metaurl元素应提供元数据,以便以另一种方式(例如对等网络)检索同一文件。有关更多信息,请参阅第4.2.8节和第4.2.16节。

   metalinkFile =
      element metalink:file {
         metalinkCommonAttributes,
         attribute name { text },
         (metalinkCopyright?
          & metalinkDescription?
          & metalinkHash*
          & metalinkIdentity?
          & metalinkLanguage*
          & metalinkLogo?
          & metalinkMetaURL*
          & metalinkOS*
          & metalinkPieces*
          & metalinkPublisher?
          & metalinkSignature?
          & metalinkSize?
          & metalinkURL*
          & metalinkVersion?
          & extensionElement*)
      }
        
   metalinkFile =
      element metalink:file {
         metalinkCommonAttributes,
         attribute name { text },
         (metalinkCopyright?
          & metalinkDescription?
          & metalinkHash*
          & metalinkIdentity?
          & metalinkLanguage*
          & metalinkLogo?
          & metalinkMetaURL*
          & metalinkOS*
          & metalinkPieces*
          & metalinkPublisher?
          & metalinkSignature?
          & metalinkSize?
          & metalinkURL*
          & metalinkVersion?
          & extensionElement*)
      }
        

This specification assigns no significance to the order of metalink: file elements or to the order of metalink:url or metalink:metaurl elements. Significance is determined by the value of the "priority" attribute of the metalink:url or metalink:metaurl elements.

本规范不对metalink:file元素的顺序或metalink:url或metalink:metaurl元素的顺序赋予任何意义。重要性由metalink:url或metalink:metaurl元素的“优先级”属性的值确定。

The following child elements are defined by this specification (the presence of some of them is required):

本规范定义了以下子元素(其中一些是必需的):

o metalink:file elements MAY contain exactly one metalink:copyright element and MUST NOT contain more than one such element.

o metalink:file元素只能包含一个metalink:copyright元素,并且不能包含多个此类元素。

o metalink:file elements MAY contain exactly one metalink: description element and MUST NOT contain more than one such element.

o metalink:file元素只能包含一个metalink:description元素,并且不能包含多个此类元素。

o metalink:file elements MAY contain exactly one metalink:identity element and MUST NOT contain more than one such element.

o metalink:file元素只能包含一个metalink:identity元素,并且不能包含多个此类元素。

o metalink:file elements MAY contain one or more metalink:hash elements.

o metalink:file元素可能包含一个或多个metalink:hash元素。

o metalink:file elements MAY contain one or more metalink:language elements.

o metalink:file元素可能包含一个或多个metalink:language元素。

o metalink:file elements MAY contain exactly one metalink:logo element and MUST NOT contain more than one such element.

o metalink:file元素只能包含一个metalink:logo元素,并且不能包含多个此类元素。

o metalink:file elements MAY contain one or more metalink:os element.

o metalink:file元素可能包含一个或多个metalink:os元素。

o metalink:file elements MUST contain at least one metalink:url element or at least one metalink:metaurl element. Typically, metalink:file elements contain more than one metalink:url element to provide multiple download sources.

o metalink:file元素必须至少包含一个metalink:url元素或至少一个metalink:metaurl元素。通常,metalink:file元素包含多个metalink:url元素以提供多个下载源。

o metalink:file elements MAY contain one or more metalink:pieces elements.

o metalink:file元素可能包含一个或多个metalink:parties元素。

o metalink:file elements MAY contain exactly one metalink:publisher element and MUST NOT contain more than one such element.

o metalink:file元素只能包含一个metalink:publisher元素,并且不能包含多个此类元素。

o metalink:file elements MAY contain one or more metalink:signature elements.

o metalink:file元素可能包含一个或多个metalink:signature元素。

o metalink:file elements SHOULD contain exactly one metalink:size element and MUST NOT contain more than one such element.

o metalink:file元素应该只包含一个metalink:size元素,并且不能包含多个这样的元素。

o metalink:file elements MAY contain exactly one metalink:version element and MUST NOT contain more than one such element.

o metalink:file元素只能包含一个metalink:version元素,并且不能包含多个此类元素。

4.1.2.1. The "name" Attribute
4.1.2.1. “name”属性

metalink:file elements MUST have a "name" attribute, which contains the local file name to which the downloaded file will be written. Hence, if a Metalink Document contains multiple metalink:file elements, the value of the "name" attribute MUST be unique for each.

metalink:文件元素必须具有“name”属性,该属性包含下载文件将写入的本地文件名。因此,如果Metalink文档包含多个Metalink:file元素,“name”属性的值对于每个元素都必须是唯一的。

Directory information can also be contained in a "path/file" format only, as in:

目录信息也可以仅以“路径/文件”格式包含,如:

   <file name="debian-amd64/sarge/Contents-amd64.gz">
        
   <file name="debian-amd64/sarge/Contents-amd64.gz">
        

In this example, a subdirectory "debian-amd64/sarge/" will be created and a file named "Contents-amd64.gz" will be created inside it.

在本例中,将创建一个子目录“debian-amd64/sarge/”,并在其中创建一个名为“Contents-amd64.gz”的文件。

Security Note: The path MUST NOT contain any directory traversal directives or information. The path MUST be relative. The path MUST NOT begin with a "/", "./", or "../"; contain "/../"; or end with "/..".

安全注意:路径不能包含任何目录遍历指令或信息。路径必须是相对的。路径不能以“/”、“/”或“./”开头;包含“/…/”;或以“/…”结尾。

4.1.3. The "metalink:pieces" Element
4.1.3. “metalink:parties”元素

The "metalink:pieces" element acts as a container for a list of cryptographic hashes of contiguous, non-overlapping pieces of the file. The cryptographic hashes MUST be listed in the same order as the corresponding pieces appear in the file, starting at the beginning of the file. Metalink Documents MAY contain one or multiple metalink:pieces container elements, if each "type" attribute of metalink:pieces has a unique value.

“metalink:pieces”元素充当文件连续、不重叠片段的加密哈希列表的容器。加密散列必须以与文件中相应片段相同的顺序列出,从文件开头开始。如果Metalink:pieces的每个“type”属性具有唯一值,则Metalink文档可能包含一个或多个Metalink:pieces容器元素。

   metalinkPieces =
      element metalink:pieces {
         attribute length { xsd:positiveInteger },
         attribute type { text },
         metalinkHash+
      }
        
   metalinkPieces =
      element metalink:pieces {
         attribute length { xsd:positiveInteger },
         attribute type { text },
         metalinkHash+
      }
        
4.1.3.1. The "type" Attribute
4.1.3.1. “类型”属性

metalink:pieces elements MUST have a "type" attribute.

metalink:pieces元素必须具有“type”属性。

The Internet Assigned Numbers Authority (IANA) registry named "Hash Function Textual Names" defines values for hash types. See Section 7.4 for security implications.

名为“哈希函数文本名称”的Internet分配号码管理局(IANA)注册表定义哈希类型的值。有关安全影响,请参见第7.4节。

4.1.3.2. The "length" Attribute
4.1.3.2. “长度”属性

metalink:pieces elements MUST have a "length" attribute, which is a positive integer that describes the length of the pieces of the file in octets. The whole file is divided into non-overlapping pieces of this length, starting from the beginning of the file. That is, every piece MUST be the same size, apart from the last piece, which is the remainder. The last piece extends to the end of the file, and it therefore MAY be shorter than the other pieces.

metalink:pieces元素必须有一个“length”属性,它是一个正整数,以八位字节描述文件片段的长度。从文件的开头开始,整个文件被划分为该长度的非重叠部分。也就是说,除了最后一块(即剩余部分)之外,每一块都必须具有相同的尺寸。最后一个片段延伸到文件的末尾,因此可能比其他片段短。

4.2. Metadata Elements
4.2. 元数据元素
4.2.1. The "metalink:copyright" Element
4.2.1. “metalink:版权”元素

The "metalink:copyright" element is a Text construct that conveys a human-readable copyright for a file. It is Language-Sensitive.

“metalink:copyright”元素是一个文本构造,它传递文件的人类可读版权。它对语言敏感。

   metalinkCopyright =
      element metalink:copyright {
        metalinkTextConstruct
      }
        
   metalinkCopyright =
      element metalink:copyright {
        metalinkTextConstruct
      }
        
4.2.2. The "metalink:description" Element
4.2.2. “metalink:description”元素

The "metalink:description" element is a Text construct that conveys a human-readable file description. It is Language-Sensitive.

“metalink:description”元素是一个文本构造,它传递一个人类可读的文件描述。它对语言敏感。

   metalinkDescription =
      element metalink:description {
        metalinkTextConstruct
      }
        
   metalinkDescription =
      element metalink:description {
        metalinkTextConstruct
      }
        
4.2.3. The "metalink:generator" Element
4.2.3. “metalink:generator”元素

The "metalink:generator" element's content identifies the generating agent name and version used to generate a Metalink Document, for debugging and other purposes.

“metalink:generator”元素的内容标识用于生成metalink文档的生成代理名称和版本,用于调试和其他目的。

   metalinkGenerator =
      element metalink:generator {
        metalinkTextConstruct
      }
        
   metalinkGenerator =
      element metalink:generator {
        metalinkTextConstruct
      }
        

The metalink:generator element's content is defined below in ABNF notation [RFC5234].

metalink:generator元素的内容在ABNF符号[RFC5234]中定义如下。

   token          = 1*<any CHAR except CTLs or separators>
   separators     = "(" / ")" / "<" / ">" / "@"
                  / "," / ";" / ":" / "\" / DQUOTE
                  / "/" / "[" / "]" / "?" / "="
                  / "{" / "}" / SP / HTAB
   agent         = token ["/" agent-version]
   agent-version = token
        
   token          = 1*<any CHAR except CTLs or separators>
   separators     = "(" / ")" / "<" / ">" / "@"
                  / "," / ";" / ":" / "\" / DQUOTE
                  / "/" / "[" / "]" / "?" / "="
                  / "{" / "}" / SP / HTAB
   agent         = token ["/" agent-version]
   agent-version = token
        

Examples:

示例:

... <generator>MirrorBrain/2.11</generator> ... <generator>MirrorManager/1.2.11</generator> ... <generator>metalinktools/0.3.6</generator> ... <generator>MetalinkEditor/1.2.0</generator> ...

... <生成器>镜像大脑/2.11</generator><生成器>镜像管理器/1.2.11</generator><生成器>metalinktools/0.3.6</generator><生成器>MetalinkEditor/1.2.0</generator>。。。

Although any token character MAY appear in an agent-version, this token SHOULD only be used for a version identifier (i.e., successive versions of the same agent SHOULD only differ in the agent-version portion of the agent value).

尽管代理版本中可能出现任何令牌字符,但该令牌应仅用于版本标识符(即,同一代理的后续版本仅应在代理值的代理版本部分有所不同)。

4.2.4. The "metalink:hash" Element
4.2.4. “metalink:hash”元素

The "metalink:hash" element is a Text construct that conveys a cryptographic hash for a file. All hashes are encoded in lowercase hexadecimal format. Hashes are used to verify the integrity of a complete file or portion of a file to determine if the file has been transferred without any errors.

“metalink:hash”元素是一个文本构造,用于传递文件的加密哈希。所有哈希都以小写十六进制格式编码。哈希用于验证完整文件或部分文件的完整性,以确定文件传输时是否没有任何错误。

   metalinkHash =
      element metalink:hash {
        attribute type { text }?,
        text
      }
        
   metalinkHash =
      element metalink:hash {
        attribute type { text }?,
        text
      }
        

Metalink Documents MAY contain one or multiples hashes of a complete file. metalink:hash elements with a "type" attribute MUST contain a hash of the complete file. In this example, both SHA-1 and SHA-256 hashes of the complete file are included.

Metalink文档可能包含完整文件的一个或多个哈希值。metalink:具有“type”属性的散列元素必须包含完整文件的散列。在本例中,包括完整文件的SHA-1和SHA-256哈希。

... <hash type="sha-1">a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash> <hash type="sha-256">fc87941af7fd7f03e53b34af393f4c14923d74...</hash> ...

... <hash type=“sha-1”>a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash><hash type=“sha-256”>fc87941af7fd7f03e53b34af393f4c14923d74…</hash>。。。

Metalink Documents MAY also contain hashes for individual pieces of a file. metalink:hash elements that are inside a metalink:pieces container element have a hash for that specific piece or chunk of the file, and are of the same hash type as the metalink:pieces element in which they are contained. Metalink Documents MAY contain one or multiple metalink:pieces container elements, if each "type" attribute of metalink:pieces has a unique value.

Metalink文档还可能包含文件各个部分的哈希值。metalink:pieces容器元素中的metalink:hash元素具有文件的特定片段或区块的哈希,并且与包含它们的metalink:pieces元素具有相同的哈希类型。如果Metalink:pieces的每个“type”属性具有唯一值,则Metalink文档可能包含一个或多个Metalink:pieces容器元素。

metalink:hash elements without a "type" attribute MUST contain a hash for that specific piece or chunk of the file and MUST be listed in the same order as the corresponding pieces appear in the file, starting at the beginning of the file. The size of the piece is equal to the value of the "length" attribute of the metalink:pieces element, apart from the last piece, which is the remainder. See Section 4.1.3.2 for more information on the size of pieces.

metalink:没有“type”属性的散列元素必须包含文件中特定片段或区块的散列,并且必须以与文件中相应片段相同的顺序列出,从文件开头开始。工件的大小等于metalink:pieces元素的“length”属性的值,而最后一个工件是剩余的。有关工件尺寸的更多信息,请参见第4.1.3.2节。

In this example, SHA-1 and SHA-256 hashes of the complete file are included, along with four SHA-1 piece hashes.

在本例中,包括完整文件的SHA-1和SHA-256散列,以及四个SHA-1片段散列。

... <hash type="sha-1">a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash> <hash type="sha-256">fc87941af7fd7f03e53b34af393f4c14923d74...</hash> <pieces length="1048576" type="sha-1"> <hash>d96b9a4b92a899c2099b7b31bddb5ca423bb9b30</hash> <hash>10d68f4b1119014c123da2a0a6baf5c8a6d5ba1e</hash> <hash>3e84219096435c34e092b17b70a011771c52d87a</hash> <hash>67183e4c3ab892d3ebe8326b7d79eb62d077f487</hash> </pieces> ...

... <hash type=“sha-1”>a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash><hash type=“sha-256”>fc87941af7fd7f03e53b34af393f4c14923d74…</hash><pieces length=“1048576”type=“sha-1”><hash>D96B9A4 B92A899C2099B7B31BDDB5CA423B9B30</hash>10D68F4B119014C123DA2A0A6BAF5C8A6D5BA1E</hash>3E842196435C34E092B17B70A011771C52D87A</hash>67183e4c3ab892d3ebe8326b7d79eb62d077f487</hash>。。。

4.2.4.1. The "type" Attribute
4.2.4.1. “类型”属性

metalink:hash elements MUST have a "type" attribute, if and only if it contains a hash of the complete file. The IANA registry named "Hash Function Textual Names" defines values for hash types. metalink:hash elements MUST NOT have a "type" attribute, if they are inside a metalink:pieces container element. See Section 7.4 for security implications.

metalink:散列元素必须具有“type”属性,当且仅当它包含完整文件的散列时。名为“哈希函数文本名称”的IANA注册表定义哈希类型的值。metalink:hash元素不能有“type”属性,如果它们位于metalink:pieces容器元素内。有关安全影响,请参见第7.4节。

4.2.5. The "metalink:identity" Element
4.2.5. “metalink:identity”元素

The "metalink:identity" element is a Text construct that conveys a human-readable identity for a file. For example, the identity of Firefox 3.5 would be "Firefox".

“metalink:identity”元素是一种文本构造,用于传递文件的人类可读标识。例如,Firefox3.5的标识就是“Firefox”。

   metalinkIdentity =
      element metalink:identity {
        metalinkTextConstruct
      }
        
   metalinkIdentity =
      element metalink:identity {
        metalinkTextConstruct
      }
        
4.2.6. The "metalink:language" Element
4.2.6. “metalink:language”元素

The "metalink:language" element is a Text construct that conveys a code for the language of a file, per [RFC5646].

“metalink:language”元素是一种文本结构,根据[RFC5646],它传递文件语言的代码。

Multiple metalink:language elements are allowed, for instance, to describe a file such as an binary installation program that provides multiple language options, a movie with multiple language tracks, or a document in multiple languages.

Multiple metalink:例如,允许使用语言元素来描述文件,如提供多种语言选项的二进制安装程序、具有多种语言曲目的电影或具有多种语言的文档。

   metalinkLanguage =
      element metalink:language {
        metalinkTextConstruct
      }
        
   metalinkLanguage =
      element metalink:language {
        metalinkTextConstruct
      }
        
4.2.7. The "metalink:logo" Element
4.2.7. “metalink:logo”元素

The "metalink:logo" element's content is an IRI reference [RFC3987] that identifies an image that provides visual identification for a file.

“metalink:logo”元素的内容是一个IRI参考[RFC3987],用于标识为文件提供视觉标识的图像。

   metalinkLogo =
      element metalink:logo {
        metalinkCommonAttributes,
        (metalinkUri)
      }
        
   metalinkLogo =
      element metalink:logo {
        metalinkCommonAttributes,
        (metalinkUri)
      }
        

The image SHOULD have an aspect ratio of one (horizontal) to one (vertical) and SHOULD be suitable for presentation at a small size.

图像的纵横比应为1(水平)与1(垂直),并且应适合小尺寸显示。

4.2.8. The "metalink:metaurl" Element
4.2.8. “metalink:metaurl”元素

The "metalink:metaurl" element contains the IRI of a metadata file, also known as a metainfo file, about a resource to download. For example, this could be the IRI of a BitTorrent .torrent file, a Metalink Document, or other type of metadata file. Note that the information in the metalink:hash element does not apply to these metadata files but to the files that are described by them.

“metalink:metaurl”元素包含元数据文件(也称为metainfo文件)的IRI,该文件关于要下载的资源。例如,这可能是BitTorrent.torrent文件、Metalink文档或其他类型元数据文件的IRI。请注意,metalink:hash元素中的信息不适用于这些元数据文件,而是适用于它们所描述的文件。

   metalinkMetaURL =
      element metalink:metaurl {
         metalinkCommonAttributes,
         attribute priority { xsd:positiveInteger {
            maxInclusive = "999999"}}?,
         attribute mediatype { text },
         attribute name { text }?,
         (metalinkUri)
      }
        
   metalinkMetaURL =
      element metalink:metaurl {
         metalinkCommonAttributes,
         attribute priority { xsd:positiveInteger {
            maxInclusive = "999999"}}?,
         attribute mediatype { text },
         attribute name { text }?,
         (metalinkUri)
      }
        
4.2.8.1. The "priority" Attribute
4.2.8.1. “优先级”属性

metalink:metaurl elements MAY have a priority attribute. Values MUST be positive integers between 1 and 999999. Lower values indicate a higher priority. metalink:metaurl elements without a priority attribute are considered to have the lowest priority, i.e., 999999. The priority values of metalink:metaurl and metalink:url elements are compared and those with the lowest values, starting with 1, are used first. Multiple metalink:metaurl and metalink:url elements MAY have the same priority, i.e., one BitTorrent .torrent file and three FTP URIs could have priority="1". See also the "priority" attribute of the metalink:url element.

metalink:metaurl元素可能具有优先级属性。值必须是介于1和999999之间的正整数。值越低表示优先级越高。metalink:没有priority属性的metaurl元素被认为具有最低优先级,即999999。比较metalink:metaurl和metalink:url元素的优先级值,并首先使用从1开始的值最低的元素。多个metalink:metaurl和metalink:url元素可能具有相同的优先级,即一个BitTorrent.torrent文件和三个FTP URI可能具有优先级=“1”。另请参见metalink:url元素的“priority”属性。

4.2.8.2. The "mediatype" Attribute
4.2.8.2. “mediatype”属性

metalink:metaurl elements MUST have a "mediatype" attribute that indicates the Multipurpose Internet Mail Extensions (MIME) media type [RFC4288] of the metadata file available at the IRI. In the case of BitTorrent as specified in [BITTORRENT], the value "torrent" is REQUIRED. Types without "/" are reserved. Currently, "torrent" is the only reserved value.

metalink:metaurl元素必须具有“mediatype”属性,该属性指示IRI上可用的元数据文件的多用途Internet邮件扩展(MIME)媒体类型[RFC4288]。对于[BitTorrent]中指定的BitTorrent,需要值“torrent”。不带“/”的类型是保留的。目前,“torrent”是唯一的保留值。

Values for this attribute are defined below in ABNF notation [RFC5234].

该属性的值在ABNF符号[RFC5234]中定义如下。

   media-type = (type-name "/" subtype-name) / media-reserved
   media-reserved = "torrent"
   type-name = <Defined in Section 4.2 of RFC 4288>
   subtype-name = <Defined in Section 4.2 of RFC 4288>
        
   media-type = (type-name "/" subtype-name) / media-reserved
   media-reserved = "torrent"
   type-name = <Defined in Section 4.2 of RFC 4288>
   subtype-name = <Defined in Section 4.2 of RFC 4288>
        
4.2.8.3. The "name" Attribute
4.2.8.3. “name”属性

metalink:metaurl elements MAY have a "name" attribute that indicates a specific file in a BitTorrent .torrent file or a Metalink Document that describes multiple files.

metalink:metaurl元素可能有一个“name”属性,用于指示BitTorrent.torrent文件中的特定文件或描述多个文件的metalink文档。

Directory information can also be contained in a "path/file" format only, as in:

目录信息也可以仅以“路径/文件”格式包含,如:

   <metaurl
        mediatype="torrent" name="debian-amd64/sarge/Contents-amd64.gz">
        
   <metaurl
        mediatype="torrent" name="debian-amd64/sarge/Contents-amd64.gz">
        

In this example, a file named "Contents-amd64.gz" is indicated, in a "debian-amd64/sarge/" subdirectory. The path MUST NOT contain any directory traversal directives or information. The path MUST be relative. The path MUST NOT begin with a "/", "./", or "../"; contain "/../"; or end with "/..".

在本例中,在“debian-amd64/sarge/”子目录中指示名为“Contents-amd64.gz”的文件。路径不得包含任何目录遍历指令或信息。路径必须是相对的。路径不能以“/”、“/”或“./”开头;包含“/…/”;或以“/…”结尾。

4.2.9. The "metalink:origin" Element
4.2.9. “metalink:origin”元素

The "metalink:origin" element is an IRI where the Metalink Document was originally published. If the dynamic attribute of metalink: origin is "true", then updated versions of the Metalink can be found at this IRI.

“metalink:origin”元素是最初发布metalink文档的IRI。如果metalink:origin的动态属性为“true”,则可以在此IRI中找到metalink的更新版本。

   metalinkOrigin =
      element metalink:origin {
        metalinkCommonAttributes,
        attribute dynamic { xsd:boolean }?,
        (metalinkUri)
      }
        
   metalinkOrigin =
      element metalink:origin {
        metalinkCommonAttributes,
        attribute dynamic { xsd:boolean }?,
        (metalinkUri)
      }
        
4.2.9.1. The "dynamic" Attribute
4.2.9.1. “动态”属性

The metalink:origin element MAY have a "dynamic" attribute, set to "true" or "false", which tells if a Metalink at the origin IRI will contain dynamic updated information or if it is static and not likely to be updated.

metalink:origin元素可能有一个“dynamic”属性,设置为“true”或“false”,它告诉我们origin IRI上的metalink是否包含动态更新的信息,或者它是静态的,不太可能更新。

4.2.10. The "metalink:os" Element
4.2.10. “metalink:os”元素

The "metalink:os" element is a Text construct that conveys an Operating System that a file is suitable for. The IANA registry named "Operating System Names" defines values for OS types.

“metalink:os”元素是一种文本结构,用于传递文件适合的操作系统。名为“操作系统名称”的IANA注册表定义操作系统类型的值。

   metalinkOS =
      element metalink:os {
        metalinkTextConstruct
      }
        
   metalinkOS =
      element metalink:os {
        metalinkTextConstruct
      }
        
4.2.11. The "metalink:published" Element
4.2.11. “metalink:published”元素

The "metalink:published" element is a Date construct indicating an instant in time associated with an event early in the life cycle of the entry.

“metalink:published”元素是一个日期构造,表示与条目生命周期早期的事件相关联的即时时间。

   metalinkPublished =
      element metalink:published {
        metalinkDateConstruct
      }
        
   metalinkPublished =
      element metalink:published {
        metalinkDateConstruct
      }
        

Typically, metalink:published will be associated with the initial creation or first availability of the resource. The metalink:updated element is used when a Metalink Document has been updated after initial publication.

通常,metalink:published将与资源的初始创建或首次可用性相关联。metalink:updated元素用于在初次发布后更新metalink文档的情况。

4.2.12. The "metalink:publisher" Element
4.2.12. “metalink:publisher”元素

The "metalink:publisher" element contains a human-readable group or other entity that has published the file described in the Metalink Document and an IRI for more information.

“metalink:publisher”元素包含已发布metalink文档中所述文件的可读组或其他实体,以及有关详细信息的IRI。

   metalinkPublisher =
      element metalink:publisher {
        metalinkCommonAttributes,
        attribute name { text },
        attribute url { metalinkUri }?
      }
        
   metalinkPublisher =
      element metalink:publisher {
        metalinkCommonAttributes,
        attribute name { text },
        attribute url { metalinkUri }?
      }
        
4.2.12.1. The "name" Attribute
4.2.12.1. “name”属性

The metalink:publisher element MUST have a "name" attribute that indicates the human-readable name of the publisher.

metalink:publisher元素必须具有一个“name”属性,该属性指示发布者的可读名称。

4.2.12.2. The "url" Attribute
4.2.12.2. “url”属性

The metalink:publisher element MAY have a "url" attribute whose value MUST be an IRI reference [RFC3987].

metalink:publisher元素可能有一个“url”属性,其值必须是IRI引用[RFC3987]。

4.2.13. The "metalink:signature" Element
4.2.13. “metalink:signature”元素

The "metalink:signature" element is a Text construct that conveys a digital signature for a file described in a Metalink Document. Digital signatures verify that a file is from the entity that has signed it.

“metalink:signature”元素是一种文本构造,用于传递metalink文档中描述的文件的数字签名。数字签名验证文件是否来自对其进行签名的实体。

Support in Metalink Processors for digital signatures included in this element is OPTIONAL. Note that the signing of Metalink Documents, as opposed to a digital signature of a file described in a Metalink Document, is covered in Section 7.1.

Metalink处理器中对此元素中包含的数字签名的支持是可选的。请注意,第7.1节介绍了Metalink文档的签名,而不是Metalink文档中描述的文件的数字签名。

   metalinkSignature =
      element metalink:signature {
        attribute mediatype { text },
        metalinkTextConstruct
      }
        
   metalinkSignature =
      element metalink:signature {
        attribute mediatype { text },
        metalinkTextConstruct
      }
        

Example with an OpenPGP signature [RFC4880]:

具有OpenPGP签名[RFC4880]的示例:

   <signature mediatype="application/pgp-signature">
   -----BEGIN PGP SIGNATURE-----
   Version: GnuPG v1.4.10 (GNU/Linux)
        
   <signature mediatype="application/pgp-signature">
   -----BEGIN PGP SIGNATURE-----
   Version: GnuPG v1.4.10 (GNU/Linux)
        
   iEYEABECAAYFAkrxdXQACgkQeOEcayedXJHqFwCfd1p/HhRf/iDvYhvFbTrQPz+p
   p3oAoO9lKHoOqOE0EMB3zmMcLoYUrNkg
   =ggAf
   -----END PGP SIGNATURE-----
   </signature>
        
   iEYEABECAAYFAkrxdXQACgkQeOEcayedXJHqFwCfd1p/HhRf/iDvYhvFbTrQPz+p
   p3oAoO9lKHoOqOE0EMB3zmMcLoYUrNkg
   =ggAf
   -----END PGP SIGNATURE-----
   </signature>
        
4.2.13.1. The "mediatype" Attribute
4.2.13.1. “mediatype”属性

metalink:signature elements MUST have a "mediatype" attribute that indicates the MIME media type [RFC4288] of the included digital signature.

metalink:签名元素必须具有“mediatype”属性,该属性指示所包含数字签名的MIME媒体类型[RFC4288]。

Values for this attribute are defined below in ABNF notation [RFC5234].

该属性的值在ABNF符号[RFC5234]中定义如下。

   media-type = type-name "/" subtype-name
   type-name = <Defined in Section 4.2 of RFC 4288>
   subtype-name = <Defined in Section 4.2 of RFC 4288>
        
   media-type = type-name "/" subtype-name
   type-name = <Defined in Section 4.2 of RFC 4288>
   subtype-name = <Defined in Section 4.2 of RFC 4288>
        
4.2.14. The "metalink:size" Element
4.2.14. “metalink:size”元素

The "metalink:size" element indicates the length of the linked content in octets. This is the content length of the representation returned when the IRI is mapped to a URI and dereferenced. Note that the "metalink:size" element MUST override the actual content length of the representation as reported by the underlying protocol, and those that do not match MUST be discarded by Metalink Processors. This value MUST be a non-negative integer.

“metalink:size”元素以八位字节表示链接内容的长度。这是将IRI映射到URI并取消引用时返回的表示的内容长度。请注意,“metalink:size”元素必须覆盖底层协议报告的表示的实际内容长度,不匹配的内容长度必须由metalink处理器丢弃。此值必须是非负整数。

   metalinkSize =
      element metalink:size {
        xsd:nonNegativeInteger
      }
        
   metalinkSize =
      element metalink:size {
        xsd:nonNegativeInteger
      }
        
4.2.15. The "metalink:updated" Element
4.2.15. “metalink:updated”元素

The "metalink:updated" element is a Date construct indicating the most recent instant in time when a Metalink was modified in a way the publisher considers significant. Therefore, not all modifications necessarily result in a changed metalink:updated value.

“metalink:updated”元素是一个日期构造,表示最近一次以发布者认为重要的方式修改metalink的时间。因此,并非所有修改都必然导致更改metalink:updated值。

   metalinkUpdated =
      element metalink:updated {
        metalinkDateConstruct
      }
        
   metalinkUpdated =
      element metalink:updated {
        metalinkDateConstruct
      }
        

Publishers MAY change the value of this element over time.

发布者可能会随着时间的推移更改此元素的值。

4.2.16. The "metalink:url" Element
4.2.16. “metalink:url”元素

The "metalink:url" element contains a file IRI. Most metalink:file container elements will contain multiple metalink:url elements, and each one SHOULD be a valid alternative to download the same file.

“metalink:url”元素包含一个文件IRI。大多数metalink:file容器元素将包含多个metalink:url元素,并且每个元素都应该是下载同一文件的有效替代项。

The metalink:url elements SHOULD be resolvable and, if resolvable, SHOULD lead to identical files.

metalink:url元素应该是可解析的,如果可以解析,则应该指向相同的文件。

Metalink Processors MUST filter out invalid files obtained from "metalink:url" elements by using information in the metalink:size element and metalink:hash elements.

Metalink处理器必须使用Metalink:size元素和Metalink:hash元素中的信息过滤掉从“Metalink:url”元素获得的无效文件。

   metalinkURL =
      element metalink:url {
         metalinkCommonAttributes,
         attribute location { xsd:string {
            minLength = "2"  maxLength="2"}
         }?,
         attribute priority { xsd:positiveInteger {
            maxInclusive = "999999"}}?,
         (metalinkUri)
      }
        
   metalinkURL =
      element metalink:url {
         metalinkCommonAttributes,
         attribute location { xsd:string {
            minLength = "2"  maxLength="2"}
         }?,
         attribute priority { xsd:positiveInteger {
            maxInclusive = "999999"}}?,
         (metalinkUri)
      }
        
4.2.16.1. The "priority" Attribute
4.2.16.1. “优先级”属性

metalink:url elements MAY have a priority attribute. Values MUST be positive integers between 1 and 999999. Lower values indicate a higher priority. metalink:url elements without a priority attribute are considered to have the lowest priority, i.e., 999999. Multiple metalink:url elements can have the same priority, i.e., ten different mirrors could have priority="1".

metalink:url元素可能具有优先级属性。值必须是介于1和999999之间的正整数。值越低表示优先级越高。metalink:没有priority属性的url元素被认为具有最低优先级,即999999。多个metalink:url元素可以具有相同的优先级,即,十个不同的镜像可以具有优先级=“1”。

4.2.16.2. The "location" Attribute
4.2.16.2. “位置”属性

metalink:url elements MAY have a "location" attribute, which is a [ISO3166-1] alpha-2 two letter country code for the geographical location of the physical server an IRI is used to access.

metalink:url元素可能有一个“location”属性,它是一个[ISO3166-1]alpha-2两个字母的国家代码,表示使用IRI访问的物理服务器的地理位置。

4.2.17. The "metalink:version" Element
4.2.17. “metalink:version”元素

The "metalink:version" element is a Text construct that conveys a human-readable version for a file. The version of Firefox 3.5 would be "3.5".

“metalink:version”元素是一种文本构造,用于传递文件的可读版本。Firefox3.5的版本将是“3.5”。

   metalinkVersion =
      element metalink:version {
        metalinkTextConstruct
      }
        
   metalinkVersion =
      element metalink:version {
        metalinkTextConstruct
      }
        
5. Extending Metalink
5. 扩展Metalink
5.1. Extensions from Non-Metalink Vocabularies
5.1. 非Metalink词汇表的扩展

This specification describes Metalink's XML vocabulary.

本规范描述了Metalink的XML词汇表。

5.2. Extensions to the Metalink Vocabulary
5.2. Metalink词汇表的扩展

The Metalink namespace is reserved for future forward-compatible revisions of Metalink. Future versions of this specification could add new elements and attributes to the Metalink markup vocabulary.

Metalink名称空间保留给Metalink的未来正向兼容版本。此规范的未来版本可能会向Metalink标记词汇表添加新元素和属性。

Software written to conform to this version of the specification will not be able to process such markup correctly and, in fact, will not be able to distinguish it from markup error. For the purposes of this discussion, unrecognized markup from the Metalink vocabulary will be considered "foreign markup".

按照本规范版本编写的软件将无法正确处理此类标记,事实上,也无法将其与标记错误区分开来。在本讨论中,Metalink词汇表中无法识别的标记将被视为“外来标记”。

5.3. Processing Foreign Markup
5.3. 处理外来标记

Metalink Processors that encounter foreign markup in a location that is legal according to this specification MUST ignore such foreign markup, in particular they MUST NOT stop processing or signal an error. It might be the case that the Metalink Processor is able to process the foreign markup correctly and does so. Otherwise, such markup is termed "unknown foreign markup".

根据本规范,在合法位置遇到外来标记的Metalink处理器必须忽略此类外来标记,尤其是不得停止处理或发出错误信号。可能是Metalink处理器能够正确地处理外来标记,并且能够这样做。否则,这种标记称为“未知外部标记”。

When unknown foreign markup is encountered as a child of metalink: file, metalink:metalink, Metalink Processors MAY bypass the markup and any textual content and MUST NOT change their behavior as a result of the markup's presence.

当作为metalink:file、metalink:metalink的子级遇到未知的外部标记时,metalink处理器可能会绕过该标记和任何文本内容,并且不得因标记的存在而更改其行为。

5.4. Extension Elements
5.4. 扩展元素

Metalink allows foreign markup anywhere in a Metalink document, except where it is explicitly forbidden. Child elements of metalink: file and metalink:metalink are considered Metadata elements and are described below. The role of other foreign markup is undefined by this specification.

Metalink允许在Metalink文档中的任何位置使用外来标记,除非明确禁止。metalink:file和metalink:metalink的子元素被视为元数据元素,如下所述。本规范未定义其他外部标记的角色。

5.4.1. Simple Extension Elements
5.4.1. 简单扩展元素

A Simple Extension element MUST NOT have any attributes or child elements. The element MAY contain character data or be empty. Simple Extension elements are not Language-Sensitive.

简单扩展元素不能有任何属性或子元素。元素可能包含字符数据或为空。简单的扩展元素对语言不敏感。

   simpleExtensionElement =
      element * - metalink:* {
         text
      }
        
   simpleExtensionElement =
      element * - metalink:* {
         text
      }
        

The element can be interpreted as a simple property (or name/value pair) of the parent element that encloses it. The pair consisting of the namespace URI of the element and the local name of the element can be interpreted as the name of the property. The character data content of the element can be interpreted as the value of the property. If the element is empty, then the property value can be interpreted as an empty string.

元素可以解释为包含它的父元素的简单属性(或名称/值对)。由元素的名称空间URI和元素的本地名称组成的对可以解释为属性的名称。元素的字符数据内容可以解释为属性值。如果元素为空,则属性值可以解释为空字符串。

5.4.2. Structured Extension Elements
5.4.2. 结构化扩展元素

The root element of a Structured Extension element MUST have at least one attribute or child element. It MAY have attributes, it MAY contain well-formed XML content (including character data), or it MAY be empty. Structured Extension elements are Language-Sensitive.

结构化扩展元素的根元素必须至少有一个属性或子元素。它可能具有属性,可能包含格式良好的XML内容(包括字符数据),也可能为空。结构化扩展元素对语言敏感。

   structuredExtensionElement =
      element * - metalink:* {
         (attribute * { text }+,
            (text|anyElement)*)
       | (attribute * { text }*,
          (text?, anyElement+, (text|anyElement)*))
      }
        
   structuredExtensionElement =
      element * - metalink:* {
         (attribute * { text }+,
            (text|anyElement)*)
       | (attribute * { text }*,
          (text?, anyElement+, (text|anyElement)*))
      }
        

The structure of a Structured Extension element, including the order of its child elements, could be significant.

结构化扩展元素的结构,包括其子元素的顺序,可能非常重要。

This specification does not provide an interpretation of a Structured Extension element. The syntax of the XML contained in the element (and an interpretation of how the element relates to its containing element) is defined by the specification of the Metalink extension.

本规范不提供结构化扩展元素的解释。元素中包含的XML的语法(以及元素与其包含元素的关系的解释)由Metalink扩展的规范定义。

6. IANA Considerations
6. IANA考虑
6.1. XML Namespace Registration
6.1. XML命名空间注册

This document makes use of the XML registry specified in [RFC3688]. Accordingly, IANA has made the following registration:

本文档使用[RFC3688]中指定的XML注册表。因此,IANA进行了以下注册:

Registration request for the Metalink namespace:

Metalink命名空间的注册请求:

   URI: urn:ietf:params:xml:ns:metalink
        
   URI: urn:ietf:params:xml:ns:metalink
        

Registrant Contact: See the "Authors' Addresses" section of this document.

注册人联系人:请参阅本文件的“作者地址”部分。

XML: None. Namespace URIs do not represent an XML specification.

XML:没有。命名空间URI不表示XML规范。

6.2. application/metalink4+xml MIME type
6.2. 应用程序/metalink4+xml MIME类型

A Metalink Document, when serialized as XML 1.0, can be identified with the following media type:

当序列化为XML 1.0时,可以使用以下媒体类型标识Metalink文档:

Type name: application

类型名称:应用程序

Subtype name: metalink4+xml

子类型名称:metalink4+xml

Required parameters: None.

所需参数:无。

Optional parameters:

可选参数:

"charset": This parameter has semantics identical to the charset parameter of the "application/xml" media type as specified in [RFC3023].

“charset”:此参数的语义与[RFC3023]中指定的“application/xml”媒体类型的charset参数相同。

Encoding considerations: Identical to those of "application/xml" as described in [RFC3023], Section 3.2.

编码注意事项:与[RFC3023]第3.2节中描述的“应用程序/xml”相同。

Security considerations: As defined in this specification.

安全注意事项:如本规范所定义。

In addition, as this media type uses the "+xml" convention, it shares the same security considerations as described in [RFC3023], Section 10.

此外,由于该媒体类型使用“+xml”约定,因此它具有与[RFC3023]第10节所述相同的安全注意事项。

Interoperability considerations: There are no known interoperability issues.

互操作性注意事项:不存在已知的互操作性问题。

Published specification: This specification.

已发布规范:本规范。

Applications that use this media type: File transfer applications.

使用此介质类型的应用程序:文件传输应用程序。

Additional information:

其他信息:

Magic number(s): None.

幻数:无。

File extension: .meta4

文件扩展名:.4

Macintosh File Type code: TEXT

Macintosh文件类型代码:文本

   Person and email address to contact for further information:
      Anthony Bryan <anthonybryan@gmail.com>
        
   Person and email address to contact for further information:
      Anthony Bryan <anthonybryan@gmail.com>
        

Intended usage: COMMON

预期用途:普通

Restrictions on usage: None.

使用限制:无。

   Author:  Anthony Bryan <anthonybryan@gmail.com>
        
   Author:  Anthony Bryan <anthonybryan@gmail.com>
        

Change controller: IESG

更改控制器:IESG

7. Security Considerations
7. 安全考虑

Because Metalink is an XML-based format, existing XML security mechanisms can be used to secure its content.

因为Metalink是基于XML的格式,所以可以使用现有的XML安全机制来保护其内容。

Publishers of Metalink Documents may have sound reasons for signing otherwise-unprotected content. For example, a merchant might digitally sign a Metalink that lists a file download to verify its origin. Other merchants may wish to sign and encrypt Metalink Documents that list digital songs that have been purchased. Many other examples are conceivable.

Metalink文档的发布者可能有充分的理由签署未受保护的内容。例如,商家可以对列出下载文件的Metalink进行数字签名,以验证其来源。其他商家可能希望对列出已购买数字歌曲的Metalink文档进行签名和加密。还有许多其他的例子是可以想象的。

Publishers are encouraged to offer Metalink documents via authenticated HTTP under Transport Layer Security (TLS) as specified in [RFC2818]. The choice of a secure content layer rests entirely with the content providers.

鼓励发布者按照[RFC2818]中的规定,通过传输层安全(TLS)下经过身份验证的HTTP提供Metalink文档。安全内容层的选择完全取决于内容提供商。

Publishers are also encouraged to include digital signatures of the files within the Metalink Documents, if they are available, as described in Section 4.2.13.

如第4.2.13节所述,还鼓励出版商将文件的数字签名包括在Metalink文档中(如果可用)。

Normally, a publisher is in the best position to know how strong the protective signing ought to be on their content. Thus, a publisher can choose weak or strong cryptography, and a Metalink Processor SHOULD normally accept that. There are potential applications where the Metalink Processor chooses to reject weak cryptography, but that is not envisioned as the common use case.

通常情况下,出版商最有可能知道其内容上的保护性签名应该有多强。因此,发布者可以选择弱加密或强加密,Metalink处理器通常应该接受这一点。Metalink处理器选择拒绝弱加密的潜在应用,但这并不是常见的用例。

7.1. Digital Signatures
7.1. 数字签名

The root of a Metalink Document (i.e., metalink:metalink) or any metalink:file element MAY have an Enveloped Signature, as described by XML-Signature and Syntax Processing [REC-xmldsig-core].

Metalink文档(即Metalink:Metalink)或任何Metalink:file元素的根可能具有封装的签名,如XML签名和语法处理[REC xmldsig core]所述。

Although signing and verifying signatures are both OPTIONAL, an implementation that supports either feature SHOULD implement RSA with a minimum key size of 2048 with SHA-256.

尽管签名和验证签名都是可选的,但支持这两种功能的实现应使用SHA-256实现最小密钥大小为2048的RSA。

Metalink Processors that support verifying signatures MUST reject Metalink Documents with invalid signatures.

支持验证签名的Metalink处理器必须拒绝具有无效签名的Metalink文档。

Metalink Processors MUST NOT reject a Metalink Document containing such a signature because they are not capable of verifying it; they MUST continue processing and MAY inform the user of their failure to validate the signature.

Metalink处理者不得拒绝包含此类签名的Metalink文档,因为他们无法对其进行验证;他们必须继续处理,并可能通知用户他们未能验证签名。

In other words, the presence of an element with the namespace URI "http://www.w3.org/2000/09/xmldsig#" and a local name of "Signature" as a child of the document element MUST NOT cause a Metalink Processor to fail merely because of its presence.

换句话说,名称空间URI为“”的元素的存在http://www.w3.org/2000/09/xmldsig#而作为document元素子元素的本地名称“Signature”不能仅仅因为Metalink处理器的存在而导致其失败。

Other elements in a Metalink Document MUST NOT be signed unless their definitions explicitly specify such a capability.

除非Metalink文档中的其他元素的定义明确指定了此功能,否则不能对其进行签名。

Section 6.5.1 of [REC-xmldsig-core] requires support for Canonical XML [REC-xml-c14n]. However, many - implementers do not use it because signed XML documents - enclosed in other XML documents have their signatures - broken. Thus, Metalink Processors that verify signed Metalink Documents MUST be able to canonicalize with the exclusive XML canonicalization method identified by the URI "http://www.w3.org/2001/10/xml-exc-c14n#", as specified in Exclusive XML Canonicalization [REC-xml-exc-c14n].

[REC xmldsig core]第6.5.1节要求支持规范XML[REC-XML-c14n]。然而,许多实现者不使用它,因为包含在其他XML文档中的签名XML文档的签名被破坏了。因此,验证已签名Metalink文档的Metalink处理器必须能够使用URI标识的独占XML规范化方法进行规范化。”http://www.w3.org/2001/10/xml-exc-c14n#“,如专用XML规范化[REC-XML-exc-c14n]中所述。

Section 4.4.2 of [REC-xmldsig-core] requires support for Digital Signature Algorithm (DSA) signatures and recommends support for RSA signatures. However, because of the much greater popularity in the market of RSA versus DSA, Metalink Processors that verify signed Metalink Documents MUST be able to verify RSA signatures, but do not need be able to verify DSA signatures. Due to security issues that can arise if the keying material for message authentication code (MAC) authentication is not handled properly, Metalink Documents SHOULD NOT use MACs for signatures.

[REC xmldsig core]第4.4.2节要求支持数字签名算法(DSA)签名,并建议支持RSA签名。但是,由于RSA与DSA相比在市场上更受欢迎,因此验证已签名Metalink文档的Metalink处理器必须能够验证RSA签名,但不需要能够验证DSA签名。由于如果未正确处理消息身份验证代码(MAC)身份验证的密钥材料,可能会出现安全问题,因此Metalink文档不应使用MAC进行签名。

7.2. URIs and IRIs
7.2. URI和IRIs

Metalink Processors handle URIs and IRIs. See Section 7 of [RFC3986] and Section 8 of [RFC3987] for security considerations related to their handling and use.

Metalink处理器处理URI和IRI。有关其处理和使用的安全注意事项,请参见[RFC3986]第7节和[RFC3987]第8节。

7.3. Spoofing
7.3. 欺骗

There is potential for spoofing attacks where the attacker publishes Metalink Documents with false information. Malicious publishers might create Metalink Documents containing inaccurate information anywhere in the document. Unaware downloaders could be deceived into downloading malicious or worthless content. Malicious publishers could attempt a distributed denial-of-service attack by inserting unrelated IRIs into Metalink Documents.

攻击者发布带有虚假信息的Metalink文档时,可能会发生欺骗攻击。恶意发布者可能会在文档中的任何位置创建包含不准确信息的Metalink文档。不知情的下载者可能被欺骗下载恶意或毫无价值的内容。恶意发布者可以通过在Metalink文档中插入不相关的IRIs来尝试分布式拒绝服务攻击。

Digital signatures address the issue of spoofing.

数字签名解决了欺骗问题。

7.4. Cryptographic Hashes
7.4. 加密散列

Currently, some of the hash types defined in the IANA registry named "Hash Function Textual Names" are considered insecure. These include the whole Message Digest family of algorithms that are not suitable for cryptographically strong verification. Malicious parties could provide files that appear to be identical to another file because of a collision, i.e., the weak cryptographic hashes of the intended file and a substituted malicious file could match.

目前,IANA注册表中定义的一些名为“哈希函数文本名称”的哈希类型被认为是不安全的。其中包括不适合加密强验证的整个消息摘要算法家族。恶意方可能会提供由于冲突而看起来与另一个文件相同的文件,即目标文件和替换恶意文件的弱加密哈希可能匹配。

Metalink Generators and Processors MUST support "sha-256", which is SHA-256, as specified in [FIPS-180-3], and MAY support stronger hashes.

Metalink生成器和处理器必须支持[FIPS-180-3]中指定的“sha-256”,即sha-256,并且可能支持更强的哈希。

If a Metalink Document contains hashes, it SHOULD include "sha-256", which is SHA-256, or stronger. It MAY also include other hashes from the IANA registry named "Hash Function Textual Names".

如果Metalink文档包含散列,则应包含“sha-256”,即sha-256或更高版本。它还可能包括IANA注册表中名为“哈希函数文本名称”的其他哈希。

8. References
8. 工具书类
8.1. Normative References
8.1. 规范性引用文件

[BITTORRENT] Cohen, B., "The BitTorrent Protocol Specification", BITTORRENT 11031, February 2008, <http://www.bittorrent.org/beps/bep_0003.html>.

[BITTORRENT]Cohen,B.,“BITTORRENT协议规范”,BITTORRENT 110312008年2月<http://www.bittorrent.org/beps/bep_0003.html>.

[FIPS-180-3] National Institute of Standards and Technology (NIST), "Secure Hash Standard (SHS)", FIPS PUB 180-3, October 2008.

[FIPS-180-3]国家标准与技术研究所(NIST),“安全哈希标准(SHS)”,FIPS PUB 180-3,2008年10月。

[ISO3166-1] International Organization for Standardization, "ISO 3166- 1:2006. Codes for the representation of names of countries and their subdivisions -- Part 1: Country codes", November 2006.

[ISO3166-1]国际标准化组织,“ISO 3166-1:2006.国家及其分支机构名称表示代码——第1部分:国家代码”,2006年11月。

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

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

[REC-xml-c14n] Boyer, J., "Canonical XML Version 1.0", W3C REC REC-xml-c14n-20010315, March 2001, <http://www.w3.org/TR/2001/REC-xml-c14n-20010315>.

[REC-xml-c14n]Boyer,J.,“规范xml版本1.0”,W3C REC-xml-c14n-20010315,2001年3月<http://www.w3.org/TR/2001/REC-xml-c14n-20010315>.

[REC-xml-exc-c14n] Eastlake, D., Boyer, J., and J. Reagle, "Exclusive XML Canonicalization Version 1.0", W3C REC REC-xml-exc-c14n-20020718, July 2002, <http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/>.

[REC-xml-exc-c14n]Eastlake,D.,Boyer,J.,和J.Reagle,“独家xml规范化版本1.0”,W3C REC-xml-exc-c14n-20020718,2002年7月<http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/>.

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

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

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

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

[REC-xmldsig-core] Solo, D., Reagle, J., and D. Eastlake, "XML-Signature Syntax and Processing (Second Edition)", W3C REC-xmldsig- core-20080610, June 2008, <http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/>.

[REC xmldsig core]Solo,D.,Reagle,J.,和D.Eastlake,“XML签名语法和处理(第二版)”,W3C REC xmldsig-core-20080610,2008年6月<http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/>.

[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月。

[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.

[RFC2818]Rescorla,E.,“TLS上的HTTP”,RFC2818,2000年5月。

[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月。

[RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: Timestamps", RFC 3339, July 2002.

[RFC3339]Klyne,G.和C.Newman,“互联网上的日期和时间:时间戳”,RFC 3339,2002年7月。

[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月。

[RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and Registration Procedures", BCP 13, RFC 4288, December 2005.

[RFC4288]Freed,N.和J.Klensin,“介质类型规范和注册程序”,BCP 13,RFC 4288,2005年12月。

[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, January 2008.

[RFC5234]Crocker,D.,Ed.和P.Overell,“语法规范的扩充BNF:ABNF”,STD 68,2008年1月。

[RFC5646] Phillips, A. and M. Davis, "Tags for Identifying Languages", BCP 47, RFC 5646, September 2009.

[RFC5646]Phillips,A.和M.Davis,“识别语言的标记”,BCP 47,RFC 5646,2009年9月。

8.2. Informative References
8.2. 资料性引用

[ISO.8601.1988] International Organization for Standardization, "Data elements and interchange formats - Information interchange - Representation of dates and times", ISO Standard 8601, June 1988.

[ISO.8601.1988]国际标准化组织,“数据元素和交换格式-信息交换-日期和时间的表示”,ISO标准86011988年6月。

[NOTE-datetime-19980827] Wolf, M. and C. Wicksteed, "Date and Time Formats", W3C NOTE-datetime-19980827, August 1998, <http://www.w3.org/TR/1998/NOTE-datetime-19980827>.

[NOTE-datetime-19980827]Wolf,M.和C.Wicksteed,“日期和时间格式”,W3C NOTE-datetime-19980827,1998年8月<http://www.w3.org/TR/1998/NOTE-datetime-19980827>.

[REC-xmlschema-2-20041028] Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes Second Edition", W3C REC-xmlschema-2-20041028, October 2004, <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>.

[REC-xmlschema-2-20041028]Malhotra,A.和P.Biron,“XML模式第2部分:数据类型第二版”,W3C REC-xmlschema-2-20041028,2004年10月<http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>.

[RELAX-NG] Clark, J., "RELAX NG Compact Syntax", December 2001, <http ://www.oasis-open.org/committees/relax-ng/ compact-20021121.html>.

[RELAX-NG]Clark,J.,“RELAX-NG紧凑语法”,2001年12月,<http://www.oasis-open.org/committees/RELAX-NG/Compact-20021121.html>。

[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004.

[RFC3688]Mealling,M.“IETF XML注册表”,BCP 81,RFC 3688,2004年1月。

[RFC4287] Nottingham, M. and R. Sayre, "The Atom Syndication Format", RFC 4287, December 2005.

[RFC4287]诺丁汉,M.和R.Sayre,“原子联合格式”,RFC 4287,2005年12月。

[RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. Thayer, "OpenPGP Message Format", RFC 4880, November 2007.

[RFC4880]Callas,J.,Donnerhacke,L.,Finney,H.,Shaw,D.,和R.Thayer,“OpenPGP消息格式”,RFC 48802007年11月。

Appendix A. Acknowledgements and Contributors
附录A.致谢和贡献者

The layout and shape of this document relies heavily on work pioneered in the Atom Syndication Format as specified in [RFC4287].

本文档的布局和形式在很大程度上依赖于[RFC4287]中规定的Atom联合格式的先驱工作。

The content and concepts within are a product of the Metalink community. Key contributors provided early implementations: A. Bram Neijt, Hampus Wessman, Darius Liktorius, Manuel Subredu, Michael Burford, Giorgio Maone, Nils Maier, Max Velasques, Manolo Valdes, Hayden Legendre, Frederick Cheung, Rene Leonhardt, Per Oyvind Karlsen, Matt Domsch, Yazsoft, KGet developers, Free Download Manager developers, Orbit developers, Arne Babenhauserheide, Mathias Berchtold, Xienzhenyu and TheWorld Browser developers, Xi Software, Agostino Russo, and James Antill.

其中的内容和概念是Metalink社区的产品。主要贡献者提供了早期实现:A.Bram Neijt、Hampus Wessman、Darius Liktorius、Manuel Subredu、Michael Burford、Giorgio Maone、Nils Maier、Max Velasques、Manolo Valdes、Hayden Legendre、Frederick Cheung、Rene Leonhardt、Per Oyvind Karlsen、Matt Domsch、Yazsoft、KGet开发者、免费下载管理器开发者、轨道开发者、,Arne Babenhauserheide、Mathias Berchtold、谢振宇和世界浏览器开发者、席软件、Agostino Russo和James Antill。

The Metalink community has dozens of contributors who contributed to the evolution of Metalink or proposed ideas and wording for this document, including:

Metalink社区有几十位贡献者,他们对Metalink的发展做出了贡献,或者为本文档提出了一些想法和措辞,包括:

Paul Burkhead, Kristian Weston, Nicolas Alvarez, Urs Wolfer, Bridget and Ethan Fletcher, Patrick Ruckstuhl, Sebastien Willemijns, Micah Cowan, Ruben Kerkhof, Danny Ayers, Nick Dominguez, Gary Zellerbach, James Clark, Daniel Stenberg, John and Sandra Sowder, Salvatore Musumeci, Steve Eshelman, Lucas Hewett, Ryan Cronin, Dave Winquist, Bob Denison, Wes Shelton, Josh Colbert, Steve Kleisath, Chad Neptune, Derick Cordoba, Nick Carrabba, Chris Carrabba, Erin Solari, Ryan Alexander, Tom Mainville, Janie Wargo, Jason Hansen, Tim Bray, Dan Brickley, Markus Hofmann, Dan Connolly, Tim Berners-Lee, Louis Suarez-Potts, Ross Smith, Jeff Covey, Ed Lee, Shawn Wilsher, Mike Connor, Johan Svedberg, Kees Cook, Dedric Carter, and Debi Goulding. We also thank the Anthony Family, the Bryan Family, Juanita Anthony, and Zimmy Bryan.

保罗·伯克海德、克里斯蒂安·韦斯顿、尼古拉斯·阿尔瓦雷斯、乌斯·沃尔夫、布里奇特和伊桑·弗莱彻、帕特里克·拉克斯图尔、塞巴斯蒂安·威勒米恩斯、迈卡·考恩、鲁本·科霍夫、丹尼·艾尔斯、尼克·多明格斯、加里·泽勒巴赫、詹姆斯·克拉克、丹尼尔·斯滕伯格、约翰和桑德拉·索德、萨尔瓦托·穆苏梅奇、史蒂夫·埃舍尔曼、卢卡斯·休伊特、瑞安·克罗宁、戴夫·温奎斯特、鲍勃·丹尼森、,韦斯·谢尔顿、乔什·科尔伯特、史蒂夫·克莱斯、查德·内普顿、德里克·科尔多瓦、尼克·卡拉巴、克里斯·卡拉巴、艾琳·索拉里、瑞安·亚历山大、汤姆·梅因维尔、詹妮·沃戈、杰森·汉森、蒂姆·布雷、丹·布里克利、马库斯·霍夫曼、丹·康诺利、蒂姆·伯纳斯·李、路易斯·苏亚雷斯·波茨、罗斯·史密斯、杰夫·科维、埃德·李、肖恩·威尔希尔、迈克·康纳、约翰·斯维德伯格、,Kees Cook、Dedric Carter和Debi Goulding。我们还要感谢安东尼家族、布莱恩家族、胡安妮塔·安东尼和齐米·布莱恩。

Special thanks to Eran Hammer-Lahav, document shepherd, and Lisa Dusseault, Area Director. We also thank the following contributors for assistance and review: Mark Nottingham, Peter Saint-Andre, Julian Reschke, Chris Newman, Ian Macfarlane, Dave Cridland, Barry Leiba, Uri Blumenthal, Paul Hoffman, Felix Sasaki, Matthias Fuchs, Mark Baker, Scott Cantor, Brian Carpenter, Alexey Melnikov, Lars Eggert, Pasi Eronen, Tim Polk, Dan Romascanu, and Bjoern Hoehrmann.

特别感谢文件守护者埃兰·哈默·拉哈夫和地区总监丽莎·杜肖尔。我们还感谢以下贡献者的帮助和评论:马克·诺丁汉、彼得·圣安德烈、朱利安·雷什克、克里斯·纽曼、伊恩·麦克法兰、戴夫·克里德兰、巴里·莱巴、乌里·布卢门塔尔、保罗·霍夫曼、菲利克斯·萨萨基、马蒂亚斯·福斯、马克·贝克、斯科特·坎托、布赖恩·卡彭特、阿列克西·梅尔尼科夫、拉尔斯·艾格特、帕西·埃隆、蒂姆·波尔克和罗马斯坎努,和比约恩·霍尔曼。

Peter Poeml wishes to acknowledge the support of SUSE Linux Products GmbH / Novell Inc., where he was employed during much of the work on this document.

Peter Poeml希望感谢SUSE Linux Products GmbH/Novell Inc.的支持,他在本文档的大部分工作中受雇于该公司。

This document is dedicated to Sonora Bryan.

本文件献给索诺拉·布莱恩。

Appendix B. RELAX NG Compact Schema
附录B.RELAXNG紧凑模式

This appendix is informative.

本附录为资料性附录。

The Relax NG schema explicitly excludes elements in the Metalink namespace that are not defined in this revision of the specification. Requirements for Metalink Processors encountering such markup are given in Sections 5.2 and 5.3.

Relax NG模式明确排除了Metalink命名空间中未在本规范修订版中定义的元素。第5.2和5.3节给出了遇到此类标记的Metalink处理器的要求。

   # -*- rnc -*-
   # RELAX NG Compact Syntax Grammar for the
   # Metalink Format Specification Version 4
   # Based on RFC 4287 schema
        
   # -*- rnc -*-
   # RELAX NG Compact Syntax Grammar for the
   # Metalink Format Specification Version 4
   # Based on RFC 4287 schema
        
   namespace local = ""
   namespace metalink = "urn:ietf:params:xml:ns:metalink"
   namespace xsd = "http://www.w3.org/2001/XMLSchema"
        
   namespace local = ""
   namespace metalink = "urn:ietf:params:xml:ns:metalink"
   namespace xsd = "http://www.w3.org/2001/XMLSchema"
        

# Common attributes

#共同属性

   metalinkCommonAttributes =
      attribute xml:lang { metalinkLanguageTag }?,
      undefinedAttribute*
        
   metalinkCommonAttributes =
      attribute xml:lang { metalinkLanguageTag }?,
      undefinedAttribute*
        

# Text Constructs

#文本结构

metalinkTextConstruct = metalinkCommonAttributes, text

metalinkTextConstruct=metalinkCommonAttributes,text

# Date Construct

#日期结构

metalinkDateConstruct = metalinkCommonAttributes, xsd:dateTime

metalinkDateConstruct=metalinkCommonAttributes,xsd:dateTime

   start = metalinkMetalink
        
   start = metalinkMetalink
        
   metalinkMetalink =
      element metalink:metalink {
         metalinkCommonAttributes,
         (metalinkFile+
          & metalinkGenerator?
          & metalinkOrigin?
          & metalinkPublished?
          & metalinkUpdated?
          & extensionElement*)
      }
        
   metalinkMetalink =
      element metalink:metalink {
         metalinkCommonAttributes,
         (metalinkFile+
          & metalinkGenerator?
          & metalinkOrigin?
          & metalinkPublished?
          & metalinkUpdated?
          & extensionElement*)
      }
        
   metalinkFile =
      element metalink:file {
         metalinkCommonAttributes,
         attribute name { text },
         (metalinkCopyright?
          & metalinkDescription?
          & metalinkHash*
          & metalinkIdentity?
          & metalinkLanguage*
          & metalinkLogo?
          & metalinkMetaURL*
          & metalinkOS*
          & metalinkPieces*
          & metalinkPublisher?
          & metalinkSignature?
          & metalinkSize?
          & metalinkURL*
          & metalinkVersion?
          & extensionElement*)
      }
        
   metalinkFile =
      element metalink:file {
         metalinkCommonAttributes,
         attribute name { text },
         (metalinkCopyright?
          & metalinkDescription?
          & metalinkHash*
          & metalinkIdentity?
          & metalinkLanguage*
          & metalinkLogo?
          & metalinkMetaURL*
          & metalinkOS*
          & metalinkPieces*
          & metalinkPublisher?
          & metalinkSignature?
          & metalinkSize?
          & metalinkURL*
          & metalinkVersion?
          & extensionElement*)
      }
        
   metalinkPieces =
      element metalink:pieces {
         attribute length { xsd:positiveInteger },
         attribute type { text },
         metalinkHash+
      }
        
   metalinkPieces =
      element metalink:pieces {
         attribute length { xsd:positiveInteger },
         attribute type { text },
         metalinkHash+
      }
        
   metalinkCopyright =
      element metalink:copyright {
         metalinkTextConstruct
      }
        
   metalinkCopyright =
      element metalink:copyright {
         metalinkTextConstruct
      }
        
   metalinkDescription =
      element metalink:description {
         metalinkTextConstruct
      }
        
   metalinkDescription =
      element metalink:description {
         metalinkTextConstruct
      }
        
   metalinkGenerator =
      element metalink:generator {
         metalinkTextConstruct
      }
        
   metalinkGenerator =
      element metalink:generator {
         metalinkTextConstruct
      }
        
   metalinkHash =
        element metalink:hash {
          attribute type { text }?,
          text
        }
        
   metalinkHash =
        element metalink:hash {
          attribute type { text }?,
          text
        }
        
   metalinkIdentity =
      element metalink:identity {
         metalinkTextConstruct
      }
        
   metalinkIdentity =
      element metalink:identity {
         metalinkTextConstruct
      }
        
   metalinkLanguage =
      element metalink:language {
         metalinkTextConstruct
      }
        
   metalinkLanguage =
      element metalink:language {
         metalinkTextConstruct
      }
        
   metalinkLogo =
      element metalink:logo {
         metalinkCommonAttributes,
         (metalinkUri)
      }
        
   metalinkLogo =
      element metalink:logo {
         metalinkCommonAttributes,
         (metalinkUri)
      }
        
   metalinkMetaURL =
      element metalink:metaurl {
         metalinkCommonAttributes,
         attribute priority { xsd:positiveInteger {
            maxInclusive = "999999"}}?,
         attribute mediatype { text },
         attribute name { text }?,
         (metalinkUri)
      }
        
   metalinkMetaURL =
      element metalink:metaurl {
         metalinkCommonAttributes,
         attribute priority { xsd:positiveInteger {
            maxInclusive = "999999"}}?,
         attribute mediatype { text },
         attribute name { text }?,
         (metalinkUri)
      }
        
   metalinkOrigin =
      element metalink:origin {
         metalinkCommonAttributes,
         attribute dynamic { xsd:boolean }?,
         (metalinkUri)
      }
        
   metalinkOrigin =
      element metalink:origin {
         metalinkCommonAttributes,
         attribute dynamic { xsd:boolean }?,
         (metalinkUri)
      }
        
   metalinkOS =
      element metalink:os {
         metalinkTextConstruct
      }
        
   metalinkOS =
      element metalink:os {
         metalinkTextConstruct
      }
        
   metalinkPublished =
      element metalink:published {
         metalinkDateConstruct
      }
        
   metalinkPublished =
      element metalink:published {
         metalinkDateConstruct
      }
        
   metalinkPublisher =
      element metalink:publisher {
         metalinkCommonAttributes,
         attribute name { text },
         attribute url { metalinkUri }?
        
   metalinkPublisher =
      element metalink:publisher {
         metalinkCommonAttributes,
         attribute name { text },
         attribute url { metalinkUri }?
        

}

}

   metalinkSignature =
      element metalink:signature {
         attribute mediatype { text },
         metalinkTextConstruct
      }
        
   metalinkSignature =
      element metalink:signature {
         attribute mediatype { text },
         metalinkTextConstruct
      }
        
   metalinkSize =
      element metalink:size {
         xsd:nonNegativeInteger
      }
        
   metalinkSize =
      element metalink:size {
         xsd:nonNegativeInteger
      }
        
   metalinkUpdated =
      element metalink:updated {
         metalinkDateConstruct
      }
        
   metalinkUpdated =
      element metalink:updated {
         metalinkDateConstruct
      }
        
   metalinkURL =
      element metalink:url {
         metalinkCommonAttributes,
         attribute location { xsd:string {
            minLength = "2"  maxLength="2"}
         }?,
         attribute priority { xsd:positiveInteger {
            maxInclusive = "999999"}}?,
         (metalinkUri)
      }
        
   metalinkURL =
      element metalink:url {
         metalinkCommonAttributes,
         attribute location { xsd:string {
            minLength = "2"  maxLength="2"}
         }?,
         attribute priority { xsd:positiveInteger {
            maxInclusive = "999999"}}?,
         (metalinkUri)
      }
        
   metalinkVersion =
      element metalink:version {
         metalinkTextConstruct
      }
        
   metalinkVersion =
      element metalink:version {
         metalinkTextConstruct
      }
        
   # As defined in RFC 3066 and compatible with RFC 5646
   metalinkLanguageTag = xsd:string {
      pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*"
   }
        
   # As defined in RFC 3066 and compatible with RFC 5646
   metalinkLanguageTag = xsd:string {
      pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*"
   }
        
   # Unconstrained; it's not entirely clear how IRI fit into
   # xsd:anyURI so let's not try to constrain it here
   metalinkUri = text
        
   # Unconstrained; it's not entirely clear how IRI fit into
   # xsd:anyURI so let's not try to constrain it here
   metalinkUri = text
        

# Simple Extension

#简单扩展

   simpleExtensionElement =
      element * - metalink:* {
         text
        
   simpleExtensionElement =
      element * - metalink:* {
         text
        

}

}

# Structured Extension

#结构化扩展

   structuredExtensionElement =
      element * - metalink:* {
         (attribute * { text }+,
            (text|anyElement)*)
       | (attribute * { text }*,
          (text?, anyElement+, (text|anyElement)*))
      }
        
   structuredExtensionElement =
      element * - metalink:* {
         (attribute * { text }+,
            (text|anyElement)*)
       | (attribute * { text }*,
          (text?, anyElement+, (text|anyElement)*))
      }
        

# Other Extensibility

#其他扩展性

extensionElement = simpleExtensionElement | structuredExtensionElement

extensionElement=simpleExtensionElement | StructureXtensionElement

   undefinedAttribute =
     attribute * - (xml:lang | local:*) { text }
        
   undefinedAttribute =
     attribute * - (xml:lang | local:*) { text }
        
   undefinedContent = (text|anyForeignElement)*
        
   undefinedContent = (text|anyForeignElement)*
        
   anyElement =
      element * {
         (attribute * { text }
          | text
          | anyElement)*
      }
        
   anyElement =
      element * {
         (attribute * { text }
          | text
          | anyElement)*
      }
        
   anyForeignElement =
      element * - metalink:* {
         (attribute * { text }
          | text
          | anyElement)*
   }
        
   anyForeignElement =
      element * - metalink:* {
         (attribute * { text }
          | text
          | anyElement)*
   }
        

# EOF

#EOF

Index

指数

A ABNF metalinkGenerator 13 metaurl mediatype 17 signature mediatype 19 application/metalink4+xml Media Type 23

ABNF metalinkGenerator 13元URL媒体类型17签名媒体类型19应用程序/metalink4+xml媒体类型23

C copyright XML element 12

C版权所有XML元素12

D description XML element 13

D描述XML元素13

F file XML element 10

F文件XML元素10

G generator XML element 13 Grammar metalinkCommonAttributes 7 metalinkCopyright 13 metalinkDateConstruct 8 metalinkDescription 13 metalinkFile 10 metalinkGenerator 13 metalinkHash 14 metalinkIdentity 15 metalinkLanguage 15 metalinkLogo 16 metalinkMetalink 8 metalinkMetaURL 16 metalinkOrigin 17 metalinkOS 18 metalinkPieces 12 metalinkPublished 18 metalinkPublisher 18 metalinkSignature 19 metalinkSize 20 metalinkTextConstruct 7 metalinkUpdated 20 metalinkURL 21 metalinkVersion 21 simpleExtensionElement 22 structuredExtensionElement 23

G生成器XML元素13语法metalinkCommonAttributes 7 Metalink版权13 MetalinkDate构造8 metalinkDescription 13 metalinkFile 10 metalinkGenerator 13 metalinkHash 14 metalinkIdentity 15 metalinkLanguage 15 metalinkLogo 16 MetalinkMetalinkMetalink 8 MetalinkMetalinkURL 16 metalinkOrigin 17 metalinkOS 18 Metalink 12 Metalink发布18metalinkPublisher 18 metalinkSignature 19 metalinkSize 20 metalinkTextConstruct 7 metalink更新20 metalinkURL 21 metalinkVersion 21 simpleExtensionElement 22 structuredExtensionElement 23

H hash XML element 14

H散列XML元素14

I identity XML element 15

I标识XML元素15

L language XML element 15 logo XML element 16

L语言XML元素15徽标XML元素16

M Media Type application/metalink4+xml 23 metalink XML element 8 metalinkCommonAttributes grammar production 7 metalinkCopyright grammar production 12 metalinkDateConstruct grammar production 8 metalinkDescription grammar production 13 metalinkFile grammar production 10 metalinkGenerator ABNF 13 metalinkGenerator grammar production 13 metalinkHash grammar production 14 metalinkIdentity grammar production 15 metalinkLanguage grammar production 15 metalinkLogo grammar production 16 metalinkMetalink grammar production 8 metalinkMetaURL grammar production 16 metalinkOrigin grammar production 17 metalinkOS grammar production 18 metalinkPieces grammar production 12 metalinkPublished grammar production 18 metalinkPublisher grammar production 18 metalinkSignature grammar production 19 metalinkSize grammar production 20 metalinkTextConstruct grammar production 7 metalinkUpdated grammar production 20 metalinkURL grammar production 21 metalinkVersion grammar production 21 metaurl mediatype ABNF 16 metaurl XML element 16

M媒体类型应用程序/metalink4+xml 23 metalink xml元素8 metalinkCommonAttributes语法生成7 metalink版权语法生成12 metalinkdate构造语法生成8 metalinkDescription语法生成13 metalinkFile语法生成10 metalinkGenerator ABNF 13 metalinkGenerator语法生成13 metalinkHash语法制作14 metalinkIdentity语法制作15 metalinkLanguage语法制作15 metalinkLogo语法制作16 metalinkMetalink语法制作8 metalinkMetaURL语法制作16 metalinkOrigin语法制作17 metalinkOS语法制作18 metalinkPieces语法制作12 metalinkPublished语法产品18 metalinkPublisher语法产品18 metalinkSignature语法产品19 metalinkSize语法产品20 MetalinkTextConstruction语法产品7 metalinkUpdated语法产品20 metalinkURL语法产品21 metalinkVersion语法产品21 metaurl mediatype ABNF 16 metaurl XML元素16

O origin XML element 17 os XML element 18

O源XML元素17 os XML元素18

P pieces XML element 12 published XML element 18 publisher XML element 18

P片段XML元素12发布的XML元素18发布者XML元素18

S signature mediatype ABNF 19 signature XML element 19 simpleExtensionElement grammar production 22 size XML element 20 structuredExtensionElement grammar production 23

S signature mediatype ABNF 19 signature XML元素19 simpleExtensionElement语法生成22大小XML元素20 StructureXtensionElement语法生成23

U updated XML element 20 url XML element 20

U更新的XML元素20 url XML元素20

V version XML element 21

V版本XML元素21

X XML Elements copyright 12 description 13 file 9 generator 13 hash 14 identity 15 language 15 logo 16 metalink 8 metaurl 16 origin 17 os 18 pieces 12 published 18 publisher 18 signature 19 size 20 updated 20 url 20 version 21

X XML元素版权所有12描述13文件9生成器13散列14身份15语言15徽标16 metalink 8 metaurl 16来源17操作系统18件12已发布18出版商18签名19尺寸20已更新20 url 20版本21

Authors' Addresses

作者地址

Anthony Bryan Pompano Beach, FL USA

安东尼·布莱恩·蓬帕诺海滩,美国佛罗里达州

   EMail: anthonybryan@gmail.com
   URI:   http://www.metalinker.org
        
   EMail: anthonybryan@gmail.com
   URI:   http://www.metalinker.org
        

Tatsuhiro Tsujikawa Shiga Japan

日本筑川志贺达广

   EMail: tatsuhiro.t@gmail.com
   URI:   http://aria2.sourceforge.net
        
   EMail: tatsuhiro.t@gmail.com
   URI:   http://aria2.sourceforge.net
        

Neil McNab San Diego, CA USA

美国加利福尼亚州圣地亚哥尼尔·麦克纳布

   EMail: neil@nabber.org
   URI:   http://www.nabber.org
        
   EMail: neil@nabber.org
   URI:   http://www.nabber.org
        

Dr. med. Peter Poeml MirrorBrain Venloer Str. 317 Koeln 50823 DE

梅德博士。Peter Poeml Mirrorbain Venlore街317号Koeln 50823 DE

   Phone: +49 221 6778 333 8
   EMail: peter@poeml.de
   URI:   http://mirrorbrain.org/~poeml/
        
   Phone: +49 221 6778 333 8
   EMail: peter@poeml.de
   URI:   http://mirrorbrain.org/~poeml/