idnits 2.17.1 draft-bryan-metalink-17.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** The document seems to lack a License Notice according IETF Trust Provisions of 28 Dec 2009, Section 6.b.ii or Provisions of 12 Sep 2009 Section 6.b -- however, there's a paragraph with a matching beginning. Boilerplate error? (You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Feb 2009 rather than one of the newer Notices. See https://trustee.ietf.org/license-info/.) Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (September 29, 2009) is 5320 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'BITTORRENT' -- Possible downref: Non-RFC (?) normative reference: ref. 'ISO3166-1' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xml' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xml-infoset' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xml-names' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xmlbase' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xmldsig-core' ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 3023 (Obsoleted by RFC 7303) ** Downref: Normative reference to an Informational RFC: RFC 3174 ** Obsolete normative reference: RFC 4646 (Obsoleted by RFC 5646) Summary: 5 errors (**), 0 flaws (~~), 1 warning (==), 10 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Bryan, Ed. 3 Internet-Draft T. Tsujikawa 4 Intended status: Standards Track N. McNab 5 Expires: April 2, 2010 Metalinker Project 6 P. Poeml 7 Novell, Inc. 8 September 29, 2009 10 The Metalink Download Description Format 11 draft-bryan-metalink-17 13 Status of this Memo 15 This Internet-Draft is submitted to IETF in full conformance with the 16 provisions of BCP 78 and BCP 79. This document may contain material 17 from IETF Documents or IETF Contributions published or made publicly 18 available before November 10, 2008. The person(s) controlling the 19 copyright in some of this material may not have granted the IETF 20 Trust the right to allow modifications of such material outside the 21 IETF Standards Process. Without obtaining an adequate license from 22 the person(s) controlling the copyright in such materials, this 23 document may not be modified outside the IETF Standards Process, and 24 derivative works of it may not be created outside the IETF Standards 25 Process, except to format it for publication as an RFC or to 26 translate it into languages other than English. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF), its areas, and its working groups. Note that 30 other groups may also distribute working documents as Internet- 31 Drafts. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 The list of current Internet-Drafts can be accessed at 39 http://www.ietf.org/ietf/1id-abstracts.txt. 41 The list of Internet-Draft Shadow Directories can be accessed at 42 http://www.ietf.org/shadow.html. 44 This Internet-Draft will expire on April 2, 2010. 46 Copyright Notice 48 Copyright (c) 2009 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents in effect on the date of 53 publication of this document (http://trustee.ietf.org/license-info). 54 Please review these documents carefully, as they describe your rights 55 and restrictions with respect to this document. 57 Abstract 59 This document specifies Metalink, an XML-based download description 60 format. Metalink describes alternate download locations (mirrors), 61 checksums, and other information. Clients can transparently use this 62 information to reliably transfer files. 64 Table of Contents 66 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 67 1.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 5 68 1.2. Namespace and Version . . . . . . . . . . . . . . . . . . 5 69 1.3. Notational Conventions . . . . . . . . . . . . . . . . . . 6 70 2. Metalink Documents . . . . . . . . . . . . . . . . . . . . . . 6 71 3. Common Metalink Constructs . . . . . . . . . . . . . . . . . . 7 72 3.1. Text Constructs . . . . . . . . . . . . . . . . . . . . . 8 73 3.1.1. Text . . . . . . . . . . . . . . . . . . . . . . . . . 8 74 3.2. Date Constructs . . . . . . . . . . . . . . . . . . . . . 8 75 4. Metalink Element Definitions . . . . . . . . . . . . . . . . . 9 76 4.1. Container Elements . . . . . . . . . . . . . . . . . . . . 9 77 4.1.1. The "metalink:metalink" Element . . . . . . . . . . . 9 78 4.1.2. The "metalink:file" Element . . . . . . . . . . . . . 10 79 4.1.3. The "metalink:pieces" Element . . . . . . . . . . . . 12 80 4.2. Metadata Elements . . . . . . . . . . . . . . . . . . . . 12 81 4.2.1. The "metalink:copyright" Element . . . . . . . . . . . 12 82 4.2.2. The "metalink:description" Element . . . . . . . . . . 13 83 4.2.3. The "metalink:dynamic" Element . . . . . . . . . . . . 13 84 4.2.4. The "metalink:generator" Element . . . . . . . . . . . 13 85 4.2.5. The "metalink:hash" Element . . . . . . . . . . . . . 13 86 4.2.6. The "metalink:identity" Element . . . . . . . . . . . 15 87 4.2.7. The "metalink:language" Element . . . . . . . . . . . 15 88 4.2.8. The "metalink:license" Element . . . . . . . . . . . . 15 89 4.2.9. The "metalink:logo" Element . . . . . . . . . . . . . 16 90 4.2.10. The "metalink:metaurl" Element . . . . . . . . . . . . 16 91 4.2.11. The "metalink:origin" Element . . . . . . . . . . . . 17 92 4.2.12. The "metalink:os" Element . . . . . . . . . . . . . . 17 93 4.2.13. The "metalink:published" Element . . . . . . . . . . . 17 94 4.2.14. The "metalink:publisher" Element . . . . . . . . . . . 18 95 4.2.15. The "metalink:signature" Element . . . . . . . . . . . 18 96 4.2.16. The "metalink:size" Element . . . . . . . . . . . . . 19 97 4.2.17. The "metalink:updated" Element . . . . . . . . . . . . 19 98 4.2.18. The "metalink:url" Element . . . . . . . . . . . . . . 19 99 4.2.19. The "metalink:version" Element . . . . . . . . . . . . 20 100 5. Securing Metalink Documents . . . . . . . . . . . . . . . . . 20 101 6. Extending Metalink . . . . . . . . . . . . . . . . . . . . . . 20 102 6.1. Extensions from Non-Metalink Vocabularies . . . . . . . . 20 103 6.2. Extensions to the Metalink Vocabulary . . . . . . . . . . 21 104 6.3. Processing Foreign Markup . . . . . . . . . . . . . . . . 21 105 6.4. Extension Elements . . . . . . . . . . . . . . . . . . . . 21 106 6.4.1. Simple Extension Elements . . . . . . . . . . . . . . 21 107 6.4.2. Structured Extension Elements . . . . . . . . . . . . 22 108 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22 109 7.1. XML Namespace Registration . . . . . . . . . . . . . . . . 22 110 7.2. application/metalink4+xml MIME type . . . . . . . . . . . 23 111 8. Security Considerations . . . . . . . . . . . . . . . . . . . 23 112 8.1. URIs and IRIs . . . . . . . . . . . . . . . . . . . . . . 24 113 8.2. Spoofing . . . . . . . . . . . . . . . . . . . . . . . . . 24 114 8.3. Cryptographic Hashes . . . . . . . . . . . . . . . . . . . 24 115 8.4. Signing . . . . . . . . . . . . . . . . . . . . . . . . . 24 116 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 24 117 9.1. Normative References . . . . . . . . . . . . . . . . . . . 24 118 9.2. Informative References . . . . . . . . . . . . . . . . . . 26 119 Appendix A. Acknowledgements and Contributors . . . . . . . . . . 26 120 Appendix B. RELAX NG Compact Schema . . . . . . . . . . . . . . . 27 121 Appendix C. Document History (to be removed by RFC Editor 122 before publication) . . . . . . . . . . . . . . . . . 32 123 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 124 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 37 126 1. Introduction 128 Metalink is an XML-based document format that describes a file or 129 list of files to be added to a download queue. Metalinks can list a 130 number of files, each with an extensible set of attached metadata. 131 For example, each file can have a description, checksum, and list of 132 URIs that it is available from. 134 Identical copies of a file are frequently accessible in multiple 135 locations on the Internet over a variety of protocols (FTP, HTTP, and 136 Peer-to-Peer). In some cases, Users are shown a list of these 137 multiple download locations (mirrors) and must manually select a 138 single one on the basis of geographical location, priority, or 139 bandwidth. This distributes the load across multiple servers. At 140 times, individual servers can be slow, outdated, or unreachable, but 141 this can not be determined until the download has been initiated. 142 This can lead to the user canceling the download and needing to 143 restart it. During downloads, errors in transmission can corrupt the 144 file. There are no easy ways to repair these files. For large 145 downloads this can be extremely troublesome. Any of the number of 146 problems that can occur during a download lead to frustration on the 147 part of users. 149 All the information about a download, including mirrors, checksums, 150 digital signatures, and more can be stored in a machine-readable 151 Metalink file. This Metalink file transfers the knowledge of the 152 download server (and mirror database) to the client. Clients can 153 fallback to alternate mirrors if the current one has an issue. With 154 this knowledge, the client is enabled to work its way to a successful 155 download even under adverse circumstances. All this is done 156 transparently to the user and the download is much more reliable and 157 efficient. In contrast, a traditional HTTP redirect to a mirror 158 conveys only extremely minimal information - one link to one server, 159 and there is no provision in the HTTP protocol to handle failures. 160 Other features that some clients provide include multi-source 161 downloads, where chunks of a file are downloaded from multiple 162 mirrors (and optionally, Peer-to-Peer) simultaneously, which 163 frequently results in a faster download. Metalinks also provide 164 structured information about downloads that can be indexed by search 165 engines. 167 [[ Discussion of this draft should take place on 168 discuss@apps.ietf.org or the Metalink discussion mailing list located 169 at metalink-discussion@googlegroups.com. To join the list, visit 170 http://groups.google.com/group/metalink-discussion . ]] 172 1.1. Examples 174 A brief, single file Metalink Document: 176 177 178 179 ftp://ftp.example.com/example.ext 180 http://example.com/example.ext 181 182 http://example.com/example.ext.torrent 183 184 185 187 A more extensive, single file Metalink Document: 189 190 191 2009-05-15T12:23:23Z 192 193 Example 194 1.0 195 en 196 A description of the example file for 197 download. 198 199 80bc95fd391772fa61c91ed68567f0980bb45fd9 200 201 ftp://ftp.example.com/example.ext 202 203 http://example.com/example.ext 204 205 http://example.com/example.ext.torrent 206 207 208 210 1.2. Namespace and Version 212 The XML Namespaces URI [REC-xml-names] for the XML data format 213 described in this specification is: 215 urn:ietf:params:xml:ns:metalink 217 For convenience, this data format may be referred to as "Metalink", 218 which this specification uses internally. 220 1.3. Notational Conventions 222 This specification describes conformance of Metalink Documents. 223 Additionally, it places some requirements on Metalink Processors. 225 This specification uses the namespace prefix "metalink:" for the 226 Namespace URI identified in Section 1.2, above. Note that the choice 227 of namespace prefix is arbitrary and not semantically significant. 229 Metalink is specified using terms from the XML Infoset 230 [REC-xml-infoset]. However, this specification uses a shorthand for 231 two common terms: the phrase "Information Item" is omitted when 232 naming Element Information Items and Attribute Information Items. 233 Therefore, when this specification uses the term "element," it is 234 referring to an Element Information Item in Infoset terms. Likewise, 235 when it uses the term "attribute," it is referring to an Attribute 236 Information Item. 238 Some sections of this specification are illustrated with fragments of 239 a non-normative RELAX NG Compact schema [RELAX-NG]. However, the 240 text of this specification provides the definition of conformance. A 241 complete schema appears in Appendix B. 243 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 244 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 245 document are to be interpreted as described in BCP 14, [RFC2119], as 246 scoped to those conformance targets. 248 2. Metalink Documents 250 This specification describes Metalink Documents. 252 A Metalink Document describes a file or group of files, how to access 253 them, and metadata that identifies them. Its root is the metalink: 254 metalink element. 256 namespace metalink = "urn:ietf:params:xml:ns:metalink" 257 start = metalinkMetalink 259 Metalink Documents are specified in terms of the XML Information Set, 260 serialized as XML 1.0 [REC-xml] and identified with the "application/ 261 metalink4+xml" media type. 263 Metalink Documents MUST be well-formed XML. This specification does 264 not define a DTD for Metalink Documents, and hence does not require 265 them to be valid (in the sense used by XML). 267 Metalink allows the use of IRIs, encoded according to [RFC3987]. 268 Every URI [RFC3986] is also an IRI, so a URI may be used wherever 269 below an IRI is named. There is one special consideration: when an 270 IRI that is not also a URI is given for dereferencing, it MUST be 271 mapped to a URI using the steps in Section 3.1 of [RFC3987]. 273 Any element defined by this specification MAY have an xml:base 274 attribute [REC-xmlbase]. When xml:base is used in an Metalink 275 Document, it serves the function described in Section 5.1.1 of 276 [RFC3986], establishing the base URI (or IRI) for resolving any 277 relative references found within the effective scope of the xml:base 278 attribute. 280 Any element defined by this specification MAY have an xml:lang 281 attribute, whose content indicates the natural language for the 282 element and its descendents. The language context is only 283 significant for elements and attributes declared to be "Language- 284 Sensitive" by this specification. Requirements regarding the content 285 and interpretation of xml:lang are specified in XML 1.0 [REC-xml], 286 Section 2.12. 288 metalinkCommonAttributes = 289 attribute xml:base { metalinkUri }?, 290 attribute xml:lang { metalinkLanguageTag }?, 291 undefinedAttribute* 293 Metalink is an extensible format. See Section 6 of this document for 294 a full description of how Metalink Documents can be extended. 296 3. Common Metalink Constructs 298 Many of Metalink's elements share a few common structures. This 299 section defines those structures and their requirements for 300 convenient reference by the appropriate element definitions. 302 When an element is identified as being a particular kind of 303 construct, it inherits the corresponding requirements from that 304 construct's definition in this section. 306 Note that there MUST NOT be any white space in a Date construct or in 307 any IRI. Some XML-emitting implementations erroneously insert white 308 space around values by default, and such implementations will emit 309 invalid Metalink Documents. 311 3.1. Text Constructs 313 A Text construct contains human-readable text, usually in small 314 quantities. The content of Text constructs is Language-Sensitive. 316 metalinkTextConstruct = 317 metalinkCommonAttributes, 318 text 320 3.1.1. Text 322 Example metalink:description with text content: 324 ... 325 326 A description of the example file for download. 327 328 ... 330 The content of the Text construct MUST NOT contain child elements. 331 Such text is intended to be presented to humans in a readable 332 fashion. Thus, white space could be collapsed (including line 333 breaks) and text could be displayed using typographic techniques such 334 as justification and proportional fonts. 336 3.2. Date Constructs 338 A Date construct is an element whose content MUST conform to the 339 "date-time" production in [RFC3339]. In addition, an uppercase "T" 340 character MUST be used to separate date and time, and an uppercase 341 "Z" character MUST be present in the absence of a numeric time zone 342 offset. 344 metalinkDateConstruct = 345 metalinkCommonAttributes, 346 xsd:dateTime 348 Such date values happen to be compatible with the following 349 specifications: [ISO.8601.1988], [W3C.NOTE-datetime-19980827], and 350 [W3C.REC-xmlschema-2-20041028]. 352 Example Date constructs: 354 2009-05-15T18:30:02Z 355 2009-05-15T18:30:02.25Z 356 2009-05-15T18:30:02+01:00 357 2009-05-15T18:30:02.25+01:00 358 Date values SHOULD be as accurate as possible. For example, it would 359 be generally inappropriate for a publishing system to apply the same 360 timestamp to several Metalink Documents that were published during 361 the course of a single day. 363 4. Metalink Element Definitions 365 4.1. Container Elements 367 4.1.1. The "metalink:metalink" Element 369 The "metalink:metalink" element is the document (i.e., top-level) 370 element of a Metalink Document, acting as a container for metadata 371 and data associated with the listed files. It contains one or more 372 metalink:file child elements which consist of metadata elements. 374 metalinkMetalink = 375 element metalink:metalink { 376 metalinkCommonAttributes, 377 (metalinkDynamic? 378 & metalinkFile+ 379 & metalinkGenerator? 380 & metalinkOrigin? 381 & metalinkPublished? 382 & metalinkUpdated? 383 & extensionElement*) 384 } 386 The following child elements are defined by this specification (note 387 that the presence of some of these elements is required): 389 o metalink:metalink elements MAY contain exactly one metalink: 390 dynamic element. 391 o metalink:metalink elements MUST contain one or more metalink:file 392 elements. 393 o metalink:metalink elements MAY contain exactly one metalink: 394 generator element. 395 o metalink:metalink elements SHOULD contain exactly one metalink: 396 origin element. 397 o metalink:metalink elements MAY contain exactly one metalink: 398 published element. 400 4.1.1.1. Providing Textual Content 402 Experience teaches that downloads providing textual content are in 403 general more useful than those that do not. Some applications (one 404 example is full-text indexers) require a minimum amount of text to 405 function reliably and predictably. Metalink publishers should be 406 aware of these issues. It is advisable that each metalink:file 407 element contain a non-empty metalink:description element, a non-empty 408 metalink:identity element when that element is present, and a non- 409 empty metalink:version element, and a non-empty metalink:publisher 410 element. However, the absence of metalink:description is not an 411 error, and Metalink Processors MUST NOT fail to function correctly as 412 a consequence of such an absence. 414 4.1.2. The "metalink:file" Element 416 The "metalink:file" element represents an individual file, acting as 417 a container for metadata and data associated with the file. 419 All metalink:url elements SHOULD lead to identical files. That is, 420 each metalink:url element should be an alternative location for the 421 same file and each metalink:metaurl element should provide metadata 422 to retrieve the same file in another way, such as a peer to peer 423 network. 425 metalinkFile = 426 element metalink:file { 427 metalinkCommonAttributes, 428 attribute name { text }, 429 (metalinkCopyright? 430 & metalinkDescription? 431 & metalinkHash* 432 & metalinkIdentity? 433 & metalinkLanguage? 434 & metalinkLicense? 435 & metalinkLogo? 436 & metalinkMetaURL* 437 & metalinkURL* 438 & metalinkOS? 439 & metalinkPieces* 440 & metalinkPublisher? 441 & metalinkSignature? 442 & metalinkSize? 443 & metalinkVersion? 444 & extensionElement*) 445 } 447 This specification assigns no significance to the order of metalink: 448 file elements or to the order of metalink:url or metalink:metaurl 449 elements. Significance is determined by the value of the "priority" 450 attribute of the metalink:url or metalink:metaurl elements. 452 The following child elements are defined by this specification (note 453 that it requires the presence of some of these elements): 455 o metalink:file elements MAY contain exactly one metalink:copyright 456 element. 457 o metalink:file elements MAY contain exactly one metalink: 458 description element. 459 o metalink:file elements MAY contain exactly one metalink:identity 460 element. 461 o metalink:file elements MAY contain one or more metalink:hash 462 elements. 463 o metalink:file elements MAY contain exactly one metalink:language 464 element. 465 o metalink:file elements MAY contain exactly one metalink:license 466 element. 467 o metalink:file elements MAY contain exactly one metalink:logo 468 element. 469 o metalink:file elements MAY contain exactly one metalink:os 470 element. 471 o metalink:file elements MUST contain at least one metalink:url 472 element or at least one metalink:metaurl element. Typically, 473 metalink:file elements contain more than one metalink:url element 474 to provide multiple download sources. 475 o metalink:file elements MAY contain one or more metalink:pieces 476 elements. 477 o metalink:file elements MAY contain exactly one metalink:publisher 478 element. 479 o metalink:file elements MAY contain one or more metalink:signature 480 elements. 481 o metalink:file elements SHOULD contain exactly one metalink:size 482 element. 483 o metalink:file elements MAY contain exactly one metalink:version 484 element. 486 4.1.2.1. The "name" Attribute 488 metalink:file elements MUST have a "name" attribute, which contains 489 the filename of the file to be downloaded. 491 Directory information can also be contained in a "path/file" format 492 only, as in: 494 496 In this example, a subdirectory "debian-amd64/sarge/" will be created 497 and a file named "Contents-amd64.gz" will be created inside it. The 498 path MUST NOT contain any directory traversal directives or 499 information. The path MUST be relative. The path MUST NOT begin 500 with a "/", "./" or "../", contain "/../", or end with "/..". 502 4.1.3. The "metalink:pieces" Element 504 The "metalink:pieces" element acts as a container for a list of 505 checksums of non-overlapping pieces of the file. The checksums MUST 506 be listed in the same order as the corresponding pieces appear in the 507 file, starting at the beginning of the file. 509 metalinkPieces = 510 element metalink:pieces { 511 attribute length { xsd:integer }, 512 attribute type { text }, 513 metalinkHash+ 514 } 516 4.1.3.1. The "type" Attribute 518 metalink:pieces elements MUST have a "type" attribute. 520 The IANA registry named "Hash Function Textual Names" defines values 521 for hash types. If a Metalink Document contains hashes, it SHOULD 522 include "sha-1" which is SHA-1 as specified in [RFC3174], or a 523 stronger hash. It MAY also include other hashes. 525 4.1.3.2. The "length" Attribute 527 metalink:pieces elements MUST have a "length" attribute, which is an 528 integer that describes the length of the pieces of the file in 529 octets. The whole file is divided into non-overlapping pieces of 530 this length, starting from the beginning of the file. That is, every 531 piece should be the same size, apart from the last piece which is the 532 remainder. The last piece extends to the end of the file, and can 533 therefore be shorter than the other pieces. 535 4.2. Metadata Elements 537 4.2.1. The "metalink:copyright" Element 539 The "metalink:copyright" element is a Text construct that conveys a 540 human-readable copyright for a file. 542 metalinkCopyright = 543 element metalink:copyright { 544 metalinkTextConstruct 545 } 547 4.2.2. The "metalink:description" Element 549 The "metalink:description" element is a Text construct that conveys a 550 human-readable description for a file. 552 metalinkDescription = 553 element metalink:description { 554 metalinkTextConstruct 555 } 557 4.2.3. The "metalink:dynamic" Element 559 The "metalink:dynamic" element is a Text construct that describes 560 whether the IRI from "metalink:origin" in a Metalink will contain 561 dynamic updated information or if it is static and not likely to be 562 updated. 564 metalinkDynamic = 565 element metalink:dynamic { 566 "true" | "false" 567 } 569 4.2.4. The "metalink:generator" Element 571 The "metalink:generator" element's content identifies the generating 572 agent name and version, separated by a "/", used to generate a 573 Metalink Document, for debugging and other purposes. 575 metalinkGenerator = 576 element metalink:generator { 577 metalinkTextConstruct 578 } 580 The content of this element, when present, MUST be a string that is a 581 human-readable name and version, separated by a "/", for the 582 generating agent. For example, "MirrorBrain/2.9.2", where 583 "MirrorBrain" is the name and "2.9.2" is the version. Entities such 584 as "&" and "<" represent their corresponding characters ("&" 585 and "<" respectively), not markup. 587 4.2.5. The "metalink:hash" Element 589 The "metalink:hash" element is a Text construct that conveys a hash 590 for a file. All hashes are encoded in lowercase hexadecimal format. 591 Hashes are used to verify the integrity of a complete file or portion 592 of a file to determine if the file has been transferred without any 593 errors. 595 metalinkHash = 596 element metalink:hash { 597 attribute type { text }?, 598 text 599 } 601 metalink:hash elements with a "type" attribute MUST contain a hash of 602 the complete file. Metalink Documents can contain one or multiples 603 hashes of a complete file. In this example, both SHA-1 and SHA-256 604 hashes are included. 606 ... 607 a97fcf6ba9358f8a6f62beee4421863d3e52b080 608 fc87941af7fd7f03e53b34af393f4c14923d74 609 825f51116ff591336af4880227 610 ... 612 Metalink Documents can also contain hashes for individual pieces of a 613 file. metalink:hash elements that are inside a metalink:pieces 614 container element have a hash for that specific piece or chunk of the 615 file, and are of the same hash type as the metalink:pieces element 616 they are contained in. metalink:hash elements without a "type" 617 attribute MUST contain a hash for that specific piece or chunk of the 618 file and MUST be listed in the same order as the corresponding pieces 619 appear in the file, starting at the beginning of the file. The size 620 of the piece is equal to the value of the "length" attribute of the 621 metalink:pieces element. The whole file is divided into non- 622 overlapping pieces of this length, starting from the beginning of the 623 file. That is, every piece should be the same size, apart from the 624 last piece which is the remainder. The last piece extends to the end 625 of the file, and can therefore be shorter than the other pieces. 627 ... 628 a97fcf6ba9358f8a6f62beee4421863d3e52b080 629 fc87941af7fd7f03e53b34af393f4c14923d74 630 825f51116ff591336af4880227 631 632 d96b9a4b92a899c2099b7b31bddb5ca423bb9b30 633 10d68f4b1119014c123da2a0a6baf5c8a6d5ba1e 634 3e84219096435c34e092b17b70a011771c52d87a 635 67183e4c3ab892d3ebe8326b7d79eb62d077f487 636 637 ... 639 4.2.5.1. The "type" Attribute 641 metalink:hash elements MUST have a "type" attribute, if and only if 642 it contains a hash of the complete file. The IANA registry named 643 "Hash Function Textual Names" defines values for hash types. If a 644 Metalink Document contains hashes, it SHOULD include "sha-1" which is 645 SHA-1 as specified in [RFC3174], or a stronger hash. It MAY also 646 include other hashes. 648 4.2.6. The "metalink:identity" Element 650 The "metalink:identity" element is a Text construct that conveys a 651 human-readable identity for a file. The identity of OpenOffice.org 652 3.0 would be "OpenOffice.org". 654 metalinkIdentity = 655 element metalink:identity { 656 metalinkTextConstruct 657 } 659 4.2.7. The "metalink:language" Element 661 The "metalink:language" element is a Text construct that conveys a 662 code for the language of a file, per [RFC4646]. 664 metalinkLanguage = 665 element metalink:language { 666 metalinkTextConstruct 667 } 669 4.2.8. The "metalink:license" Element 671 The "metalink:license" element is a Text construct that conveys a 672 human-readable license name for a file. 674 metalinkLicense = 675 element metalink:license { 676 metalinkCommonAttributes, 677 attribute url { metalinkUri }?, 678 attribute name { text }? 679 } 681 The metalink:license element MAY have a "url" attribute whose value 682 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 683 URI (mapped from an IRI, if necessary) SHOULD produce a 684 representation that is relevant to that agent. 686 The metalink:license element MAY have a "name" attribute that 687 indicates the name of the license. 689 4.2.9. The "metalink:logo" Element 691 The "metalink:logo" element's content is an IRI reference [RFC3987] 692 that identifies an image that provides visual identification for a 693 file. 695 metalinkLogo = 696 element metalink:logo { 697 metalinkCommonAttributes, 698 (metalinkUri) 699 } 701 The image SHOULD have an aspect ratio of one (horizontal) to one 702 (vertical) and SHOULD be suitable for presentation at a small size. 704 4.2.10. The "metalink:metaurl" Element 706 The "metalink:metaurl" element contains the IRI of metadata about a 707 resource to download. For example, this could be the IRI of a 708 BitTorrent .torrent file or a Metalink Document. Note that the 709 information in the metalink:hash element does not apply to these 710 files, but to the files that are described by them. 712 metalinkMetaURL = 713 element metalink:metaurl { 714 metalinkCommonAttributes, 715 attribute priority { xsd:integer }?, 716 attribute type { text }, 717 attribute name { text }?, 718 metalinkUri 719 } 721 4.2.10.1. The "priority" Attribute 723 metalink:metaurl elements MAY have a priority attribute. Lower 724 values indicate a higher priority. Multiple metalink:metaurl 725 elements can have the same priority, i.e. three BitTorrent .torrent 726 files could have priority="1". See also the "priority" attribute of 727 the metalink:url element. 729 4.2.10.2. The "type" Attribute 731 metalink:metaurl elements MUST have a "type" attribute that indicates 732 the MIME type of the metadata available at the IRI. In the case of 733 BitTorrent as specified in [BITTORRENT], the value "torrent" is 734 required. Types without "/" are reserved. Currently, "torrent" is 735 the only reserved value. 737 4.2.10.3. The "name" Attribute 739 metalink:metaurl elements MAY have a "name" attribute that indicates 740 a specific file in a BitTorrent .torrent file or a Metalink Document 741 that describes multiple files. 743 Directory information can also be contained in a "path/file" format 744 only, as in: 746 748 In this example, a file named "Contents-amd64.gz" is indicated, in a 749 "debian-amd64/sarge/" subdirectory. The path MUST NOT contain any 750 directory traversal directives or information. The path MUST be 751 relative. The path MUST NOT begin with a "/", "./" or "../", contain 752 "/../", or end with "/..". 754 4.2.11. The "metalink:origin" Element 756 The "metalink:origin" element is an IRI where the Metalink Document 757 was originally published. If metalink:dynamic is "true", then 758 updated versions of the Metalink can be found at this IRI. 760 metalinkOrigin = 761 element metalink:origin { 762 metalinkCommonAttributes, 763 (metalinkUri) 764 } 766 4.2.12. The "metalink:os" Element 768 The "metalink:os" element is a Text construct that conveys a human- 769 readable Operating System for a file. The IANA registry named 770 "Operating System Names" defines values for OS types. 772 metalinkOS = 773 element metalink:os { 774 metalinkTextConstruct 775 } 777 4.2.13. The "metalink:published" Element 779 The "metalink:published" element is a Date construct indicating an 780 instant in time associated with an event early in the life cycle of 781 the entry. 783 metalinkPublished = 784 element metalink:published { 785 metalinkDateConstruct 786 } 788 Typically, metalink:published will be associated with the initial 789 creation or first availability of the resource. 791 4.2.14. The "metalink:publisher" Element 793 The "metalink:publisher" element indicates a group or other entity 794 which has published the file described in the Metalink Document. 796 metalinkPublisher = 797 element metalink:publisher { 798 metalinkCommonAttributes, 799 attribute url { metalinkUri }?, 800 attribute name { text }? 801 } 803 The metalink:publisher element MAY have a "url" attribute whose value 804 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 805 URI (mapped from an IRI, if necessary) SHOULD produce a 806 representation that is relevant to that agent. 808 The metalink:publisher element MAY have a "name" attribute that 809 indicates the name of the publisher. 811 4.2.15. The "metalink:signature" Element 813 The "metalink:signature" element is a Text construct that conveys a 814 digital signature for a file described in a Metalink Document. 815 Digital signatures verify that a file is from the entity that has 816 signed it. 818 metalinkSignature = 819 element metalink:signature { 820 attribute type { "pgp" }, 821 metalinkTextConstruct 822 } 824 4.2.15.1. The "type" Attribute 826 metalink:signature elements MUST have a "type" attribute. The 827 initial value of "type" is the string that is non-empty and matches 828 "pgp". It may be useful to extend Metalink documents with new types 829 of digital signatures, so unknown types are allowed. 831 4.2.16. The "metalink:size" Element 833 The "metalink:size" element indicates the length of the linked 834 content in octets; it is a hint about the content length of the 835 representation returned when the IRI is mapped to a URI and 836 dereferenced. 838 metalinkSize = 839 element metalink:size { 840 metalinkTextConstruct 841 } 843 4.2.17. The "metalink:updated" Element 845 The "metalink:updated" element is a Date construct indicating the 846 most recent instant in time when a Metalink was modified in a way the 847 publisher considers significant. Therefore, not all modifications 848 necessarily result in a changed metalink:updated value. 850 metalinkUpdated = 851 element metalink:updated { 852 metalinkDateConstruct 853 } 855 Publishers MAY change the value of this element over time. 857 4.2.18. The "metalink:url" Element 859 The "metalink:url" element contains the IRI of a file. Most Metalink 860 Documents will contain multiple metalink:url elements, and each one 861 SHOULD be a valid alternative to download the same file. 863 metalinkURL = 864 element metalink:url { 865 metalinkCommonAttributes, 866 attribute location { xsd:string { 867 minLength = "2" maxLength="2"} 868 }?, 869 attribute priority { xsd:integer }?, 870 metalinkUri 871 } 873 4.2.18.1. The "priority" Attribute 875 metalink:url elements MAY have a priority attribute. Lower values 876 indicate a higher priority. Multiple metalink:url elements can have 877 the same priority, i.e. ten mirrors could have priority="1". 879 4.2.18.2. The "location" Attribute 881 metalink:url elements MAY have a "location" attribute, which is a 882 [ISO3166-1] alpha-2 two letter country code for the geographical 883 location of the physical server an IRI is used to access. 885 4.2.19. The "metalink:version" Element 887 The "metalink:version" element is a Text construct that conveys a 888 human-readable version for a file. The version of OpenOffice.org 3.0 889 would be "3.0". 891 metalinkVersion = 892 element metalink:version { 893 metalinkTextConstruct 894 } 896 5. Securing Metalink Documents 898 Because Metalink is an XML-based format, existing XML security 899 mechanisms can be used to secure its content. 901 Producers of Metalink Documents may have sound reasons for signing 902 otherwise-unprotected content. For example, a merchant might 903 digitally sign a Metalink that lists a file download to verify its 904 origin. Other merchants may wish to sign and encrypt Metalink 905 Documents that list digital songs that have been purchased. Of 906 course, many other examples are conceivable as well. 908 The algorithm requirements in this section pertain to the Metalink 909 Processor. They require that a recipient, at a minimum, be able to 910 handle messages that use the specified cryptographic algorithms. 911 These requirements do not limit the algorithms that the sender can 912 choose. 914 Metalink Processors that verify signed Metalink Documents MUST at 915 least support XML-Signature and Syntax Processing [REC-xmldsig-core]. 917 6. Extending Metalink 919 6.1. Extensions from Non-Metalink Vocabularies 921 This specification describes Metalink's XML markup vocabulary. 922 Markup from other vocabularies ("foreign markup") can be used in an 923 Metalink Document. 925 6.2. Extensions to the Metalink Vocabulary 927 The Metalink namespace is reserved for future forward-compatible 928 revisions of Metalink. Future versions of this specification could 929 add new elements and attributes to the Metalink markup vocabulary. 930 Software written to conform to this version of the specification will 931 not be able to process such markup correctly and, in fact, will not 932 be able to distinguish it from markup error. For the purposes of 933 this discussion, unrecognized markup from the Metalink vocabulary 934 will be considered "foreign markup". 936 6.3. Processing Foreign Markup 938 Metalink Processors that encounter foreign markup in a location that 939 is legal according to this specification MUST NOT stop processing or 940 signal an error. It might be the case that the Metalink Processor is 941 able to process the foreign markup correctly and does so. Otherwise, 942 such markup is termed "unknown foreign markup". 944 When unknown foreign markup is encountered as a child of metalink: 945 file, metalink:metalink, Metalink Processors MAY bypass the markup 946 and any textual content and MUST NOT change their behavior as a 947 result of the markup's presence. 949 When unknown foreign markup is encountered in a Text Construct, 950 software SHOULD ignore the markup and process any text content of 951 foreign elements as though the surrounding markup were not present. 953 6.4. Extension Elements 955 Metalink allows foreign markup anywhere in an Metalink document, 956 except where it is explicitly forbidden. Child elements of metalink: 957 file and metalink:metalink are considered Metadata elements and are 958 described below. Child elements of Person constructs are considered 959 to apply to the construct. The role of other foreign markup is 960 undefined by this specification. 962 6.4.1. Simple Extension Elements 964 A Simple Extension element MUST NOT have any attributes or child 965 elements. The element MAY contain character data or be empty. 966 Simple Extension elements are not Language-Sensitive. 968 simpleExtensionElement = 969 element * - metalink:* { 970 text 971 } 973 The element can be interpreted as a simple property (or name/value 974 pair) of the parent element that encloses it. The pair consisting of 975 the namespace-URI of the element and the local name of the element 976 can be interpreted as the name of the property. The character data 977 content of the element can be interpreted as the value of the 978 property. If the element is empty, then the property value can be 979 interpreted as an empty string. 981 6.4.2. Structured Extension Elements 983 The root element of a Structured Extension element MUST have at least 984 one attribute or child element. It MAY have attributes, it MAY 985 contain well-formed XML content (including character data), or it MAY 986 be empty. Structured Extension elements are Language-Sensitive. 988 structuredExtensionElement = 989 element * - metalink:* { 990 (attribute * { text }+, 991 (text|anyElement)*) 992 | (attribute * { text }*, 993 (text?, anyElement+, (text|anyElement)*)) 994 } 996 The structure of a Structured Extension element, including the order 997 of its child elements, could be significant. 999 This specification does not provide an interpretation of a Structured 1000 Extension element. The syntax of the XML contained in the element 1001 (and an interpretation of how the element relates to its containing 1002 element) is defined by the specification of the Metalink extension. 1004 7. IANA Considerations 1006 7.1. XML Namespace Registration 1008 This document makes use of the XML registry specified in [RFC3688]. 1009 Accordingly, IANA has made the following registration: 1011 Registration request for the Metalink namespace: 1013 URI: urn:ietf:params:xml:ns:metalink 1015 Registrant Contact: See the "Author's Address" section of this 1016 document. 1018 XML: None. Namespace URIs do not represent an XML specification. 1020 7.2. application/metalink4+xml MIME type 1022 A Metalink Document, when serialized as XML 1.0, can be identified 1023 with the following media type: 1025 MIME media type name: application 1026 MIME subtype name: metalink4+xml 1027 Mandatory parameters: None. 1028 Optional parameters: 1029 "charset": This parameter has semantics identical to the charset 1030 parameter of the "application/xml" media type as specified in 1031 [RFC3023]. 1032 Encoding considerations: Identical to those of "application/xml" as 1033 described in [RFC3023], Section 3.2. 1034 Security considerations: As defined in this specification. 1035 In addition, as this media type uses the "+xml" convention, it 1036 shares the same security considerations as described in [RFC3023], 1037 Section 10. 1038 Interoperability considerations: There are no known interoperability 1039 issues. 1040 Published specification: This specification. 1041 Applications that use this media type: No known applications 1042 currently use this media type. 1044 Additional information: 1046 Magic number(s): As specified for "application/xml" in [RFC3023], 1047 Section 3.2. 1048 File extension: .metalink 1049 Fragment identifiers: As specified for "application/xml" in 1050 [RFC3023], Section 5. 1051 Base URI: As specified in [RFC3023], Section 6. 1052 Macintosh File Type code: TEXT 1053 Person and email address to contact for further information: Anthony 1054 Bryan 1055 Intended usage: COMMON 1056 Author/Change controller: IESG 1058 8. Security Considerations 1060 Publishers are encouraged to offer Metalink documents via 1061 authenticated HTTP under TLS as specified in [RFC2818]. Publishers 1062 are also encouraged to include digital signatures of the files within 1063 the Metalink Documents if they are available. 1065 8.1. URIs and IRIs 1067 Metalink Processors handle URIs and IRIs. See Section 7 of [RFC3986] 1068 and Section 8 of [RFC3987] for security considerations related to 1069 their handling and use. 1071 8.2. Spoofing 1073 There is potential for spoofing attacks where the attacker publishes 1074 Metalink Documents with false information. Malicious publishers 1075 might create Metalink Documents containing inaccurate information 1076 anywhere in the document. Unaware downloaders could be deceived into 1077 downloading a malicious or worthless file. Malicious publishers 1078 could attempt a distributed denial of service attack by inserting 1079 unrelated IRIs into Metalink Documents. 1081 8.3. Cryptographic Hashes 1083 Currently, some of the hash types defined in the IANA registry named 1084 "Hash Function Textual Names" are considered insecure. These include 1085 the whole Message Digest family of algorithms which are not suitable 1086 for cryptographically strong verification. Malicious people could 1087 provide files that appear to be identical to another file because of 1088 a collision, i.e. the weak cryptographic hashes of the intended file 1089 and a substituted malicious file could match. 1091 If a Metalink Document contains hashes, it SHOULD include "sha-1" 1092 which is SHA-1, as specified in [RFC3174], or stronger. It MAY also 1093 include other hashes. 1095 8.4. Signing 1097 Metalink Documents SHOULD be signed using [REC-xmldsig-core] and are 1098 subject to the security considerations implied by its use. This 1099 addresses the issue of spoofing. 1101 Digital signatures provide authentication, message integrity, and 1102 non-repudiation with proof of origin. 1104 9. References 1106 9.1. Normative References 1108 [BITTORRENT] 1109 Cohen, B., "The BitTorrent Protocol Specification", 1110 BITTORRENT 11031, February 2008, 1111 . 1113 [ISO3166-1] 1114 International Organization for Standardization, "ISO 3166- 1115 1:2006. Codes for the representation of names of 1116 countries and their subdivisions -- Part 1: Country 1117 codes", November 2006. 1119 [REC-xml] Yergeau, F., Paoli, J., Bray, T., Sperberg-McQueen, C., 1120 and E. Maler, "Extensible Markup Language (XML) 1.0 1121 (Fourth Edition)", World Wide Web Consortium 1122 Recommendation REC-xml-20060816, August 2006, 1123 . 1125 [REC-xml-infoset] 1126 Cowan, J. and R. Tobin, "XML Information Set (Second 1127 Edition)", World Wide Web Consortium Recommendation REC- 1128 xml-infoset-20040204, February 2004, 1129 . 1131 [REC-xml-names] 1132 Hollander, D., Bray, T., Tobin, R., and A. Layman, 1133 "Namespaces in XML 1.0 (Second Edition)", World Wide Web 1134 Consortium Recommendation REC-xml-names-20060816, 1135 August 2006, 1136 . 1138 [REC-xmlbase] 1139 Marsh, J., "XML Base", W3C REC W3C.REC-xmlbase-20010627, 1140 June 2001, 1141 . 1143 [REC-xmldsig-core] 1144 Solo, D., Reagle, J., and D. Eastlake, "XML-Signature 1145 Syntax and Processing (Second Edition)", World Wide Web 1146 Consortium Recommendation REC-xmldsig-core-20080610, 1147 June 2008, 1148 . 1150 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1151 Requirement Levels", BCP 14, RFC 2119, March 1997. 1153 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1155 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media 1156 Types", RFC 3023, January 2001. 1158 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 1159 (SHA1)", RFC 3174, September 2001. 1161 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1162 Timestamps", RFC 3339, July 2002. 1164 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1165 January 2004. 1167 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1168 Resource Identifier (URI): Generic Syntax", STD 66, 1169 RFC 3986, January 2005. 1171 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 1172 Identifiers (IRIs)", RFC 3987, January 2005. 1174 [RFC4646] Phillips, A. and M. Davis, "Tags for Identifying 1175 Languages", BCP 47, RFC 4646, September 2006. 1177 9.2. Informative References 1179 [ISO.8601.1988] 1180 International Organization for Standardization, "Data 1181 elements and interchange formats - Information interchange 1182 - Representation of dates and times", ISO Standard 8601, 1183 June 1988. 1185 [RELAX-NG] 1186 Clark, J., "RELAX NG Compact Syntax", December 2001, . 1190 [RFC4287] Nottingham, M. and R. Sayre, "The Atom Syndication 1191 Format", RFC 4287, December 2005. 1193 [W3C.NOTE-datetime-19980827] 1194 Wolf, M. and C. Wicksteed, "Date and Time Formats", W3C 1195 NOTE NOTE-datetime-19980827, August 1998, 1196 . 1198 [W3C.REC-xmlschema-2-20041028] 1199 Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes 1200 Second Edition", W3C REC REC-xmlschema-2-20041028, 1201 October 2004, 1202 . 1204 Appendix A. Acknowledgements and Contributors 1206 The layout and content of this document relies heavily on work 1207 pioneered in the Atom Syndication Format as specified in [RFC4287]. 1209 The content and concepts within are a product of the Metalink 1210 community. 1212 The Metalink community has dozens of contributors who proposed ideas 1213 and wording for this document, or contributed to the evolution of 1214 Metalink, including: 1216 Paul Burkhead, Kristian Weston, Darius Liktorius, Michael Burford, 1217 Giorgio Maone, Manuel Subredu, A. Bram Neijt, Max Velasques, Manolo 1218 Valdes, Urs Wolfer, Frederick Cheung, Nils Maier, Hampus Wessman, 1219 Hayden Legendre, Danny Ayers, Nick Dominguez, Rene Leonhardt, Per 1220 Oyvind Karlsen, Gary Zellerbach, James Clark, Daniel Stenberg, Matt 1221 Domsch, Yazsoft, KGet developers, FDM Team, Orbit Team, Arne 1222 Babenhauserheide, Mathias Berchtold, Xienzhenyu and TheWorld Browser 1223 Team, Xi Software, Nicolas Alvarez, Patrick Ruckstuhl, Sebastien 1224 Willemijns, Micah Cowan, Bridget and Ethan Fletcher, Ruben Kerkhof, 1225 Agostino Russo, Salvatore Musumeci, Steve Eshelman, Lucas Hewett, 1226 Ryan Cronin, Dave Winquist, Bob Denison, Wes Shelton, Kees Cook, Josh 1227 Colbert, Steve Kleisath, Chad Neptune, Nick Carrabba, Chris Carrabba, 1228 Erin Solari, Derick Cordoba, Ryan Alexander, John Sowder, Sandra 1229 Amisano, Tom Mainville, Janie Wargo, Jason Hansen, Tim Bray, Dan 1230 Brickley, Markus Hofmann, Dan Connolly, Tim Berners-Lee, Louis 1231 Suarez-Potts, Ross Smith, Jeff Covey, Ed Lee, Shawn Wilsher, Mike 1232 Connor, Johan Svedberg, Dedric Carter, James Antill, Debi Goulding, 1233 Chris Newman, Lisa Dusseault, Ian Macfarlane, Dave Cridland, Julian 1234 Reschke, Barry Leiba, Uri Blumenthal, Paul Hoffman, Felix Sasaki, 1235 Matthias Fuchs, Eran Hammer-Lahav, and Mark Nottingham. We also 1236 thank the Anthony Family, the Bryan Family, Juanita Anthony and Zimmy 1237 Bryan. 1239 Appendix B. RELAX NG Compact Schema 1241 This appendix is informative. 1243 The Relax NG schema explicitly excludes elements in the Metalink 1244 namespace that are not defined in this revision of the specification. 1245 Requirements for Metalink Processors encountering such markup are 1246 given in Sections 6.2 and 6.3. 1248 # -*- rnc -*- 1249 # RELAX NG Compact Syntax Grammar for the 1250 # Metalink Format Specification Version 4 1252 namespace local = "" 1253 namespace metalink = "urn:ietf:params:xml:ns:metalink" 1254 namespace xsd = "http://www.w3.org/2001/XMLSchema" 1255 # Common attributes 1257 metalinkCommonAttributes = 1258 attribute xml:base { metalinkUri }?, 1259 attribute xml:lang { metalinkLanguageTag }?, 1260 undefinedAttribute* 1262 # Text Constructs 1264 metalinkTextConstruct = 1265 metalinkCommonAttributes, 1266 text 1268 # Date Construct 1270 metalinkDateConstruct = 1271 metalinkCommonAttributes, 1272 xsd:dateTime 1274 start = metalinkMetalink 1276 metalinkMetalink = 1277 element metalink:metalink { 1278 metalinkCommonAttributes, 1279 (metalinkDynamic? 1280 & metalinkFile+ 1281 & metalinkGenerator? 1282 & metalinkOrigin? 1283 & metalinkPublished? 1284 & metalinkUpdated? 1285 & extensionElement*) 1286 } 1288 metalinkFile = 1289 element metalink:file { 1290 metalinkCommonAttributes, 1291 attribute name { text }, 1292 (metalinkCopyright? 1293 & metalinkDescription? 1294 & metalinkIdentity? 1295 & metalinkHash* 1296 & metalinkLanguage? 1297 & metalinkLicense? 1298 & metalinkLogo? 1299 & metalinkMetaURL* 1300 & metalinkURL* 1301 & metalinkOS? 1302 & metalinkPieces* 1303 & metalinkPublisher? 1304 & metalinkSignature? 1305 & metalinkSize? 1306 & metalinkVersion? 1307 & extensionElement*) 1308 } 1310 metalinkPieces = 1311 element metalink:pieces { 1312 attribute length { xsd:integer }, 1313 attribute type { text }, 1314 metalinkHash+ 1315 } 1317 metalinkCopyright = 1318 element metalink:copyright { 1319 metalinkTextConstruct 1320 } 1322 metalinkDescription = 1323 element metalink:description { 1324 metalinkTextConstruct 1325 } 1327 metalinkDynamic = 1328 element metalink:dynamic { 1329 "true" | "false" 1330 } 1332 metalinkGenerator = 1333 element metalink:generator { 1334 metalinkTextConstruct 1335 } 1337 metalinkHash = 1338 element metalink:hash { 1339 attribute type { text }?, 1340 text 1341 } 1343 metalinkIdentity = 1344 element metalink:identity { 1345 metalinkTextConstruct 1346 } 1348 metalinkLanguage = 1349 element metalink:language { 1350 metalinkTextConstruct 1352 } 1354 metalinkLicense = 1355 element metalink:license { 1356 metalinkCommonAttributes, 1357 attribute url { metalinkUri }?, 1358 attribute name { text }? 1359 } 1361 metalinkLogo = 1362 element metalink:logo { 1363 metalinkCommonAttributes, 1364 (metalinkUri) 1365 } 1367 metalinkMetaURL = 1368 element metalink:metaurl { 1369 metalinkCommonAttributes, 1370 attribute priority { xsd:integer }?, 1371 attribute type { text }, 1372 attribute name { text }?, 1373 metalinkUri 1374 } 1376 metalinkOrigin = 1377 element metalink:origin { 1378 metalinkCommonAttributes, 1379 (metalinkUri) 1380 } 1382 metalinkOS = 1383 element metalink:os { 1384 metalinkTextConstruct 1385 } 1387 metalinkPublished = 1388 element metalink:published { 1389 metalinkDateConstruct 1390 } 1392 metalinkPublisher = 1393 element metalink:publisher { 1394 metalinkCommonAttributes, 1395 attribute url { metalinkUri }?, 1396 attribute name { text }? 1397 } 1399 metalinkSignature = 1400 element metalink:signature { 1401 attribute type { "pgp" }, 1402 metalinkTextConstruct 1403 } 1405 metalinkSize = 1406 element metalink:size { 1407 metalinkTextConstruct 1408 } 1410 metalinkUpdated = 1411 element metalink:updated { 1412 metalinkDateConstruct 1413 } 1415 metalinkURL = 1416 element metalink:url { 1417 metalinkCommonAttributes, 1418 attribute location { xsd:string { 1419 minLength = "2" maxLength="2"} 1420 }?, 1421 attribute priority { xsd:integer }?, 1422 metalinkUri 1423 } 1425 metalinkVersion = 1426 element metalink:version { 1427 metalinkTextConstruct 1428 } 1430 # As defined in RFC 3066 and compatible with RFC 4646 1431 metalinkLanguageTag = xsd:string { 1432 pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*" 1433 } 1435 # Unconstrained; it's not entirely clear how IRI fit into 1436 # xsd:anyURI so let's not try to constrain it here 1437 metalinkUri = text 1439 # Simple Extension 1441 simpleExtensionElement = 1442 element * - metalink:* { 1443 text 1444 } 1446 # Structured Extension 1447 structuredExtensionElement = 1448 element * - metalink:* { 1449 (attribute * { text }+, 1450 (text|anyElement)*) 1451 | (attribute * { text }*, 1452 (text?, anyElement+, (text|anyElement)*)) 1453 } 1455 # Other Extensibility 1457 extensionElement = 1458 simpleExtensionElement | structuredExtensionElement 1460 undefinedAttribute = 1461 attribute * - (xml:base | xml:lang | local:*) { text } 1463 undefinedContent = (text|anyForeignElement)* 1465 anyElement = 1466 element * { 1467 (attribute * { text } 1468 | text 1469 | anyElement)* 1470 } 1472 anyForeignElement = 1473 element * - metalink:* { 1474 (attribute * { text } 1475 | text 1476 | anyElement)* 1477 } 1479 # EOF 1481 Appendix C. Document History (to be removed by RFC Editor before 1482 publication) 1484 [[ to be removed by the RFC editor before publication as an RFC. ]] 1486 Updated versions can be found at 1487 http://tools.ietf.org/html/draft-bryan-metalink with frequent updates 1488 in Subversion at 1489 http://metalinks.svn.sourceforge.net/viewvc/metalinks/internetdraft/ 1491 Known issues concerning this draft: 1493 o None. 1495 -17 : September 28, 2009. 1496 o Typo correction. 1498 -16 : August 31, 2009. 1499 o Clarifications. 1501 -15 : August 26, 2009. 1502 o Rename "preference" attribute of metaurl and url elements to 1503 "priority", where lower values indicate higher priority. 1505 -14 : August 24, 2009. 1506 o Update abstract and introduction. 1508 -13 : August 21, 2009. 1509 o Remove files, resources, verification container elements. 1510 o MIME type: application/metalink4+xml 1512 -12 : August 18, 2009. 1513 o Remove "piece" attribute from hash elements in pieces container 1514 elements. 1515 o Rename "uri" attribute of license and publisher elements to "url". 1517 -11 : August 08, 2009. 1518 o Renamed type element (static or dynamic values) to dynamic element 1519 (true or false values). 1520 o Removed metadata inheritance and most other elements from files 1521 element. 1523 -10 : July 28, 2009. 1524 o Schema fixes. 1525 o Rename metadata element to metaurl, add name attribute to it 1526 similar to file element's name attribute. 1527 o Update REC-xmldsig-core reference to second edition. 1529 -09 : July 11, 2009. 1530 o Replace ISO639-2 references with RFC 4646. 1531 o Add ISO3166-1. 1533 -08 : July 04, 2009. 1534 o Clarifications. 1535 o Remove "uri" and "version" attributes from generator element. 1537 -07 : June 18, 2009. 1538 o This ID describes the Metalink document format/schema. 1540 o Remove "Client Implementation Considerations" section. 1541 o Expand "Known issues" section of Document History. 1543 -06 : March 3, 2009. 1544 o Add authors and this Document History section. 1546 -05 : January 13, 2009. 1547 o Clarifications. 1549 -04 : December 31, 2008. 1550 o New IPR notice as required by IETF. 1551 o Correct "metalink:pieces" Element text. 1552 o Add hash examples. 1553 o Slim down "Securing Metalink Documents" section. 1554 o Recommend at least SHA-1. 1556 -03 : September 19, 2008. 1557 o New namespace - urn:ietf:params:xml:ns:metalink 1558 o Use the IANA registry named "Operating System Names" to define 1559 values for OS types. 1560 o Add "Client Implementation Considerations" section, which includes 1561 Content Negotiation. 1563 -02 : September 4, 2008. 1564 o Use the IANA registry named "Hash Function Textual Names" for hash 1565 types. 1566 o metadata Element for listing .torrent, .metalink, etc. 1567 o Remove type attribute for url Element. 1569 -01 : August 28, 2008. 1570 o Clarify directory info in name attribute, hash types, add text for 1571 preference attribute. 1573 -00 : August 23, 2008. 1574 o Initial draft; Text largely based on RFC 4287, ideas from Metalink 1575 3.0 specification. 1577 Index 1579 A 1580 application/metalink4+xml Media Type 23 1582 C 1583 copyright XML element 12 1585 D 1586 description XML element 13 1588 F 1589 file XML element 10 1591 G 1592 generator XML element 13 1593 Grammar 1594 metalinkCommonAttributes 7 1595 metalinkCopyright 12 1596 metalinkDateConstruct 8 1597 metalinkDescription 13 1598 metalinkFile 10 1599 metalinkGenerator 13 1600 metalinkHash 14 1601 metalinkIdentity 15 1602 metalinkLanguage 15 1603 metalinkLicense 15 1604 metalinkLogo 16 1605 metalinkMetalink 9 1606 metalinkOrigin 17 1607 metalinkOS 17 1608 metalinkPieces 12 1609 metalinkPublished 18 1610 metalinkPublisher 18 1611 metalinkSignature 18 1612 metalinkSize 19 1613 metalinkTextConstruct 8 1614 metalinkType 13 1615 metalinkUpdated 19 1616 metalinkURL 16, 19 1617 metalinkVersion 20 1618 simpleExtensionElement 21 1619 structuredExtensionElement 22 1621 H 1622 hash XML element 13 1624 I 1625 identity XML element 15 1627 L 1628 language XML element 15 1629 license XML element 15 1630 logo XML element 16 1632 M 1633 Media Type 1634 application/metalink4+xml 23 1635 metadata XML element 16 1636 metalink XML element 9 1637 metalinkCommonAttributes grammar production 7 1638 metalinkCopyright grammar production 12 1639 metalinkDateConstruct grammar production 8 1640 metalinkDescription grammar production 13 1641 metalinkFile grammar production 10 1642 metalinkGenerator grammar production 13 1643 metalinkHash grammar production 14 1644 metalinkIdentity grammar production 15 1645 metalinkLanguage grammar production 15 1646 metalinkLicense grammar production 15 1647 metalinkLogo grammar production 16 1648 metalinkMetalink grammar production 9 1649 metalinkOrigin grammar production 17 1650 metalinkOS grammar production 17 1651 metalinkPieces grammar production 12 1652 metalinkPublished grammar production 18 1653 metalinkPublisher grammar production 18 1654 metalinkSignature grammar production 18 1655 metalinkSize grammar production 19 1656 metalinkTextConstruct grammar production 8 1657 metalinkType grammar production 13 1658 metalinkUpdated grammar production 19 1659 metalinkURL grammar production 16, 19 1660 metalinkVersion grammar production 20 1662 O 1663 origin XML element 17 1664 os XML element 17 1666 P 1667 pieces XML element 12 1668 published XML element 17 1669 publisher XML element 18 1671 S 1672 signature XML element 18 1673 simpleExtensionElement grammar production 21 1674 size XML element 19 1675 structuredExtensionElement grammar production 22 1677 T 1678 type XML element 13 1680 U 1681 updated XML element 19 1682 url XML element 19 1684 V 1685 version XML element 20 1687 X 1688 XML Elements 1689 copyright 12 1690 description 13 1691 entry 10 1692 generator 13 1693 hash 13 1694 identity 15 1695 language 15 1696 license 15 1697 logo 16 1698 metadata 16 1699 metalink 9 1700 origin 17 1701 os 17 1702 pieces 12 1703 published 17 1704 publisher 18 1705 signature 18 1706 size 19 1707 type 13 1708 updated 19 1709 url 19 1710 version 20 1712 Authors' Addresses 1714 Anthony Bryan (editor) 1715 Metalinker Project 1717 Email: anthonybryan@gmail.com 1718 URI: http://www.metalinker.org 1720 Tatsuhiro Tsujikawa 1721 Metalinker Project 1723 Email: tatsuhiro.t@gmail.com 1724 URI: http://aria2.sourceforge.net 1725 Neil McNab 1726 Metalinker Project 1728 Email: neil@nabber.org 1729 URI: http://www.nabber.org 1731 Peter Poeml 1732 Novell, Inc. 1734 Email: info@mirrorbrain.org 1735 URI: http://www.mirrorbrain.org/