idnits 2.17.1 draft-bryan-metalink-21.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 (October 13, 2009) is 5280 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 Summary: 4 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 3 Internet-Draft T. Tsujikawa 4 Intended status: Standards Track N. McNab 5 Expires: April 16, 2010 6 P. Poeml 7 Novell, Inc. 8 October 13, 2009 10 The Metalink Download Description Format 11 draft-bryan-metalink-21 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 16, 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 multiple 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 . . . . . . . . . . 27 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 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 fall back 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 14471447 180 ftp://ftp.example.com/example.ext 181 http://example.com/example.ext 182 183 http://example.com/example.ext.torrent 184 185 186 188 A more extensive, single file Metalink Document: 190 191 192 2009-05-15T12:23:23Z 193 194 14471447 195 Example 196 1.0 197 en 198 A description of the example file for 199 download. 200 201 80bc95fd391772fa61c91ed68567f0980bb45fd9 202 203 ftp://ftp.example.com/example.ext 204 205 http://example.com/example.ext 206 207 http://example.com/example.ext.torrent 208 209 210 212 1.2. Namespace and Version 214 The XML Namespaces URI [REC-xml-names] for the XML data format 215 described in this specification is: 217 urn:ietf:params:xml:ns:metalink 219 For convenience, this data format may be referred to as "Metalink", 220 which this specification uses internally. 222 1.3. Notational Conventions 224 This specification describes conformance of Metalink Documents. 225 Additionally, it places some requirements on Metalink Processors. 227 This specification uses the namespace prefix "metalink:" for the 228 Namespace URI identified in Section 1.2, above. Note that the choice 229 of namespace prefix is arbitrary and not semantically significant. 231 Metalink is specified using terms from the XML Infoset 232 [REC-xml-infoset]. However, this specification uses a shorthand for 233 two common terms: the phrase "Information Item" is omitted when 234 naming Element Information Items and Attribute Information Items. 235 Therefore, when this specification uses the term "element," it is 236 referring to an Element Information Item in Infoset terms. Likewise, 237 when it uses the term "attribute," it is referring to an Attribute 238 Information Item. 240 Some sections of this specification are illustrated with fragments of 241 a non-normative RELAX NG Compact schema [RELAX-NG]. However, the 242 text of this specification provides the definition of conformance. A 243 complete schema appears in Appendix B. 245 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 246 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 247 document are to be interpreted as described in BCP 14, [RFC2119], as 248 scoped to those conformance targets. 250 2. Metalink Documents 252 This specification describes Metalink Documents. 254 A Metalink Document describes a file or group of files, how to access 255 them, and metadata that identifies them. Its root is the metalink: 256 metalink element. 258 namespace metalink = "urn:ietf:params:xml:ns:metalink" 259 start = metalinkMetalink 261 Metalink Documents are specified in terms of the XML Information Set, 262 serialized as XML 1.0 [REC-xml] and identified with the "application/ 263 metalink4+xml" media type. 265 Metalink Documents MUST be well-formed XML. This specification does 266 not define a DTD for Metalink Documents, and hence does not require 267 them to be valid (in the sense used by XML). 269 Metalink allows the use of IRIs, encoded according to [RFC3987]. 270 Every URI [RFC3986] is also an IRI, so a URI may be used wherever 271 below an IRI is named. There is one special consideration: when an 272 IRI that is not also a URI is given for dereferencing, it MUST be 273 mapped to a URI using the steps in Section 3.1 of [RFC3987]. 275 Any element defined by this specification MAY have an xml:base 276 attribute [REC-xmlbase]. When xml:base is used in an Metalink 277 Document, it serves the function described in Section 5.1.1 of 278 [RFC3986], establishing the base URI (or IRI) for resolving any 279 relative references found within the effective scope of the xml:base 280 attribute. 282 Any element defined by this specification MAY have an xml:lang 283 attribute, whose content indicates the natural language for the 284 element and its descendents. The language context is only 285 significant for elements and attributes declared to be "Language- 286 Sensitive" by this specification. Requirements regarding the content 287 and interpretation of xml:lang are specified in XML 1.0 [REC-xml], 288 Section 2.12. 290 metalinkCommonAttributes = 291 attribute xml:base { metalinkUri }?, 292 attribute xml:lang { metalinkLanguageTag }?, 293 undefinedAttribute* 295 Metalink is an extensible format. See Section 6 of this document for 296 a full description of how Metalink Documents can be extended. 298 3. Common Metalink Constructs 300 Many of Metalink's elements share a few common structures. This 301 section defines those structures and their requirements for 302 convenient reference by the appropriate element definitions. 304 When an element is identified as being a particular kind of 305 construct, it inherits the corresponding requirements from that 306 construct's definition in this section. 308 Note that there MUST NOT be any white space in a Date construct or in 309 any IRI. Some XML-emitting implementations erroneously insert white 310 space around values by default, and such implementations will emit 311 invalid Metalink Documents. 313 3.1. Text Constructs 315 A Text construct contains human-readable text, usually in small 316 quantities. The content of Text constructs is Language-Sensitive. 318 metalinkTextConstruct = 319 metalinkCommonAttributes, 320 text 322 3.1.1. Text 324 Example metalink:description with text content: 326 ... 327 328 A description of the example file for download. 329 330 ... 332 The content of the Text construct MUST NOT contain child elements. 333 Such text is intended to be presented to humans in a readable 334 fashion. Thus, white space could be collapsed (including line 335 breaks) and text could be displayed using typographic techniques such 336 as justification and proportional fonts. 338 3.2. Date Constructs 340 A Date construct is an element whose content MUST conform to the 341 "date-time" production in [RFC3339]. In addition, an uppercase "T" 342 character MUST be used to separate date and time, and an uppercase 343 "Z" character MUST be present in the absence of a numeric time zone 344 offset. 346 metalinkDateConstruct = 347 metalinkCommonAttributes, 348 xsd:dateTime 350 Such date values happen to be compatible with the following 351 specifications: [ISO.8601.1988], [W3C.NOTE-datetime-19980827], and 352 [W3C.REC-xmlschema-2-20041028]. 354 Example Date constructs: 356 2009-05-15T18:30:02Z 357 2009-05-15T18:30:02.25Z 358 2009-05-15T18:30:02+01:00 359 2009-05-15T18:30:02.25+01:00 360 Date values SHOULD be as accurate as possible. For example, it would 361 be generally inappropriate for a publishing system to apply the same 362 timestamp to several Metalink Documents that were published during 363 the course of a single day. 365 4. Metalink Element Definitions 367 4.1. Container Elements 369 4.1.1. The "metalink:metalink" Element 371 The "metalink:metalink" element is the document (i.e., top-level) 372 element of a Metalink Document, acting as a container for metadata 373 and data associated with the listed files. It contains one or more 374 metalink:file child elements which consist of metadata elements. 376 metalinkMetalink = 377 element metalink:metalink { 378 metalinkCommonAttributes, 379 (metalinkDynamic? 380 & metalinkFile+ 381 & metalinkGenerator? 382 & metalinkOrigin? 383 & metalinkPublished? 384 & metalinkUpdated? 385 & extensionElement*) 386 } 388 The following child elements are defined by this specification (note 389 that the presence of some of these elements is required): 391 o metalink:metalink elements MAY contain exactly one metalink: 392 dynamic element. 393 o metalink:metalink elements MUST contain one or more metalink:file 394 elements. 395 o metalink:metalink elements MAY contain exactly one metalink: 396 generator element. 397 o metalink:metalink elements SHOULD contain exactly one metalink: 398 origin element. 399 o metalink:metalink elements MAY contain exactly one metalink: 400 published element. 402 4.1.1.1. Providing Textual Content 404 Experience teaches that downloads providing textual content are in 405 general more useful than those that do not. Some applications (one 406 example is full-text indexers) require a minimum amount of text to 407 function reliably and predictably. Metalink publishers should be 408 aware of these issues. It is advisable that each metalink:file 409 element contain a non-empty metalink:description element, a non-empty 410 metalink:identity element when that element is present, and a non- 411 empty metalink:version element, and a non-empty metalink:publisher 412 element. However, the absence of metalink:description is not an 413 error, and Metalink Processors MUST NOT fail to function correctly as 414 a consequence of such an absence. 416 4.1.2. The "metalink:file" Element 418 The "metalink:file" element represents an individual file, acting as 419 a container for metadata and data associated with the file. 421 All metalink:url elements SHOULD lead to identical files. That is, 422 each metalink:url element should be an alternative location for the 423 same file and each metalink:metaurl element should provide metadata 424 to retrieve the same file in another way, such as a peer to peer 425 network. 427 metalinkFile = 428 element metalink:file { 429 metalinkCommonAttributes, 430 attribute name { text }, 431 (metalinkCopyright? 432 & metalinkDescription? 433 & metalinkHash* 434 & metalinkIdentity? 435 & metalinkLanguage? 436 & metalinkLicense? 437 & metalinkLogo? 438 & metalinkMetaURL* 439 & metalinkURL* 440 & metalinkOS* 441 & metalinkPieces* 442 & metalinkPublisher? 443 & metalinkSignature? 444 & metalinkSize? 445 & metalinkVersion? 446 & extensionElement*) 447 } 449 This specification assigns no significance to the order of metalink: 450 file elements or to the order of metalink:url or metalink:metaurl 451 elements. Significance is determined by the value of the "priority" 452 attribute of the metalink:url or metalink:metaurl elements. 454 The following child elements are defined by this specification (note 455 that it requires the presence of some of these elements): 457 o metalink:file elements MAY contain exactly one metalink:copyright 458 element. 459 o metalink:file elements MAY contain exactly one metalink: 460 description element. 461 o metalink:file elements MAY contain exactly one metalink:identity 462 element. 463 o metalink:file elements MAY contain one or more metalink:hash 464 elements. 465 o metalink:file elements MAY contain exactly one metalink:language 466 element. 467 o metalink:file elements MAY contain exactly one metalink:license 468 element. 469 o metalink:file elements MAY contain exactly one metalink:logo 470 element. 471 o metalink:file elements MAY contain one or more metalink:os 472 element. 473 o metalink:file elements MUST contain at least one metalink:url 474 element or at least one metalink:metaurl element. Typically, 475 metalink:file elements contain more than one metalink:url element 476 to provide multiple download sources. 477 o metalink:file elements MAY contain one or more metalink:pieces 478 elements. 479 o metalink:file elements MAY contain exactly one metalink:publisher 480 element. 481 o metalink:file elements MAY contain one or more metalink:signature 482 elements. 483 o metalink:file elements SHOULD contain exactly one metalink:size 484 element. 485 o metalink:file elements MAY contain exactly one metalink:version 486 element. 488 4.1.2.1. The "name" Attribute 490 metalink:file elements MUST have a "name" attribute, which contains 491 the filename of the file to be downloaded. 493 Directory information can also be contained in a "path/file" format 494 only, as in: 496 498 In this example, a subdirectory "debian-amd64/sarge/" will be created 499 and a file named "Contents-amd64.gz" will be created inside it. The 500 path MUST NOT contain any directory traversal directives or 501 information. The path MUST be relative. The path MUST NOT begin 502 with a "/", "./" or "../", contain "/../", or end with "/..". 504 4.1.3. The "metalink:pieces" Element 506 The "metalink:pieces" element acts as a container for a list of 507 checksums of non-overlapping pieces of the file. The checksums MUST 508 be listed in the same order as the corresponding pieces appear in the 509 file, starting at the beginning of the file. 511 metalinkPieces = 512 element metalink:pieces { 513 attribute length { xsd:integer }, 514 attribute type { text }, 515 metalinkHash+ 516 } 518 4.1.3.1. The "type" Attribute 520 metalink:pieces elements MUST have a "type" attribute. 522 The IANA registry named "Hash Function Textual Names" defines values 523 for hash types. If a Metalink Document contains hashes, it SHOULD 524 include "sha-1" which is SHA-1 as specified in [RFC3174], or a 525 stronger hash. It MAY also include other hashes. 527 4.1.3.2. The "length" Attribute 529 metalink:pieces elements MUST have a "length" attribute, which is an 530 integer that describes the length of the pieces of the file in 531 octets. The whole file is divided into non-overlapping pieces of 532 this length, starting from the beginning of the file. That is, every 533 piece should be the same size, apart from the last piece which is the 534 remainder. The last piece extends to the end of the file, and can 535 therefore be shorter than the other pieces. 537 4.2. Metadata Elements 539 4.2.1. The "metalink:copyright" Element 541 The "metalink:copyright" element is a Text construct that conveys a 542 human-readable copyright for a file. 544 metalinkCopyright = 545 element metalink:copyright { 546 metalinkTextConstruct 547 } 549 4.2.2. The "metalink:description" Element 551 The "metalink:description" element is a Text construct that conveys a 552 human-readable description for a file. 554 metalinkDescription = 555 element metalink:description { 556 metalinkTextConstruct 557 } 559 4.2.3. The "metalink:dynamic" Element 561 The "metalink:dynamic" element is a Text construct that describes 562 whether the IRI from "metalink:origin" in a Metalink will contain 563 dynamic updated information or if it is static and not likely to be 564 updated. 566 metalinkDynamic = 567 element metalink:dynamic { 568 "true" | "false" 569 } 571 4.2.4. The "metalink:generator" Element 573 The "metalink:generator" element's content identifies the generating 574 agent name and version, separated by a "/", used to generate a 575 Metalink Document, for debugging and other purposes. 577 metalinkGenerator = 578 element metalink:generator { 579 metalinkTextConstruct 580 } 582 The content of this element, when present, MUST be a string that is a 583 human-readable name and version, separated by a "/", for the 584 generating agent. For example, "MirrorBrain/2.9.2", where 585 "MirrorBrain" is the name and "2.9.2" is the version. Entities such 586 as "&" and "<" represent their corresponding characters ("&" 587 and "<" respectively), not markup. 589 4.2.5. The "metalink:hash" Element 591 The "metalink:hash" element is a Text construct that conveys a hash 592 for a file. All hashes are encoded in lowercase hexadecimal format. 593 Hashes are used to verify the integrity of a complete file or portion 594 of a file to determine if the file has been transferred without any 595 errors. 597 metalinkHash = 598 element metalink:hash { 599 attribute type { text }?, 600 text 601 } 603 metalink:hash elements with a "type" attribute MUST contain a hash of 604 the complete file. Metalink Documents can contain one or multiples 605 hashes of a complete file. In this example, both SHA-1 and SHA-256 606 hashes are included. 608 ... 609 a97fcf6ba9358f8a6f62beee4421863d3e52b080 610 fc87941af7fd7f03e53b34af393f4c14923d74 611 825f51116ff591336af4880227 612 ... 614 Metalink Documents can also contain hashes for individual pieces of a 615 file. metalink:hash elements that are inside a metalink:pieces 616 container element have a hash for that specific piece or chunk of the 617 file, and are of the same hash type as the metalink:pieces element 618 they are contained in. metalink:hash elements without a "type" 619 attribute MUST contain a hash for that specific piece or chunk of the 620 file and MUST be listed in the same order as the corresponding pieces 621 appear in the file, starting at the beginning of the file. The size 622 of the piece is equal to the value of the "length" attribute of the 623 metalink:pieces element. The whole file is divided into non- 624 overlapping pieces of this length, starting from the beginning of the 625 file. That is, every piece should be the same size, apart from the 626 last piece which is the remainder. The last piece extends to the end 627 of the file, and can therefore be shorter than the other pieces. 629 ... 630 a97fcf6ba9358f8a6f62beee4421863d3e52b080 631 fc87941af7fd7f03e53b34af393f4c14923d74 632 825f51116ff591336af4880227 633 634 d96b9a4b92a899c2099b7b31bddb5ca423bb9b30 635 10d68f4b1119014c123da2a0a6baf5c8a6d5ba1e 636 3e84219096435c34e092b17b70a011771c52d87a 637 67183e4c3ab892d3ebe8326b7d79eb62d077f487 638 639 ... 641 4.2.5.1. The "type" Attribute 643 metalink:hash elements MUST have a "type" attribute, if and only if 644 it contains a hash of the complete file. The IANA registry named 645 "Hash Function Textual Names" defines values for hash types. If a 646 Metalink Document contains hashes, it SHOULD include "sha-1" which is 647 SHA-1 as specified in [RFC3174], or a stronger hash. It MAY also 648 include additional hash types. 650 4.2.6. The "metalink:identity" Element 652 The "metalink:identity" element is a Text construct that conveys a 653 human-readable identity for a file. The identity of OpenOffice.org 654 3.0 would be "OpenOffice.org". 656 metalinkIdentity = 657 element metalink:identity { 658 metalinkTextConstruct 659 } 661 4.2.7. The "metalink:language" Element 663 The "metalink:language" element is a Text construct that conveys a 664 code for the language of a file, per [RFC5646]. 666 metalinkLanguage = 667 element metalink:language { 668 metalinkTextConstruct 669 } 671 4.2.8. The "metalink:license" Element 673 The "metalink:license" element is a Text construct that conveys a 674 human-readable license name for a file. 676 metalinkLicense = 677 element metalink:license { 678 metalinkCommonAttributes, 679 attribute url { metalinkUri }?, 680 attribute name { text }? 681 } 683 The metalink:license element MAY have a "url" attribute whose value 684 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 685 URI (mapped from an IRI, if necessary) SHOULD produce a 686 representation that is relevant to that agent. 688 The metalink:license element MAY have a "name" attribute that 689 indicates the name of the license. 691 4.2.9. The "metalink:logo" Element 693 The "metalink:logo" element's content is an IRI reference [RFC3987] 694 that identifies an image that provides visual identification for a 695 file. 697 metalinkLogo = 698 element metalink:logo { 699 metalinkCommonAttributes, 700 (metalinkUri) 701 } 703 The image SHOULD have an aspect ratio of one (horizontal) to one 704 (vertical) and SHOULD be suitable for presentation at a small size. 706 4.2.10. The "metalink:metaurl" Element 708 The "metalink:metaurl" element contains the IRI of metadata about a 709 resource to download. For example, this could be the IRI of a 710 BitTorrent .torrent file or a Metalink Document. Note that the 711 information in the metalink:hash element does not apply to these 712 files, but to the files that are described by them. 714 metalinkMetaURL = 715 element metalink:metaurl { 716 metalinkCommonAttributes, 717 attribute priority { xsd:integer }?, 718 attribute type { text }, 719 attribute name { text }?, 720 metalinkUri 721 } 723 4.2.10.1. The "priority" Attribute 725 metalink:metaurl elements MAY have a priority attribute. Lower 726 values indicate a higher priority. Multiple metalink:metaurl 727 elements can have the same priority, i.e. three BitTorrent .torrent 728 files could have priority="1". See also the "priority" attribute of 729 the metalink:url element. 731 4.2.10.2. The "type" Attribute 733 metalink:metaurl elements MUST have a "type" attribute that indicates 734 the MIME type of the metadata available at the IRI. In the case of 735 BitTorrent as specified in [BITTORRENT], the value "torrent" is 736 required. Types without "/" are reserved. Currently, "torrent" is 737 the only reserved value. 739 4.2.10.3. The "name" Attribute 741 metalink:metaurl elements MAY have a "name" attribute that indicates 742 a specific file in a BitTorrent .torrent file or a Metalink Document 743 that describes multiple files. 745 Directory information can also be contained in a "path/file" format 746 only, as in: 748 750 In this example, a file named "Contents-amd64.gz" is indicated, in a 751 "debian-amd64/sarge/" subdirectory. The path MUST NOT contain any 752 directory traversal directives or information. The path MUST be 753 relative. The path MUST NOT begin with a "/", "./" or "../", contain 754 "/../", or end with "/..". 756 4.2.11. The "metalink:origin" Element 758 The "metalink:origin" element is an IRI where the Metalink Document 759 was originally published. If metalink:dynamic is "true", then 760 updated versions of the Metalink can be found at this IRI. 762 metalinkOrigin = 763 element metalink:origin { 764 metalinkCommonAttributes, 765 (metalinkUri) 766 } 768 4.2.12. The "metalink:os" Element 770 The "metalink:os" element is a Text construct that conveys a human- 771 readable Operating System for a file. The IANA registry named 772 "Operating System Names" defines values for OS types. 774 metalinkOS = 775 element metalink:os { 776 metalinkTextConstruct 777 } 779 4.2.13. The "metalink:published" Element 781 The "metalink:published" element is a Date construct indicating an 782 instant in time associated with an event early in the life cycle of 783 the entry. 785 metalinkPublished = 786 element metalink:published { 787 metalinkDateConstruct 788 } 790 Typically, metalink:published will be associated with the initial 791 creation or first availability of the resource. 793 4.2.14. The "metalink:publisher" Element 795 The "metalink:publisher" element indicates a group or other entity 796 which has published the file described in the Metalink Document. 798 metalinkPublisher = 799 element metalink:publisher { 800 metalinkCommonAttributes, 801 attribute url { metalinkUri }?, 802 attribute name { text }? 803 } 805 The metalink:publisher element MAY have a "url" attribute whose value 806 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 807 URI (mapped from an IRI, if necessary) SHOULD produce a 808 representation that is relevant to that agent. 810 The metalink:publisher element MAY have a "name" attribute that 811 indicates the name of the publisher. 813 4.2.15. The "metalink:signature" Element 815 The "metalink:signature" element is a Text construct that conveys a 816 digital signature for a file described in a Metalink Document. 817 Digital signatures verify that a file is from the entity that has 818 signed it. 820 metalinkSignature = 821 element metalink:signature { 822 attribute type { "pgp" }, 823 metalinkTextConstruct 824 } 826 4.2.15.1. The "type" Attribute 828 metalink:signature elements MUST have a "type" attribute. The 829 initial value of "type" is the string that is non-empty and matches 830 "pgp". It may be useful to extend Metalink documents with new types 831 of digital signatures, so unknown types are allowed. 833 4.2.16. The "metalink:size" Element 835 The "metalink:size" element indicates the length of the linked 836 content in octets; it is a hint about the content length of the 837 representation returned when the IRI is mapped to a URI and 838 dereferenced. 840 metalinkSize = 841 element metalink:size { 842 metalinkTextConstruct 843 } 845 4.2.17. The "metalink:updated" Element 847 The "metalink:updated" element is a Date construct indicating the 848 most recent instant in time when a Metalink was modified in a way the 849 publisher considers significant. Therefore, not all modifications 850 necessarily result in a changed metalink:updated value. 852 metalinkUpdated = 853 element metalink:updated { 854 metalinkDateConstruct 855 } 857 Publishers MAY change the value of this element over time. 859 4.2.18. The "metalink:url" Element 861 The "metalink:url" element contains the IRI of a file. Most Metalink 862 Documents will contain multiple metalink:url elements, and each one 863 SHOULD be a valid alternative to download the same file. 865 metalinkURL = 866 element metalink:url { 867 metalinkCommonAttributes, 868 attribute location { xsd:string { 869 minLength = "2" maxLength="2"} 870 }?, 871 attribute priority { xsd:integer }?, 872 metalinkUri 873 } 875 4.2.18.1. The "priority" Attribute 877 metalink:url elements MAY have a priority attribute. Lower values 878 indicate a higher priority. Multiple metalink:url elements can have 879 the same priority, i.e. ten mirrors could have priority="1". 881 4.2.18.2. The "location" Attribute 883 metalink:url elements MAY have a "location" attribute, which is a 884 [ISO3166-1] alpha-2 two letter country code for the geographical 885 location of the physical server an IRI is used to access. 887 4.2.19. The "metalink:version" Element 889 The "metalink:version" element is a Text construct that conveys a 890 human-readable version for a file. The version of OpenOffice.org 3.0 891 would be "3.0". 893 metalinkVersion = 894 element metalink:version { 895 metalinkTextConstruct 896 } 898 5. Securing Metalink Documents 900 Because Metalink is an XML-based format, existing XML security 901 mechanisms can be used to secure its content. 903 Producers of Metalink Documents may have sound reasons for signing 904 otherwise-unprotected content. For example, a merchant might 905 digitally sign a Metalink that lists a file download to verify its 906 origin. Other merchants may wish to sign and encrypt Metalink 907 Documents that list digital songs that have been purchased. Of 908 course, many other examples are conceivable as well. 910 The algorithm requirements in this section pertain to the Metalink 911 Processor. They require that a recipient, at a minimum, be able to 912 handle messages that use the specified cryptographic algorithms. 913 These requirements do not limit the algorithms that the sender can 914 choose. 916 Metalink Processors that verify signed Metalink Documents MUST at 917 least support XML-Signature and Syntax Processing [REC-xmldsig-core]. 919 6. Extending Metalink 921 6.1. Extensions from Non-Metalink Vocabularies 923 This specification describes Metalink's XML markup vocabulary. 924 Markup from other vocabularies ("foreign markup") can be used in an 925 Metalink Document. 927 6.2. Extensions to the Metalink Vocabulary 929 The Metalink namespace is reserved for future forward-compatible 930 revisions of Metalink. Future versions of this specification could 931 add new elements and attributes to the Metalink markup vocabulary. 932 Software written to conform to this version of the specification will 933 not be able to process such markup correctly and, in fact, will not 934 be able to distinguish it from markup error. For the purposes of 935 this discussion, unrecognized markup from the Metalink vocabulary 936 will be considered "foreign markup". 938 6.3. Processing Foreign Markup 940 Metalink Processors that encounter foreign markup in a location that 941 is legal according to this specification MUST NOT stop processing or 942 signal an error. It might be the case that the Metalink Processor is 943 able to process the foreign markup correctly and does so. Otherwise, 944 such markup is termed "unknown foreign markup". 946 When unknown foreign markup is encountered as a child of metalink: 947 file, metalink:metalink, Metalink Processors MAY bypass the markup 948 and any textual content and MUST NOT change their behavior as a 949 result of the markup's presence. 951 When unknown foreign markup is encountered in a Text Construct, 952 software SHOULD ignore the markup and process any text content of 953 foreign elements as though the surrounding markup were not present. 955 6.4. Extension Elements 957 Metalink allows foreign markup anywhere in an Metalink document, 958 except where it is explicitly forbidden. Child elements of metalink: 959 file and metalink:metalink are considered Metadata elements and are 960 described below. Child elements of Person constructs are considered 961 to apply to the construct. The role of other foreign markup is 962 undefined by this specification. 964 6.4.1. Simple Extension Elements 966 A Simple Extension element MUST NOT have any attributes or child 967 elements. The element MAY contain character data or be empty. 968 Simple Extension elements are not Language-Sensitive. 970 simpleExtensionElement = 971 element * - metalink:* { 972 text 973 } 975 The element can be interpreted as a simple property (or name/value 976 pair) of the parent element that encloses it. The pair consisting of 977 the namespace-URI of the element and the local name of the element 978 can be interpreted as the name of the property. The character data 979 content of the element can be interpreted as the value of the 980 property. If the element is empty, then the property value can be 981 interpreted as an empty string. 983 6.4.2. Structured Extension Elements 985 The root element of a Structured Extension element MUST have at least 986 one attribute or child element. It MAY have attributes, it MAY 987 contain well-formed XML content (including character data), or it MAY 988 be empty. Structured Extension elements are Language-Sensitive. 990 structuredExtensionElement = 991 element * - metalink:* { 992 (attribute * { text }+, 993 (text|anyElement)*) 994 | (attribute * { text }*, 995 (text?, anyElement+, (text|anyElement)*)) 996 } 998 The structure of a Structured Extension element, including the order 999 of its child elements, could be significant. 1001 This specification does not provide an interpretation of a Structured 1002 Extension element. The syntax of the XML contained in the element 1003 (and an interpretation of how the element relates to its containing 1004 element) is defined by the specification of the Metalink extension. 1006 7. IANA Considerations 1008 7.1. XML Namespace Registration 1010 This document makes use of the XML registry specified in [RFC3688]. 1011 Accordingly, IANA has made the following registration: 1013 Registration request for the Metalink namespace: 1015 URI: urn:ietf:params:xml:ns:metalink 1017 Registrant Contact: See the "Author's Address" section of this 1018 document. 1020 XML: None. Namespace URIs do not represent an XML specification. 1022 7.2. application/metalink4+xml MIME type 1024 A Metalink Document, when serialized as XML 1.0, can be identified 1025 with the following media type: 1027 MIME media type name: application 1028 MIME subtype name: metalink4+xml 1029 Mandatory parameters: None. 1030 Optional parameters: 1031 "charset": This parameter has semantics identical to the charset 1032 parameter of the "application/xml" media type as specified in 1033 [RFC3023]. 1034 Encoding considerations: Identical to those of "application/xml" as 1035 described in [RFC3023], Section 3.2. 1036 Security considerations: As defined in this specification. 1037 In addition, as this media type uses the "+xml" convention, it 1038 shares the same security considerations as described in [RFC3023], 1039 Section 10. 1040 Interoperability considerations: There are no known interoperability 1041 issues. 1042 Published specification: This specification. 1043 Applications that use this media type: No known applications 1044 currently use this media type. 1046 Additional information: 1048 Magic number(s): As specified for "application/xml" in [RFC3023], 1049 Section 3.2. 1050 File extension: .meta4 1051 Fragment identifiers: As specified for "application/xml" in 1052 [RFC3023], Section 5. 1053 Base URI: As specified in [RFC3023], Section 6. 1054 Macintosh File Type code: TEXT 1055 Person and email address to contact for further information: Anthony 1056 Bryan 1057 Intended usage: COMMON 1058 Author/Change controller: IESG 1060 8. Security Considerations 1062 Publishers are encouraged to offer Metalink documents via 1063 authenticated HTTP under TLS as specified in [RFC2818]. Publishers 1064 are also encouraged to include digital signatures of the files within 1065 the Metalink Documents if they are available. 1067 8.1. URIs and IRIs 1069 Metalink Processors handle URIs and IRIs. See Section 7 of [RFC3986] 1070 and Section 8 of [RFC3987] for security considerations related to 1071 their handling and use. 1073 8.2. Spoofing 1075 There is potential for spoofing attacks where the attacker publishes 1076 Metalink Documents with false information. Malicious publishers 1077 might create Metalink Documents containing inaccurate information 1078 anywhere in the document. Unaware downloaders could be deceived into 1079 downloading a malicious or worthless file. Malicious publishers 1080 could attempt a distributed denial of service attack by inserting 1081 unrelated IRIs into Metalink Documents. 1083 8.3. Cryptographic Hashes 1085 Currently, some of the hash types defined in the IANA registry named 1086 "Hash Function Textual Names" are considered insecure. These include 1087 the whole Message Digest family of algorithms which are not suitable 1088 for cryptographically strong verification. Malicious people could 1089 provide files that appear to be identical to another file because of 1090 a collision, i.e. the weak cryptographic hashes of the intended file 1091 and a substituted malicious file could match. 1093 If a Metalink Document contains hashes, it SHOULD include "sha-1" 1094 which is SHA-1, as specified in [RFC3174], or stronger. It MAY also 1095 include other hashes from the IANA registry named "Hash Function 1096 Textual Names". 1098 8.4. Signing 1100 Metalink Documents SHOULD be signed using [REC-xmldsig-core] and are 1101 subject to the security considerations implied by its use. This 1102 addresses the issue of spoofing. 1104 Digital signatures provide authentication, message integrity, and 1105 non-repudiation with proof of origin. 1107 9. References 1109 9.1. Normative References 1111 [BITTORRENT] 1112 Cohen, B., "The BitTorrent Protocol Specification", 1113 BITTORRENT 11031, February 2008, 1114 . 1116 [ISO3166-1] 1117 International Organization for Standardization, "ISO 3166- 1118 1:2006. Codes for the representation of names of 1119 countries and their subdivisions -- Part 1: Country 1120 codes", November 2006. 1122 [REC-xml] Yergeau, F., Paoli, J., Bray, T., Sperberg-McQueen, C., 1123 and E. Maler, "Extensible Markup Language (XML) 1.0 1124 (Fourth Edition)", World Wide Web Consortium 1125 Recommendation REC-xml-20060816, August 2006, 1126 . 1128 [REC-xml-infoset] 1129 Cowan, J. and R. Tobin, "XML Information Set (Second 1130 Edition)", World Wide Web Consortium Recommendation REC- 1131 xml-infoset-20040204, February 2004, 1132 . 1134 [REC-xml-names] 1135 Hollander, D., Bray, T., Tobin, R., and A. Layman, 1136 "Namespaces in XML 1.0 (Second Edition)", World Wide Web 1137 Consortium Recommendation REC-xml-names-20060816, 1138 August 2006, 1139 . 1141 [REC-xmlbase] 1142 Marsh, J., "XML Base", W3C REC W3C.REC-xmlbase-20010627, 1143 June 2001, 1144 . 1146 [REC-xmldsig-core] 1147 Solo, D., Reagle, J., and D. Eastlake, "XML-Signature 1148 Syntax and Processing (Second Edition)", World Wide Web 1149 Consortium Recommendation REC-xmldsig-core-20080610, 1150 June 2008, 1151 . 1153 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1154 Requirement Levels", BCP 14, RFC 2119, March 1997. 1156 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1158 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media 1159 Types", RFC 3023, January 2001. 1161 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 1162 (SHA1)", RFC 3174, September 2001. 1164 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1165 Timestamps", RFC 3339, July 2002. 1167 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1168 January 2004. 1170 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1171 Resource Identifier (URI): Generic Syntax", STD 66, 1172 RFC 3986, January 2005. 1174 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 1175 Identifiers (IRIs)", RFC 3987, January 2005. 1177 [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying 1178 Languages", BCP 47, RFC 5646, September 2009. 1180 9.2. Informative References 1182 [ISO.8601.1988] 1183 International Organization for Standardization, "Data 1184 elements and interchange formats - Information interchange 1185 - Representation of dates and times", ISO Standard 8601, 1186 June 1988. 1188 [RELAX-NG] 1189 Clark, J., "RELAX NG Compact Syntax", December 2001, 1190 . 1193 [RFC4287] Nottingham, M. and R. Sayre, "The Atom Syndication 1194 Format", RFC 4287, December 2005. 1196 [W3C.NOTE-datetime-19980827] 1197 Wolf, M. and C. Wicksteed, "Date and Time Formats", W3C 1198 NOTE NOTE-datetime-19980827, August 1998, 1199 . 1201 [W3C.REC-xmlschema-2-20041028] 1202 Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes 1203 Second Edition", W3C REC REC-xmlschema-2-20041028, 1204 October 2004, 1205 . 1207 Appendix A. Acknowledgements and Contributors 1209 The layout and content of this document relies heavily on work 1210 pioneered in the Atom Syndication Format as specified in [RFC4287]. 1212 The content and concepts within are a product of the Metalink 1213 community. 1215 The Metalink community has dozens of contributors who proposed ideas 1216 and wording for this document, or contributed to the evolution of 1217 Metalink, including: 1219 Paul Burkhead, Kristian Weston, Darius Liktorius, Michael Burford, 1220 Giorgio Maone, Manuel Subredu, A. Bram Neijt, Max Velasques, Manolo 1221 Valdes, Urs Wolfer, Frederick Cheung, Nils Maier, Hampus Wessman, 1222 Hayden Legendre, Danny Ayers, Nick Dominguez, Rene Leonhardt, Per 1223 Oyvind Karlsen, Gary Zellerbach, James Clark, Daniel Stenberg, Matt 1224 Domsch, Yazsoft, KGet developers, FDM Team, Orbit Team, Arne 1225 Babenhauserheide, Mathias Berchtold, Xienzhenyu and TheWorld Browser 1226 Team, Xi Software, Nicolas Alvarez, Patrick Ruckstuhl, Sebastien 1227 Willemijns, Micah Cowan, Bridget and Ethan Fletcher, Ruben Kerkhof, 1228 Agostino Russo, Salvatore Musumeci, Steve Eshelman, Lucas Hewett, 1229 Ryan Cronin, Dave Winquist, Bob Denison, Wes Shelton, Kees Cook, Josh 1230 Colbert, Steve Kleisath, Chad Neptune, Nick Carrabba, Chris Carrabba, 1231 Erin Solari, Derick Cordoba, Ryan Alexander, John & Sandra Sowder, 1232 Tom Mainville, Janie Wargo, Jason Hansen, Tim Bray, Dan Brickley, 1233 Markus Hofmann, Dan Connolly, Tim Berners-Lee, Louis Suarez-Potts, 1234 Ross Smith, Jeff Covey, Ed Lee, Shawn Wilsher, Mike Connor, Johan 1235 Svedberg, Dedric Carter, James Antill, Debi Goulding, Chris Newman, 1236 Lisa Dusseault, Ian Macfarlane, Dave Cridland, Julian Reschke, Barry 1237 Leiba, Uri Blumenthal, Paul Hoffman, Felix Sasaki, Matthias Fuchs, 1238 Eran Hammer-Lahav, and Mark Nottingham. We also thank the Anthony 1239 Family, the Bryan Family, Juanita Anthony and Zimmy Bryan. 1241 Appendix B. RELAX NG Compact Schema 1243 This appendix is informative. 1245 The Relax NG schema explicitly excludes elements in the Metalink 1246 namespace that are not defined in this revision of the specification. 1247 Requirements for Metalink Processors encountering such markup are 1248 given in Sections 6.2 and 6.3. 1250 # -*- rnc -*- 1251 # RELAX NG Compact Syntax Grammar for the 1252 # Metalink Format Specification Version 4 1253 namespace local = "" 1254 namespace metalink = "urn:ietf:params:xml:ns:metalink" 1255 namespace xsd = "http://www.w3.org/2001/XMLSchema" 1257 # Common attributes 1259 metalinkCommonAttributes = 1260 attribute xml:base { metalinkUri }?, 1261 attribute xml:lang { metalinkLanguageTag }?, 1262 undefinedAttribute* 1264 # Text Constructs 1266 metalinkTextConstruct = 1267 metalinkCommonAttributes, 1268 text 1270 # Date Construct 1272 metalinkDateConstruct = 1273 metalinkCommonAttributes, 1274 xsd:dateTime 1276 start = metalinkMetalink 1278 metalinkMetalink = 1279 element metalink:metalink { 1280 metalinkCommonAttributes, 1281 (metalinkDynamic? 1282 & metalinkFile+ 1283 & metalinkGenerator? 1284 & metalinkOrigin? 1285 & metalinkPublished? 1286 & metalinkUpdated? 1287 & extensionElement*) 1288 } 1290 metalinkFile = 1291 element metalink:file { 1292 metalinkCommonAttributes, 1293 attribute name { text }, 1294 (metalinkCopyright? 1295 & metalinkDescription? 1296 & metalinkIdentity? 1297 & metalinkHash* 1298 & metalinkLanguage? 1299 & metalinkLicense? 1300 & metalinkLogo? 1301 & metalinkMetaURL* 1302 & metalinkURL* 1303 & metalinkOS* 1304 & metalinkPieces* 1305 & metalinkPublisher? 1306 & metalinkSignature? 1307 & metalinkSize? 1308 & metalinkVersion? 1309 & extensionElement*) 1310 } 1312 metalinkPieces = 1313 element metalink:pieces { 1314 attribute length { xsd:integer }, 1315 attribute type { text }, 1316 metalinkHash+ 1317 } 1319 metalinkCopyright = 1320 element metalink:copyright { 1321 metalinkTextConstruct 1322 } 1324 metalinkDescription = 1325 element metalink:description { 1326 metalinkTextConstruct 1327 } 1329 metalinkDynamic = 1330 element metalink:dynamic { 1331 "true" | "false" 1332 } 1334 metalinkGenerator = 1335 element metalink:generator { 1336 metalinkTextConstruct 1337 } 1339 metalinkHash = 1340 element metalink:hash { 1341 attribute type { text }?, 1342 text 1343 } 1345 metalinkIdentity = 1346 element metalink:identity { 1347 metalinkTextConstruct 1348 } 1350 metalinkLanguage = 1351 element metalink:language { 1352 metalinkTextConstruct 1353 } 1355 metalinkLicense = 1356 element metalink:license { 1357 metalinkCommonAttributes, 1358 attribute url { metalinkUri }?, 1359 attribute name { text }? 1360 } 1362 metalinkLogo = 1363 element metalink:logo { 1364 metalinkCommonAttributes, 1365 (metalinkUri) 1366 } 1368 metalinkMetaURL = 1369 element metalink:metaurl { 1370 metalinkCommonAttributes, 1371 attribute priority { xsd:integer }?, 1372 attribute type { text }, 1373 attribute name { text }?, 1374 metalinkUri 1375 } 1377 metalinkOrigin = 1378 element metalink:origin { 1379 metalinkCommonAttributes, 1380 (metalinkUri) 1381 } 1383 metalinkOS = 1384 element metalink:os { 1385 metalinkTextConstruct 1386 } 1388 metalinkPublished = 1389 element metalink:published { 1390 metalinkDateConstruct 1391 } 1393 metalinkPublisher = 1394 element metalink:publisher { 1395 metalinkCommonAttributes, 1396 attribute url { metalinkUri }?, 1397 attribute name { text }? 1399 } 1401 metalinkSignature = 1402 element metalink:signature { 1403 attribute type { "pgp" }, 1404 metalinkTextConstruct 1405 } 1407 metalinkSize = 1408 element metalink:size { 1409 metalinkTextConstruct 1410 } 1412 metalinkUpdated = 1413 element metalink:updated { 1414 metalinkDateConstruct 1415 } 1417 metalinkURL = 1418 element metalink:url { 1419 metalinkCommonAttributes, 1420 attribute location { xsd:string { 1421 minLength = "2" maxLength="2"} 1422 }?, 1423 attribute priority { xsd:integer }?, 1424 metalinkUri 1425 } 1427 metalinkVersion = 1428 element metalink:version { 1429 metalinkTextConstruct 1430 } 1432 # As defined in RFC 3066 and compatible with RFC 5646 1433 metalinkLanguageTag = xsd:string { 1434 pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*" 1435 } 1437 # Unconstrained; it's not entirely clear how IRI fit into 1438 # xsd:anyURI so let's not try to constrain it here 1439 metalinkUri = text 1441 # Simple Extension 1443 simpleExtensionElement = 1444 element * - metalink:* { 1445 text 1446 } 1448 # Structured Extension 1450 structuredExtensionElement = 1451 element * - metalink:* { 1452 (attribute * { text }+, 1453 (text|anyElement)*) 1454 | (attribute * { text }*, 1455 (text?, anyElement+, (text|anyElement)*)) 1456 } 1458 # Other Extensibility 1460 extensionElement = 1461 simpleExtensionElement | structuredExtensionElement 1463 undefinedAttribute = 1464 attribute * - (xml:base | xml:lang | local:*) { text } 1466 undefinedContent = (text|anyForeignElement)* 1468 anyElement = 1469 element * { 1470 (attribute * { text } 1471 | text 1472 | anyElement)* 1473 } 1475 anyForeignElement = 1476 element * - metalink:* { 1477 (attribute * { text } 1478 | text 1479 | anyElement)* 1480 } 1482 # EOF 1484 Appendix C. Document History (to be removed by RFC Editor before 1485 publication) 1487 [[ to be removed by the RFC editor before publication as an RFC. ]] 1489 Updated versions can be found at 1490 http://tools.ietf.org/html/draft-bryan-metalink with frequent updates 1491 in Subversion at 1492 http://metalinks.svn.sourceforge.net/viewvc/metalinks/internetdraft/ 1494 Known issues concerning this draft: 1496 o None. 1498 -21 : October 13, 2009. 1499 o Update author details. 1501 -20 : October 12, 2009. 1502 o RFC 5646 updates RFC 4646. 1504 -19 : October 5, 2009. 1505 o Remove organization for independent authors. 1507 -18 : October 4, 2009. 1508 o File extension: .meta4 1509 o Hashes clarification, modified to allow multiple metalink:os 1510 elements, add size element to example. 1512 -17 : September 28, 2009. 1513 o Typo correction. 1515 -16 : August 31, 2009. 1516 o Clarifications. 1518 -15 : August 26, 2009. 1519 o Rename "preference" attribute of metaurl and url elements to 1520 "priority", where lower values indicate higher priority. 1522 -14 : August 24, 2009. 1523 o Update abstract and introduction. 1525 -13 : August 21, 2009. 1526 o Remove files, resources, verification container elements. 1527 o MIME type: application/metalink4+xml 1529 -12 : August 18, 2009. 1530 o Remove "piece" attribute from hash elements in pieces container 1531 elements. 1532 o Rename "uri" attribute of license and publisher elements to "url". 1534 -11 : August 08, 2009. 1535 o Renamed type element (static or dynamic values) to dynamic element 1536 (true or false values). 1537 o Removed metadata inheritance and most other elements from files 1538 element. 1540 -10 : July 28, 2009. 1541 o Schema fixes. 1543 o Rename metadata element to metaurl, add name attribute to it 1544 similar to file element's name attribute. 1545 o Update REC-xmldsig-core reference to second edition. 1547 -09 : July 11, 2009. 1548 o Replace ISO639-2 references with RFC 4646. 1549 o Add ISO3166-1. 1551 -08 : July 04, 2009. 1552 o Clarifications. 1553 o Remove "uri" and "version" attributes from generator element. 1555 -07 : June 18, 2009. 1556 o This ID describes the Metalink document format/schema. 1557 o Remove "Client Implementation Considerations" section. 1558 o Expand "Known issues" section of Document History. 1560 -06 : March 3, 2009. 1561 o Add authors and this Document History section. 1563 -05 : January 13, 2009. 1564 o Clarifications. 1566 -04 : December 31, 2008. 1567 o New IPR notice as required by IETF. 1568 o Correct "metalink:pieces" Element text. 1569 o Add hash examples. 1570 o Slim down "Securing Metalink Documents" section. 1571 o Recommend at least SHA-1. 1573 -03 : September 19, 2008. 1574 o New namespace - urn:ietf:params:xml:ns:metalink 1575 o Use the IANA registry named "Operating System Names" to define 1576 values for OS types. 1577 o Add "Client Implementation Considerations" section, which includes 1578 Content Negotiation. 1580 -02 : September 4, 2008. 1581 o Use the IANA registry named "Hash Function Textual Names" for hash 1582 types. 1583 o metadata Element for listing .torrent, .metalink, etc. 1584 o Remove type attribute for url Element. 1586 -01 : August 28, 2008. 1587 o Clarify directory info in name attribute, hash types, add text for 1588 preference attribute. 1590 -00 : August 23, 2008. 1592 o Initial draft; Text largely based on RFC 4287, ideas from Metalink 1593 3.0 specification. 1595 Index 1597 A 1598 application/metalink4+xml Media Type 23 1600 C 1601 copyright XML element 12 1603 D 1604 description XML element 13 1606 F 1607 file XML element 10 1609 G 1610 generator XML element 13 1611 Grammar 1612 metalinkCommonAttributes 7 1613 metalinkCopyright 12 1614 metalinkDateConstruct 8 1615 metalinkDescription 13 1616 metalinkFile 10 1617 metalinkGenerator 13 1618 metalinkHash 14 1619 metalinkIdentity 15 1620 metalinkLanguage 15 1621 metalinkLicense 15 1622 metalinkLogo 16 1623 metalinkMetalink 9 1624 metalinkOrigin 17 1625 metalinkOS 17 1626 metalinkPieces 12 1627 metalinkPublished 18 1628 metalinkPublisher 18 1629 metalinkSignature 18 1630 metalinkSize 19 1631 metalinkTextConstruct 8 1632 metalinkType 13 1633 metalinkUpdated 19 1634 metalinkURL 16, 19 1635 metalinkVersion 20 1636 simpleExtensionElement 21 1637 structuredExtensionElement 22 1639 H 1640 hash XML element 13 1642 I 1643 identity XML element 15 1645 L 1646 language XML element 15 1647 license XML element 15 1648 logo XML element 16 1650 M 1651 Media Type 1652 application/metalink4+xml 23 1653 metadata XML element 16 1654 metalink XML element 9 1655 metalinkCommonAttributes grammar production 7 1656 metalinkCopyright grammar production 12 1657 metalinkDateConstruct grammar production 8 1658 metalinkDescription grammar production 13 1659 metalinkFile grammar production 10 1660 metalinkGenerator grammar production 13 1661 metalinkHash grammar production 14 1662 metalinkIdentity grammar production 15 1663 metalinkLanguage grammar production 15 1664 metalinkLicense grammar production 15 1665 metalinkLogo grammar production 16 1666 metalinkMetalink grammar production 9 1667 metalinkOrigin grammar production 17 1668 metalinkOS grammar production 17 1669 metalinkPieces grammar production 12 1670 metalinkPublished grammar production 18 1671 metalinkPublisher grammar production 18 1672 metalinkSignature grammar production 18 1673 metalinkSize grammar production 19 1674 metalinkTextConstruct grammar production 8 1675 metalinkType grammar production 13 1676 metalinkUpdated grammar production 19 1677 metalinkURL grammar production 16, 19 1678 metalinkVersion grammar production 20 1680 O 1681 origin XML element 17 1682 os XML element 17 1684 P 1685 pieces XML element 12 1686 published XML element 17 1687 publisher XML element 18 1689 S 1690 signature XML element 18 1691 simpleExtensionElement grammar production 21 1692 size XML element 19 1693 structuredExtensionElement grammar production 22 1695 T 1696 type XML element 13 1698 U 1699 updated XML element 19 1700 url XML element 19 1702 V 1703 version XML element 20 1705 X 1706 XML Elements 1707 copyright 12 1708 description 13 1709 entry 10 1710 generator 13 1711 hash 13 1712 identity 15 1713 language 15 1714 license 15 1715 logo 16 1716 metadata 16 1717 metalink 9 1718 origin 17 1719 os 17 1720 pieces 12 1721 published 17 1722 publisher 18 1723 signature 18 1724 size 19 1725 type 13 1726 updated 19 1727 url 19 1728 version 20 1730 Authors' Addresses 1732 Anthony Bryan 1733 Pompano Beach, FL 1734 USA 1736 Email: anthonybryan@gmail.com 1737 URI: http://www.metalinker.org 1739 Tatsuhiro Tsujikawa 1741 Email: tatsuhiro.t@gmail.com 1742 URI: http://aria2.sourceforge.net 1744 Neil McNab 1746 Email: neil@nabber.org 1747 URI: http://www.nabber.org 1749 Peter Poeml 1750 Novell, Inc. 1752 Email: poeml@mirrorbrain.org 1753 URI: http://www.mirrorbrain.org/