idnits 2.17.1 draft-bryan-metalink-12.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 (August 18, 2009) is 5366 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 3 Internet-Draft T. Tsujikawa 4 Intended status: Standards Track N. McNab 5 Expires: February 19, 2010 Metalinker Project 6 P. Poeml 7 Novell, Inc. 8 August 18, 2009 10 The Metalink Download Description Format 11 draft-bryan-metalink-12 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 February 19, 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 Documents, an XML-based download 60 description format. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 65 1.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 4 66 1.2. Namespace and Version . . . . . . . . . . . . . . . . . . 5 67 1.3. Notational Conventions . . . . . . . . . . . . . . . . . . 5 68 2. Metalink Documents . . . . . . . . . . . . . . . . . . . . . . 6 69 3. Common Metalink Constructs . . . . . . . . . . . . . . . . . . 7 70 3.1. Text Constructs . . . . . . . . . . . . . . . . . . . . . 7 71 3.1.1. Text . . . . . . . . . . . . . . . . . . . . . . . . . 8 72 3.2. Date Constructs . . . . . . . . . . . . . . . . . . . . . 8 73 4. Metalink Element Definitions . . . . . . . . . . . . . . . . . 8 74 4.1. Container Elements . . . . . . . . . . . . . . . . . . . . 9 75 4.1.1. The "metalink:metalink" Element . . . . . . . . . . . 9 76 4.1.2. The "metalink:files" Element . . . . . . . . . . . . . 10 77 4.1.3. The "metalink:file" Element . . . . . . . . . . . . . 10 78 4.1.4. The "metalink:resources" Element . . . . . . . . . . . 11 79 4.1.5. The "metalink:verification" Element . . . . . . . . . 12 80 4.1.6. The "metalink:pieces" Element . . . . . . . . . . . . 13 81 4.2. Metadata Elements . . . . . . . . . . . . . . . . . . . . 13 82 4.2.1. The "metalink:copyright" Element . . . . . . . . . . . 13 83 4.2.2. The "metalink:description" Element . . . . . . . . . . 14 84 4.2.3. The "metalink:dynamic" Element . . . . . . . . . . . . 14 85 4.2.4. The "metalink:generator" Element . . . . . . . . . . . 14 86 4.2.5. The "metalink:hash" Element . . . . . . . . . . . . . 15 87 4.2.6. The "metalink:identity" Element . . . . . . . . . . . 16 88 4.2.7. The "metalink:language" Element . . . . . . . . . . . 16 89 4.2.8. The "metalink:license" Element . . . . . . . . . . . . 16 90 4.2.9. The "metalink:logo" Element . . . . . . . . . . . . . 17 91 4.2.10. The "metalink:metaurl" Element . . . . . . . . . . . . 17 92 4.2.11. The "metalink:origin" Element . . . . . . . . . . . . 18 93 4.2.12. The "metalink:os" Element . . . . . . . . . . . . . . 18 94 4.2.13. The "metalink:published" Element . . . . . . . . . . . 18 95 4.2.14. The "metalink:publisher" Element . . . . . . . . . . . 19 96 4.2.15. The "metalink:signature" Element . . . . . . . . . . . 19 97 4.2.16. The "metalink:size" Element . . . . . . . . . . . . . 20 98 4.2.17. The "metalink:updated" Element . . . . . . . . . . . . 20 99 4.2.18. The "metalink:url" Element . . . . . . . . . . . . . . 20 100 4.2.19. The "metalink:version" Element . . . . . . . . . . . . 21 101 5. Securing Metalink Documents . . . . . . . . . . . . . . . . . 21 102 6. Extending Metalink . . . . . . . . . . . . . . . . . . . . . . 21 103 6.1. Extensions from Non-Metalink Vocabularies . . . . . . . . 21 104 6.2. Extensions to the Metalink Vocabulary . . . . . . . . . . 22 105 6.3. Processing Foreign Markup . . . . . . . . . . . . . . . . 22 106 6.4. Extension Elements . . . . . . . . . . . . . . . . . . . . 22 107 6.4.1. Simple Extension Elements . . . . . . . . . . . . . . 22 108 6.4.2. Structured Extension Elements . . . . . . . . . . . . 23 109 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 110 7.1. XML Namespace Registration . . . . . . . . . . . . . . . . 23 111 7.2. application/metalink+xml MIME type . . . . . . . . . . . . 24 112 8. Security Considerations . . . . . . . . . . . . . . . . . . . 24 113 8.1. URIs and IRIs . . . . . . . . . . . . . . . . . . . . . . 25 114 8.2. Spoofing . . . . . . . . . . . . . . . . . . . . . . . . . 25 115 8.3. Cryptographic Hashes . . . . . . . . . . . . . . . . . . . 25 116 8.4. Signing . . . . . . . . . . . . . . . . . . . . . . . . . 25 117 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 25 118 9.1. Normative References . . . . . . . . . . . . . . . . . . . 25 119 9.2. Informative References . . . . . . . . . . . . . . . . . . 27 120 Appendix A. Acknowledgements and Contributors . . . . . . . . . . 27 121 Appendix B. RELAX NG Compact Schema . . . . . . . . . . . . . . . 28 122 Appendix C. Document History (to be removed by RFC Editor 123 before publication) . . . . . . . . . . . . . . . . . 34 124 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 125 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 38 127 1. Introduction 129 Metalink is an XML-based document format that describes a file or 130 lists of files to be added to a download queue. Lists are composed 131 of a number of files, each with an extensible set of attached 132 metadata. For example, each file can have a description, checksum, 133 and list of URIs that it is available from. 135 The primary use case that Metalink addresses is the description of 136 downloadable content in a format so download agents can act 137 intelligently and recover from common errors with little or no user 138 interaction necessary. These errors can include multiple servers 139 going down and data corrupted in transmission. 141 [[ Discussion of this draft should take place on 142 discuss@apps.ietf.org or the Metalink discussion mailing list located 143 at metalink-discussion@googlegroups.com. To join the list, visit 144 http://groups.google.com/group/metalink-discussion . ]] 146 1.1. Examples 148 A brief, single file Metalink Document: 150 151 152 153 154 155 ftp://ftp.example.com/example.ext 156 http://example.com/example.ext 157 158 http://example.com/example.ext.torrent 159 160 161 162 163 164 A more extensive, single file Metalink Document: 166 167 168 2008-05-15T12:23:23Z 169 170 171 Example 172 1.0 173 en 174 A description of the example file for 175 download. 176 177 80bc95fd391772fa61c91ed68567f0980bb45fd9 178 179 180 181 182 ftp://ftp.example.com/example.ext 183 184 http://example.com/example.ext 185 186 http://example.com/example.ext.torrent 187 188 189 190 191 193 1.2. Namespace and Version 195 The XML Namespaces URI [REC-xml-names] for the XML data format 196 described in this specification is: 198 urn:ietf:params:xml:ns:metalink 200 For convenience, this data format may be referred to as "Metalink", 201 which this specification uses internally. 203 1.3. Notational Conventions 205 This specification describes conformance of Metalink Documents. 206 Additionally, it places some requirements on Metalink Processors. 208 This specification uses the namespace prefix "metalink:" for the 209 Namespace URI identified in Section 1.2, above. Note that the choice 210 of namespace prefix is arbitrary and not semantically significant. 212 Metalink is specified using terms from the XML Infoset 213 [REC-xml-infoset]. However, this specification uses a shorthand for 214 two common terms: the phrase "Information Item" is omitted when 215 naming Element Information Items and Attribute Information Items. 216 Therefore, when this specification uses the term "element," it is 217 referring to an Element Information Item in Infoset terms. Likewise, 218 when it uses the term "attribute," it is referring to an Attribute 219 Information Item. 221 Some sections of this specification are illustrated with fragments of 222 a non-normative RELAX NG Compact schema [RELAX-NG]. However, the 223 text of this specification provides the definition of conformance. A 224 complete schema appears in Appendix B. 226 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 227 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 228 document are to be interpreted as described in BCP 14, [RFC2119], as 229 scoped to those conformance targets. 231 2. Metalink Documents 233 This specification describes Metalink Documents. 235 A Metalink Document describes a file or group of files, how to access 236 them, and metadata that identifies them. Its root is the metalink: 237 metalink element. 239 namespace metalink = "urn:ietf:params:xml:ns:metalink" 240 start = metalinkMetalink 242 Metalink Documents are specified in terms of the XML Information Set, 243 serialized as XML 1.0 [REC-xml] and identified with the "application/ 244 metalink+xml" media type. 246 Metalink Documents MUST be well-formed XML. This specification does 247 not define a DTD for Metalink Documents, and hence does not require 248 them to be valid (in the sense used by XML). 250 Metalink allows the use of IRIs [RFC3987]. Every URI [RFC3986] is 251 also an IRI, so a URI may be used wherever below an IRI is named. 252 There is one special consideration: when an IRI that is not also a 253 URI is given for dereferencing, it MUST be mapped to a URI using the 254 steps in Section 3.1 of [RFC3987]. 256 Any element defined by this specification MAY have an xml:base 257 attribute [REC-xmlbase]. When xml:base is used in an Metalink 258 Document, it serves the function described in Section 5.1.1 of 260 [RFC3986], establishing the base URI (or IRI) for resolving any 261 relative references found within the effective scope of the xml:base 262 attribute. 264 Any element defined by this specification MAY have an xml:lang 265 attribute, whose content indicates the natural language for the 266 element and its descendents. The language context is only 267 significant for elements and attributes declared to be "Language- 268 Sensitive" by this specification. Requirements regarding the content 269 and interpretation of xml:lang are specified in XML 1.0 [REC-xml], 270 Section 2.12. 272 metalinkCommonAttributes = 273 attribute xml:base { metalinkUri }?, 274 attribute xml:lang { metalinkLanguageTag }?, 275 undefinedAttribute* 277 Metalink is an extensible format. See Section 6 of this document for 278 a full description of how Metalink Documents can be extended. 280 3. Common Metalink Constructs 282 Many of Metalink's elements share a few common structures. This 283 section defines those structures and their requirements for 284 convenient reference by the appropriate element definitions. 286 When an element is identified as being a particular kind of 287 construct, it inherits the corresponding requirements from that 288 construct's definition in this section. 290 Note that there MUST NOT be any white space in a Date construct or in 291 any IRI. Some XML-emitting implementations erroneously insert white 292 space around values by default, and such implementations will emit 293 invalid Metalink Documents. 295 3.1. Text Constructs 297 A Text construct contains human-readable text, usually in small 298 quantities. The content of Text constructs is Language-Sensitive. 300 metalinkTextConstruct = 301 metalinkCommonAttributes, 302 text 304 3.1.1. Text 306 Example metalink:description with text content: 308 ... 309 310 A description of the example file for download. 311 312 ... 314 The content of the Text construct MUST NOT contain child elements. 315 Such text is intended to be presented to humans in a readable 316 fashion. Thus, white space could be collapsed (including line 317 breaks) and text could be displayed using typographic techniques such 318 as justification and proportional fonts. 320 3.2. Date Constructs 322 A Date construct is an element whose content MUST conform to the 323 "date-time" production in [RFC3339]. In addition, an uppercase "T" 324 character MUST be used to separate date and time, and an uppercase 325 "Z" character MUST be present in the absence of a numeric time zone 326 offset. 328 metalinkDateConstruct = 329 metalinkCommonAttributes, 330 xsd:dateTime 332 Such date values happen to be compatible with the following 333 specifications: [ISO.8601.1988], [W3C.NOTE-datetime-19980827], and 334 [W3C.REC-xmlschema-2-20041028]. 336 Example Date constructs: 338 2008-12-13T18:30:02Z 339 2008-12-13T18:30:02.25Z 340 2008-12-13T18:30:02+01:00 341 2008-12-13T18:30:02.25+01:00 343 Date values SHOULD be as accurate as possible. For example, it would 344 be generally inappropriate for a publishing system to apply the same 345 timestamp to several Metalink Documents that were published during 346 the course of a single day. 348 4. Metalink Element Definitions 349 4.1. Container Elements 351 4.1.1. The "metalink:metalink" Element 353 The "metalink:metalink" element is the document (i.e., top-level) 354 element of a Metalink Document, acting as a container for metadata 355 and data associated with the listed files. It contains one 356 "metalink:files" element whose element children consist of metadata 357 elements followed by one or more metalink:file child elements. 359 metalinkMetalink = 360 element metalink:metalink { 361 metalinkCommonAttributes, 362 (metalinkDynamic? 363 & metalinkFiles 364 & metalinkGenerator? 365 & metalinkOrigin? 366 & metalinkPublished? 367 & metalinkUpdated? 368 & extensionElement*) 369 } 371 The following child elements are defined by this specification (note 372 that the presence of some of these elements is required): 374 o metalink:metalink elements MAY contain exactly one metalink: 375 dynamic element. 376 o metalink:metalink elements MUST contain exactly one metalink:files 377 element. 378 o metalink:metalink elements MAY contain exactly one metalink: 379 generator element. 380 o metalink:metalink elements SHOULD contain exactly one metalink: 381 origin element. 382 o metalink:metalink elements MAY contain exactly one metalink: 383 published element. 385 4.1.1.1. Providing Textual Content 387 Experience teaches that downloads providing textual content are in 388 general more useful than those that do not. Some applications (one 389 example is full-text indexers) require a minimum amount of text to 390 function reliably and predictably. Metalink publishers should be 391 aware of these issues. It is advisable that each metalink:file 392 element contain a non-empty metalink:description element, a non-empty 393 metalink:identity element when that element is present, and a non- 394 empty metalink:version element, and a non-empty metalink:publisher 395 element. However, the absence of metalink:description is not an 396 error, and Metalink Processors MUST NOT fail to function correctly as 397 a consequence of such an absence. 399 4.1.2. The "metalink:files" Element 401 The "metalink:files" element acts as a container for metadata and 402 data associated with the listed files. It contains one or more 403 metalink:file child elements. 405 metalinkFiles = 406 element metalink:files { 407 metalinkCommonAttributes, 408 (metalinkFile+ 409 & extensionElement*) 410 } 412 The following child elements are defined by this specification (note 413 that the presence of some of these elements is required): 415 o metalink:files elements MUST contain one or more metalink:file 416 elements. 418 4.1.3. The "metalink:file" Element 420 The "metalink:file" element represents an individual file, acting as 421 a container for metadata and data associated with the file. 423 metalinkFile = 424 element metalink:file { 425 metalinkCommonAttributes, 426 attribute name { text }, 427 (metalinkCopyright? 428 & metalinkDescription? 429 & metalinkIdentity? 430 & metalinkLanguage? 431 & metalinkLicense? 432 & metalinkLogo? 433 & metalinkOS? 434 & metalinkPublisher? 435 & metalinkResources 436 & metalinkSize? 437 & metalinkVerification? 438 & metalinkVersion? 439 & extensionElement*) 440 } 442 This specification assigns no significance to the order of metalink: 443 file elements. 445 The following child elements are defined by this specification (note 446 that it requires the presence of some of these elements): 448 o metalink:file elements MAY contain exactly one metalink:copyright 449 element. 450 o metalink:file elements MAY contain exactly one metalink: 451 description element. 452 o metalink:file elements MAY contain exactly one metalink:identity 453 element. 454 o metalink:file elements MAY contain exactly one metalink:language 455 element. 456 o metalink:file elements MAY contain exactly one metalink:license 457 element. 458 o metalink:file elements MAY contain exactly one metalink:logo 459 element. 460 o metalink:file elements MAY contain exactly one metalink:os 461 element. 462 o metalink:file elements MAY contain exactly one metalink:publisher 463 element. 464 o metalink:file elements MUST contain exactly one metalink:resources 465 element. 466 o metalink:file elements SHOULD contain exactly one metalink:size 467 element. 468 o metalink:file elements SHOULD contain exactly one metalink: 469 verification element. 470 o metalink:file elements MAY contain exactly one metalink:version 471 element. 473 4.1.3.1. The "name" Attribute 475 metalink:file elements MUST have a "name" attribute, which contains 476 the filename of the file to be downloaded. 478 Directory information can also be contained in a "path/file" format 479 only, as in: 481 483 In this example, a subdirectory "debian-amd64/sarge/" will be created 484 and a file named "Contents-amd64.gz" will be created inside it. The 485 path MUST NOT contain any directory traversal directives or 486 information. The path MUST be relative. The path MUST NOT begin 487 with a "/", "./" or "../", contain "/../", or end with "/..". 489 4.1.4. The "metalink:resources" Element 491 The "metalink:resources" element acts as a container for metadata and 492 data associated with the listed files. It contains one or more 493 metalink:url child elements. It can also contain one or more 494 metalink:metaurl child elements. 496 All elements contained in each metalink:resources element SHOULD lead 497 to identical files. That is, each metalink:url element should be an 498 alternative location for the same file and each metalink:metaurl 499 element should provide metadata to retrieve the same file in another 500 way, such as a peer to peer network. 502 metalinkResources = 503 element metalink:resources { 504 metalinkCommonAttributes, 505 (metalinkMetaURL* 506 & metalinkURL* 507 & extensionElement*) 508 } 510 This specification assigns no significance to the order of metalink: 511 url or metalink:metaurl elements. Significance is determined by the 512 value of the "preference" attribute of the metalink:url or metalink: 513 metaurl elements. 515 The following child elements are defined by this specification (note 516 that the presence of some of these elements is required): 518 o metalink:resources elements MUST contain at least one metalink:url 519 element or at least one metalink:metaurl element. Typically, 520 metalink:resources element contains more than one metalink:url 521 element to provide multiple download sources. 523 4.1.5. The "metalink:verification" Element 525 The "metalink:verification" element acts as a container for metadata 526 and data associated with verifying the listed files. This 527 information is in the form of checksums and digital signatures. 528 Checksums are used to verify the integrity of a complete file or 529 portion of a file to determine if the files have been transferred 530 without any errors. Digital signatures verify that a file is from 531 the entity that has signed it. 533 metalinkVerification = 534 element metalink:verification { 535 metalinkCommonAttributes, 536 (metalinkHash* 537 & metalinkPieces* 538 & metalinkSignature? 539 & extensionElement*) 540 } 542 The following child elements are defined by this specification: 544 o metalink:verification elements MAY contain one or more metalink: 545 hash elements. 546 o metalink:verification elements MAY contain one or more metalink: 547 pieces elements. 548 o metalink:verification elements MAY contain one or more metalink: 549 signature elements. 551 4.1.6. The "metalink:pieces" Element 553 The "metalink:pieces" element acts as a container for a list of 554 checksums of non-overlapping pieces of the file. The checksums MUST 555 be listed in the same order as the corresponding pieces appear in the 556 file, starting at the beginning of the file. 558 metalinkPieces = 559 element metalink:pieces { 560 attribute length { xsd:integer }, 561 attribute type { text }, 562 metalinkHash+ 563 } 565 4.1.6.1. The "type" Attribute 567 metalink:pieces elements MUST have a "type" attribute. 569 The IANA registry named "Hash Function Textual Names" defines values 570 for hash types. If a Metalink Document contains verification 571 information, it SHOULD include "sha-1" which is SHA1 as specified in 572 [RFC3174], or a stronger hash. It MAY also include other 573 verification algorithms. 575 4.1.6.2. The "length" Attribute 577 metalink:pieces elements MUST have a "length" attribute, which is an 578 integer that describes the length of the pieces of the file in 579 octets. The whole file is divided into non-overlapping pieces of 580 this length, starting from the beginning of the file. The last piece 581 extends at most to the end of the file and can therefore be shorter 582 than the other pieces. 584 4.2. Metadata Elements 586 4.2.1. The "metalink:copyright" Element 588 The "metalink:copyright" element is a Text construct that conveys a 589 human-readable copyright for a file. 591 metalinkCopyright = 592 element metalink:copyright { 593 metalinkTextConstruct 594 } 596 4.2.2. The "metalink:description" Element 598 The "metalink:description" element is a Text construct that conveys a 599 human-readable description for a file. 601 metalinkDescription = 602 element metalink:description { 603 metalinkTextConstruct 604 } 606 4.2.3. The "metalink:dynamic" Element 608 The "metalink:dynamic" element is a Text construct that describes 609 whether the IRI from "metalink:origin" in a Metalink will contain 610 dynamic updated information or if it is static and not likely to be 611 updated. 613 metalinkDynamic = 614 element metalink:dynamic { 615 "true" | "false" 616 } 618 4.2.4. The "metalink:generator" Element 620 The "metalink:generator" element's content identifies the generating 621 agent name and version, separated by a "/", used to generate a 622 Metalink Document, for debugging and other purposes. 624 metalinkGenerator = 625 element metalink:generator { 626 metalinkTextConstruct 627 } 629 The content of this element, when present, MUST be a string that is a 630 human-readable name and version, separated by a "/", for the 631 generating agent. For example, "MirrorBrain/2.8.1", where 632 "MirrorBrain" is the name and "2.8.1" is the version. Entities such 633 as "&" and "<" represent their corresponding characters ("&" 634 and "<" respectively), not markup. 636 4.2.5. The "metalink:hash" Element 638 The "metalink:hash" element is a Text construct that conveys a hash 639 for a file. All hashes are encoded in lowercase hexadecimal format. 641 metalinkHash = 642 element metalink:hash { 643 attribute type { text }?, 644 text 645 } 647 metalink:hash elements with a "type" attribute MUST contain a hash of 648 the complete file. Metalink Documents can contain one or multiples 649 hashes of a complete file. In this example, both SHA-1 and SHA-256 650 hashes are included. 652 ... 653 654 a97fcf6ba9358f8a6f62beee4421863d3e52b080 655 fc87941af7fd7f03e53b34af393f4c14923d74 656 825f51116ff591336af4880227 657 658 ... 660 Metalink Documents can also contain hashes for individual pieces of a 661 file. metalink:hash elements that are inside a metalink:pieces 662 container element have a hash for that specific piece or chunk of the 663 file, and are of the same hash type as the metalink:pieces element 664 they are contained in. metalink:hash elements without a "type" 665 attribute MUST contain a hash for that specific piece or chunk of the 666 file and MUST be listed in the same order as the corresponding pieces 667 appear in the file, starting at the beginning of the file. 669 ... 670 671 a97fcf6ba9358f8a6f62beee4421863d3e52b080 672 fc87941af7fd7f03e53b34af393f4c14923d74 673 825f51116ff591336af4880227 674 675 d96b9a4b92a899c2099b7b31bddb5ca423bb9b30 676 10d68f4b1119014c123da2a0a6baf5c8a6d5ba1e 677 3e84219096435c34e092b17b70a011771c52d87a 678 67183e4c3ab892d3ebe8326b7d79eb62d077f487 679 680 681 ... 683 4.2.5.1. The "type" Attribute 685 metalink:hash elements MUST have a "type" attribute, if and only if 686 it contains a hash of the complete file. The IANA registry named 687 "Hash Function Textual Names" defines values for hash types. If a 688 Metalink Document contains verification information, it SHOULD 689 include "sha-1" which is SHA1 as specified in [RFC3174], or a 690 stronger hash. It MAY also include other verification algorithms. 692 4.2.6. The "metalink:identity" Element 694 The "metalink:identity" element is a Text construct that conveys a 695 human-readable identity for a file. The identity of OpenOffice.org 696 3.0 would be "OpenOffice.org". 698 metalinkIdentity = 699 element metalink:identity { 700 metalinkTextConstruct 701 } 703 4.2.7. The "metalink:language" Element 705 The "metalink:language" element is a Text construct that conveys a 706 code for the language of a file, per [RFC4646]. 708 metalinkLanguage = 709 element metalink:language { 710 metalinkTextConstruct 711 } 713 4.2.8. The "metalink:license" Element 715 The "metalink:license" element is a Text construct that conveys a 716 human-readable license name for a file. 718 metalinkLicense = 719 element metalink:license { 720 metalinkCommonAttributes, 721 attribute url { metalinkUri }?, 722 attribute name { text }? 723 } 725 The metalink:license element MAY have a "url" attribute whose value 726 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 727 URI (mapped from an IRI, if necessary) SHOULD produce a 728 representation that is relevant to that agent. 730 The metalink:license element MAY have a "name" attribute that 731 indicates the name of the license. 733 4.2.9. The "metalink:logo" Element 735 The "metalink:logo" element's content is an IRI reference [RFC3987] 736 that identifies an image that provides visual identification for a 737 file. 739 metalinkLogo = 740 element metalink:logo { 741 metalinkCommonAttributes, 742 (metalinkUri) 743 } 745 The image SHOULD have an aspect ratio of one (horizontal) to one 746 (vertical) and SHOULD be suitable for presentation at a small size. 748 4.2.10. The "metalink:metaurl" Element 750 The "metalink:metaurl" element contains the IRI of metadata about a 751 resource to download. For example, this could be the IRI of a 752 BitTorrent .torrent file or a Metalink Document. Note that the 753 information in the metalink:verification element does not apply to 754 these files, but to the files that are described by them. 756 metalinkMetaURL = 757 element metalink:metaurl { 758 metalinkCommonAttributes, 759 attribute preference { xsd:integer }?, 760 attribute type { text }, 761 attribute name { text }?, 762 metalinkUri 763 } 765 4.2.10.1. The "preference" Attribute 767 metalink:metaurl elements MAY have a preference attribute, whose 768 value MUST be a number from 1 to 100 for priority, with 100 used 769 first and 1 used last. Multiple metalink:metaurl elements can have 770 the same preference, i.e. three BitTorrent .torrent files could have 771 preference="100". See also the "preference" attribute of the 772 metalink:url element. 774 4.2.10.2. The "type" Attribute 776 metalink:metaurl elements MUST have a "type" attribute that indicates 777 the MIME type of the metadata available at the IRI. In the case of 778 BitTorrent as specified in [BITTORRENT], the value "torrent" is 779 required. Types without "/" are reserved. Currently, "torrent" is 780 the only reserved value. 782 4.2.10.3. The "name" Attribute 784 metalink:metaurl elements MAY have a "name" attribute that indicates 785 a specific file in a BitTorrent .torrent file or a Metalink Document 786 that describes multiple files. 788 Directory information can also be contained in a "path/file" format 789 only, as in: 791 793 In this example, a file named "Contents-amd64.gz" is indicated, in a 794 "debian-amd64/sarge/" subdirectory. The path MUST NOT contain any 795 directory traversal directives or information. The path MUST be 796 relative. The path MUST NOT begin with a "/", "./" or "../", contain 797 "/../", or end with "/..". 799 4.2.11. The "metalink:origin" Element 801 The "metalink:origin" element is an IRI where the Metalink Document 802 was originally published. If metalink:dynamic is "true", then 803 updated versions of the Metalink can be found at this IRI. 805 metalinkOrigin = 806 element metalink:origin { 807 metalinkCommonAttributes, 808 (metalinkUri) 809 } 811 4.2.12. The "metalink:os" Element 813 The "metalink:os" element is a Text construct that conveys a human- 814 readable Operating System for a file. The IANA registry named 815 "Operating System Names" defines values for OS types. 817 metalinkOS = 818 element metalink:os { 819 metalinkTextConstruct 820 } 822 4.2.13. The "metalink:published" Element 824 The "metalink:published" element is a Date construct indicating an 825 instant in time associated with an event early in the life cycle of 826 the entry. 828 metalinkPublished = 829 element metalink:published { 830 metalinkDateConstruct 831 } 833 Typically, metalink:published will be associated with the initial 834 creation or first availability of the resource. 836 4.2.14. The "metalink:publisher" Element 838 The "metalink:publisher" element indicates a group or other entity 839 which has published the file described in the Metalink Document. 841 metalinkPublisher = 842 element metalink:publisher { 843 metalinkCommonAttributes, 844 attribute url { metalinkUri }?, 845 attribute name { text }? 846 } 848 The metalink:publisher element MAY have a "url" attribute whose value 849 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 850 URI (mapped from an IRI, if necessary) SHOULD produce a 851 representation that is relevant to that agent. 853 The metalink:publisher element MAY have a "name" attribute that 854 indicates the name of the publisher. 856 4.2.15. The "metalink:signature" Element 858 The "metalink:signature" element is a Text construct that conveys a 859 digital signature for a file described in a Metalink Document. 861 metalinkSignature = 862 element metalink:signature { 863 attribute type { "pgp" }, 864 metalinkTextConstruct 865 } 867 4.2.15.1. The "type" Attribute 869 metalink:signature elements MUST have a "type" attribute. The 870 initial value of "type" is the string that is non-empty and matches 871 "pgp". It may be useful to extend Metalink documents with new types 872 of digital signatures, so unknown types are allowed. 874 4.2.16. The "metalink:size" Element 876 The "metalink:size" element indicates the length of the linked 877 content in octets; it is a hint about the content length of the 878 representation returned when the IRI is mapped to a URI and 879 dereferenced. 881 metalinkSize = 882 element metalink:size { 883 metalinkTextConstruct 884 } 886 4.2.17. The "metalink:updated" Element 888 The "metalink:updated" element is a Date construct indicating the 889 most recent instant in time when a Metalink was modified in a way the 890 publisher considers significant. Therefore, not all modifications 891 necessarily result in a changed metalink:updated value. 893 metalinkUpdated = 894 element metalink:updated { 895 metalinkDateConstruct 896 } 898 Publishers MAY change the value of this element over time. 900 4.2.18. The "metalink:url" Element 902 The "metalink:url" element contains the IRI of a file. Most Metalink 903 Documents will contain multiple metalink:url elements, and each one 904 SHOULD be a valid alternative to download the same file. 906 metalinkURL = 907 element metalink:url { 908 metalinkCommonAttributes, 909 attribute location { xsd:string { 910 minLength = "2" maxLength="2"} 911 }?, 912 attribute preference { xsd:integer }?, 913 metalinkUri 914 } 916 4.2.18.1. The "preference" Attribute 918 metalink:url elements MAY have a preference attribute, whose value 919 MUST be a number from 1 to 100 for priority, with 100 used first and 920 1 used last. Multiple metalink:url elements can have the same 921 preference, i.e. ten mirrors could have preference="100". 923 4.2.18.2. The "location" Attribute 925 metalink:url elements MAY have a "location" attribute, which is a 926 [ISO3166-1] alpha-2 two letter country code for the geographical 927 location of the physical server an IRI is used to access. 929 4.2.19. The "metalink:version" Element 931 The "metalink:version" element is a Text construct that conveys a 932 human-readable version for a file. The version of OpenOffice.org 3.0 933 would be "3.0". 935 metalinkVersion = 936 element metalink:version { 937 metalinkTextConstruct 938 } 940 5. Securing Metalink Documents 942 Because Metalink is an XML-based format, existing XML security 943 mechanisms can be used to secure its content. 945 Producers of Metalink Documents may have sound reasons for signing 946 otherwise-unprotected content. For example, a merchant might 947 digitally sign a Metalink that lists a file download to verify its 948 origin. Other merchants may wish to sign and encrypt Metalink 949 Documents that list digital songs that have been purchased. Of 950 course, many other examples are conceivable as well. 952 The algorithm requirements in this section pertain to the Metalink 953 Processor. They require that a recipient, at a minimum, be able to 954 handle messages that use the specified cryptographic algorithms. 955 These requirements do not limit the algorithms that the sender can 956 choose. 958 Metalink Processors that verify signed Metalink Documents MUST at 959 least support XML-Signature and Syntax Processing [REC-xmldsig-core]. 961 6. Extending Metalink 963 6.1. Extensions from Non-Metalink Vocabularies 965 This specification describes Metalink's XML markup vocabulary. 966 Markup from other vocabularies ("foreign markup") can be used in an 967 Metalink Document. 969 6.2. Extensions to the Metalink Vocabulary 971 The Metalink namespace is reserved for future forward-compatible 972 revisions of Metalink. Future versions of this specification could 973 add new elements and attributes to the Metalink markup vocabulary. 974 Software written to conform to this version of the specification will 975 not be able to process such markup correctly and, in fact, will not 976 be able to distinguish it from markup error. For the purposes of 977 this discussion, unrecognized markup from the Metalink vocabulary 978 will be considered "foreign markup". 980 6.3. Processing Foreign Markup 982 Metalink Processors that encounter foreign markup in a location that 983 is legal according to this specification MUST NOT stop processing or 984 signal an error. It might be the case that the Metalink Processor is 985 able to process the foreign markup correctly and does so. Otherwise, 986 such markup is termed "unknown foreign markup". 988 When unknown foreign markup is encountered as a child of metalink: 989 file, metalink:metalink, Metalink Processors MAY bypass the markup 990 and any textual content and MUST NOT change their behavior as a 991 result of the markup's presence. 993 When unknown foreign markup is encountered in a Text Construct, 994 software SHOULD ignore the markup and process any text content of 995 foreign elements as though the surrounding markup were not present. 997 6.4. Extension Elements 999 Metalink allows foreign markup anywhere in an Metalink document, 1000 except where it is explicitly forbidden. Child elements of metalink: 1001 file and metalink:metalink are considered Metadata elements and are 1002 described below. Child elements of Person constructs are considered 1003 to apply to the construct. The role of other foreign markup is 1004 undefined by this specification. 1006 6.4.1. Simple Extension Elements 1008 A Simple Extension element MUST NOT have any attributes or child 1009 elements. The element MAY contain character data or be empty. 1010 Simple Extension elements are not Language-Sensitive. 1012 simpleExtensionElement = 1013 element * - metalink:* { 1014 text 1015 } 1017 The element can be interpreted as a simple property (or name/value 1018 pair) of the parent element that encloses it. The pair consisting of 1019 the namespace-URI of the element and the local name of the element 1020 can be interpreted as the name of the property. The character data 1021 content of the element can be interpreted as the value of the 1022 property. If the element is empty, then the property value can be 1023 interpreted as an empty string. 1025 6.4.2. Structured Extension Elements 1027 The root element of a Structured Extension element MUST have at least 1028 one attribute or child element. It MAY have attributes, it MAY 1029 contain well-formed XML content (including character data), or it MAY 1030 be empty. Structured Extension elements are Language-Sensitive. 1032 structuredExtensionElement = 1033 element * - metalink:* { 1034 (attribute * { text }+, 1035 (text|anyElement)*) 1036 | (attribute * { text }*, 1037 (text?, anyElement+, (text|anyElement)*)) 1038 } 1040 The structure of a Structured Extension element, including the order 1041 of its child elements, could be significant. 1043 This specification does not provide an interpretation of a Structured 1044 Extension element. The syntax of the XML contained in the element 1045 (and an interpretation of how the element relates to its containing 1046 element) is defined by the specification of the Metalink extension. 1048 7. IANA Considerations 1050 7.1. XML Namespace Registration 1052 This document makes use of the XML registry specified in [RFC3688]. 1053 Accordingly, IANA has made the following registration: 1055 Registration request for the Metalink namespace: 1057 URI: urn:ietf:params:xml:ns:metalink 1059 Registrant Contact: See the "Author's Address" section of this 1060 document. 1062 XML: None. Namespace URIs do not represent an XML specification. 1064 7.2. application/metalink+xml MIME type 1066 A Metalink Document, when serialized as XML 1.0, can be identified 1067 with the following media type: 1069 MIME media type name: application 1070 MIME subtype name: metalink+xml 1071 Mandatory parameters: None. 1072 Optional parameters: 1073 "charset": This parameter has semantics identical to the charset 1074 parameter of the "application/xml" media type as specified in 1075 [RFC3023]. 1076 Encoding considerations: Identical to those of "application/xml" as 1077 described in [RFC3023], Section 3.2. 1078 Security considerations: As defined in this specification. 1079 In addition, as this media type uses the "+xml" convention, it 1080 shares the same security considerations as described in [RFC3023], 1081 Section 10. 1082 Interoperability considerations: There are no known interoperability 1083 issues. 1084 Published specification: This specification. 1085 Applications that use this media type: No known applications 1086 currently use this media type. 1088 Additional information: 1090 Magic number(s): As specified for "application/xml" in [RFC3023], 1091 Section 3.2. 1092 File extension: .metalink 1093 Fragment identifiers: As specified for "application/xml" in 1094 [RFC3023], Section 5. 1095 Base URI: As specified in [RFC3023], Section 6. 1096 Macintosh File Type code: TEXT 1097 Person and email address to contact for further information: Anthony 1098 Bryan 1099 Intended usage: COMMON 1100 Author/Change controller: IESG 1102 8. Security Considerations 1104 Publishers are encouraged to offer Metalink documents via 1105 authenticated HTTP under TLS as specified in [RFC2818]. Publishers 1106 are also encouraged to include digital signatures of the files within 1107 the Metalink Documents if they are available. 1109 8.1. URIs and IRIs 1111 Metalink Processors handle URIs and IRIs. See Section 7 of [RFC3986] 1112 and Section 8 of [RFC3987] for security considerations related to 1113 their handling and use. 1115 8.2. Spoofing 1117 There is potential for spoofing attacks where the attacker publishes 1118 Metalink Documents with false information. Malicious publishers 1119 might create Metalink Documents containing inaccurate information 1120 anywhere in the document. At best, this could deceive unaware 1121 downloaders that they are downloading a malicious or worthless file. 1122 At worst, malicious publishers could attempt a distributed denial of 1123 service attack by inserting unrelated IRIs into Metalink Documents. 1125 8.3. Cryptographic Hashes 1127 Currently, some of the hash types defined in the IANA registry named 1128 "Hash Function Textual Names" are considered insecure. These include 1129 the whole Message Digest family of algorithms which are not suitable 1130 for cryptographically strong verification. Malicious people could 1131 provide files that appear to be identical to another file because of 1132 a collision, i.e. the weak cryptographic hashes of the intended file 1133 and a substituted malicious file could match. 1135 If a Metalink Document contains verification information, it SHOULD 1136 implement "sha-1" which is SHA1, as specified in [RFC3174]. It MAY 1137 also include other verification algorithms. 1139 8.4. Signing 1141 Metalink Documents SHOULD be signed using [REC-xmldsig-core] and are 1142 subject to the security considerations implied by its use. This 1143 addresses the issue of spoofing. 1145 Digital signatures provide authentication, message integrity, and 1146 non-repudiation with proof of origin. 1148 9. References 1150 9.1. Normative References 1152 [BITTORRENT] 1153 Cohen, B., "The BitTorrent Protocol Specification", 1154 BITTORRENT 11031, February 2008, 1155 . 1157 [ISO3166-1] 1158 International Organization for Standardization, "ISO 3166- 1159 1:2006. Codes for the representation of names of 1160 countries and their subdivisions -- Part 1: Country 1161 codes", November 2006. 1163 [REC-xml] Yergeau, F., Paoli, J., Bray, T., Sperberg-McQueen, C., 1164 and E. Maler, "Extensible Markup Language (XML) 1.0 1165 (Fourth Edition)", World Wide Web Consortium 1166 Recommendation REC-xml-20060816, August 2006, 1167 . 1169 [REC-xml-infoset] 1170 Cowan, J. and R. Tobin, "XML Information Set (Second 1171 Edition)", World Wide Web Consortium Recommendation REC- 1172 xml-infoset-20040204, February 2004, 1173 . 1175 [REC-xml-names] 1176 Hollander, D., Bray, T., Tobin, R., and A. Layman, 1177 "Namespaces in XML 1.0 (Second Edition)", World Wide Web 1178 Consortium Recommendation REC-xml-names-20060816, 1179 August 2006, 1180 . 1182 [REC-xmlbase] 1183 Marsh, J., "XML Base", W3C REC W3C.REC-xmlbase-20010627, 1184 June 2001, 1185 . 1187 [REC-xmldsig-core] 1188 Solo, D., Reagle, J., and D. Eastlake, "XML-Signature 1189 Syntax and Processing (Second Edition)", World Wide Web 1190 Consortium Recommendation REC-xmldsig-core-20080610, 1191 June 2008, 1192 . 1194 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1195 Requirement Levels", BCP 14, RFC 2119, March 1997. 1197 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1199 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media 1200 Types", RFC 3023, January 2001. 1202 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 1203 (SHA1)", RFC 3174, September 2001. 1205 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1206 Timestamps", RFC 3339, July 2002. 1208 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1209 January 2004. 1211 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1212 Resource Identifier (URI): Generic Syntax", STD 66, 1213 RFC 3986, January 2005. 1215 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 1216 Identifiers (IRIs)", RFC 3987, January 2005. 1218 [RFC4646] Phillips, A. and M. Davis, "Tags for Identifying 1219 Languages", BCP 47, RFC 4646, September 2006. 1221 9.2. Informative References 1223 [ISO.8601.1988] 1224 International Organization for Standardization, "Data 1225 elements and interchange formats - Information interchange 1226 - Representation of dates and times", ISO Standard 8601, 1227 June 1988. 1229 [RELAX-NG] 1230 Clark, J., "RELAX NG Compact Syntax", December 2001, . 1234 [RFC4287] Nottingham, M. and R. Sayre, "The Atom Syndication 1235 Format", RFC 4287, December 2005. 1237 [W3C.NOTE-datetime-19980827] 1238 Wolf, M. and C. Wicksteed, "Date and Time Formats", W3C 1239 NOTE NOTE-datetime-19980827, August 1998, 1240 . 1242 [W3C.REC-xmlschema-2-20041028] 1243 Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes 1244 Second Edition", W3C REC REC-xmlschema-2-20041028, 1245 October 2004, 1246 . 1248 Appendix A. Acknowledgements and Contributors 1250 The layout and content of this document relies heavily on work 1251 pioneered in the Atom Syndication Format as specified in [RFC4287]. 1253 The following people contributed to preliminary versions of this 1254 document: Paul Burkhead, Kristian Weston, Darius Liktorius, Michael 1255 Burford, Giorgio Maone, Manuel Subredu, A. Bram Neijt, Max Velasques, 1256 Manolo Valdes, Urs Wolfer, Frederick Cheung, Nils Maier, Hampus 1257 Wessman, Hayden Legendre, Danny Ayers, Nick Dominguez, Rene 1258 Leonhardt, Per Oyvind Karlsen, Gary Zellerbach, James Clark, Daniel 1259 Stenberg, Matt Domsch, Chris Newman, Lisa Dusseault, Ian Macfarlane, 1260 Dave Cridland, Julian Reschke, Barry Leiba, Uri Blumenthal, Paul 1261 Hoffman, Felix Sasaki, Matthias Fuchs, Eran Hammer-Lahav, and Mark 1262 Nottingham. The content and concepts within are a product of the 1263 Metalink community. 1265 The Metalink community has dozens of contributors who proposed ideas 1266 and wording for this document, or contributed to the evolution of 1267 Metalink, including: 1269 Nicolas Alvarez, Patrick Ruckstuhl, Sebastien Willemijns, Micah 1270 Cowan, Yazsoft, KGet developers, FDM Team, Orbit Team, Arne 1271 Babenhauserheide, Mathias Berchtold, Xienzhenyu and TheWorld Browser 1272 Team, Xi Software, Bridget and Ethan Fletcher, Ruben Kerkhof, 1273 Agostino Russo, Salvatore and Robin Musumeci, Steve and Rachel 1274 Eshelman, Lucas Hewett, Ryan and Darren Cronin, Dave Winquist, Bob 1275 Denison, Wes Shelton, Kees Cook, Josh Colbert, Steve Kleisath, Chad 1276 Neptune, Nick Carrabba, Chris Carrabba, Erin Solari, Derick Cordoba, 1277 Ryan Alexander, John Sowder, Sandra Amisano, Tom Mainville, Janie 1278 Wargo, Jason Hansen, Tim Bray, Dan Brickley, Markus Hofmann, Dan 1279 Connolly, Tim Berners-Lee, Louis Suarez-Potts, Ross Smith, Jeff 1280 Covey, Ed Lee, Shawn Wilsher, Mike Connor, Johan Svedberg, Dedric 1281 Carter, James Antill, Debi Goulding, the Anthony Family, the Bryan 1282 Family, Juanita Anthony and Zimmy Bryan. 1284 Appendix B. RELAX NG Compact Schema 1286 This appendix is informative. 1288 The Relax NG schema explicitly excludes elements in the Metalink 1289 namespace that are not defined in this revision of the specification. 1290 Requirements for Metalink Processors encountering such markup are 1291 given in Sections 6.2 and 6.3. 1293 # -*- rnc -*- 1294 # RELAX NG Compact Syntax Grammar for the 1295 # Metalink Format Specification Version 3 1297 namespace local = "" 1298 namespace metalink = "urn:ietf:params:xml:ns:metalink" 1299 namespace xsd = "http://www.w3.org/2001/XMLSchema" 1300 # Common attributes 1302 metalinkCommonAttributes = 1303 attribute xml:base { metalinkUri }?, 1304 attribute xml:lang { metalinkLanguageTag }?, 1305 undefinedAttribute* 1307 # Text Constructs 1309 metalinkTextConstruct = 1310 metalinkCommonAttributes, 1311 text 1313 # Date Construct 1315 metalinkDateConstruct = 1316 metalinkCommonAttributes, 1317 xsd:dateTime 1319 start = metalinkMetalink 1321 metalinkMetalink = 1322 element metalink:metalink { 1323 metalinkCommonAttributes, 1324 (metalinkDynamic? 1325 & metalinkFiles 1326 & metalinkGenerator? 1327 & metalinkOrigin? 1328 & metalinkPublished? 1329 & metalinkUpdated? 1330 & extensionElement*) 1331 } 1333 metalinkFiles = 1334 element metalink:files { 1335 metalinkCommonAttributes, 1336 (metalinkFile+ 1337 & extensionElement*) 1338 } 1340 metalinkFile = 1341 element metalink:file { 1342 metalinkCommonAttributes, 1343 attribute name { text }, 1344 (metalinkCopyright? 1345 & metalinkDescription? 1346 & metalinkIdentity? 1347 & metalinkLanguage? 1348 & metalinkLicense? 1349 & metalinkLogo? 1350 & metalinkOS? 1351 & metalinkPublisher? 1352 & metalinkResources 1353 & metalinkSize? 1354 & metalinkVerification? 1355 & metalinkVersion? 1356 & extensionElement*) 1357 } 1359 metalinkResources = 1360 element metalink:resources { 1361 metalinkCommonAttributes, 1362 (metalinkMetaURL* 1363 & metalinkURL* 1364 & extensionElement*) 1365 } 1367 metalinkVerification = 1368 element metalink:verification { 1369 metalinkCommonAttributes, 1370 (metalinkHash* 1371 & metalinkPieces* 1372 & metalinkSignature? 1373 & extensionElement*) 1374 } 1376 metalinkPieces = 1377 element metalink:pieces { 1378 attribute length { xsd:integer }, 1379 attribute type { text }, 1380 metalinkHash+ 1381 } 1383 metalinkCopyright = 1384 element metalink:copyright { 1385 metalinkTextConstruct 1386 } 1388 metalinkDescription = 1389 element metalink:description { 1390 metalinkTextConstruct 1391 } 1393 metalinkDynamic = 1394 element metalink:dynamic { 1395 "true" | "false" 1397 } 1399 metalinkGenerator = 1400 element metalink:generator { 1401 metalinkTextConstruct 1402 } 1404 metalinkHash = 1405 element metalink:hash { 1406 attribute type { text }?, 1407 text 1408 } 1410 metalinkIdentity = 1411 element metalink:identity { 1412 metalinkTextConstruct 1413 } 1415 metalinkLanguage = 1416 element metalink:language { 1417 metalinkTextConstruct 1418 } 1420 metalinkLicense = 1421 element metalink:license { 1422 metalinkCommonAttributes, 1423 attribute url { metalinkUri }?, 1424 attribute name { text }? 1425 } 1427 metalinkLogo = 1428 element metalink:logo { 1429 metalinkCommonAttributes, 1430 (metalinkUri) 1431 } 1433 metalinkMetaURL = 1434 element metalink:metaurl { 1435 metalinkCommonAttributes, 1436 attribute preference { xsd:integer }?, 1437 attribute type { text }, 1438 attribute name { text }?, 1439 metalinkUri 1440 } 1442 metalinkOrigin = 1443 element metalink:origin { 1444 metalinkCommonAttributes, 1445 (metalinkUri) 1446 } 1448 metalinkOS = 1449 element metalink:os { 1450 metalinkTextConstruct 1451 } 1453 metalinkPublished = 1454 element metalink:published { 1455 metalinkDateConstruct 1456 } 1458 metalinkPublisher = 1459 element metalink:publisher { 1460 metalinkCommonAttributes, 1461 attribute url { metalinkUri }?, 1462 attribute name { text }? 1463 } 1465 metalinkSignature = 1466 element metalink:signature { 1467 attribute type { "pgp" }, 1468 metalinkTextConstruct 1469 } 1471 metalinkSize = 1472 element metalink:size { 1473 metalinkTextConstruct 1474 } 1476 metalinkUpdated = 1477 element metalink:updated { 1478 metalinkDateConstruct 1479 } 1481 metalinkURL = 1482 element metalink:url { 1483 metalinkCommonAttributes, 1484 attribute location { xsd:string { 1485 minLength = "2" maxLength="2"} 1486 }?, 1487 attribute preference { xsd:integer }?, 1488 metalinkUri 1489 } 1491 metalinkVersion = 1492 element metalink:version { 1493 metalinkTextConstruct 1494 } 1496 # As defined in RFC 3066 and compatible with RFC 4646 1497 metalinkLanguageTag = xsd:string { 1498 pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*" 1499 } 1501 # Unconstrained; it's not entirely clear how IRI fit into 1502 # xsd:anyURI so let's not try to constrain it here 1503 metalinkUri = text 1505 # Simple Extension 1507 simpleExtensionElement = 1508 element * - metalink:* { 1509 text 1510 } 1512 # Structured Extension 1514 structuredExtensionElement = 1515 element * - metalink:* { 1516 (attribute * { text }+, 1517 (text|anyElement)*) 1518 | (attribute * { text }*, 1519 (text?, anyElement+, (text|anyElement)*)) 1520 } 1522 # Other Extensibility 1524 extensionElement = 1525 simpleExtensionElement | structuredExtensionElement 1527 undefinedAttribute = 1528 attribute * - (xml:base | xml:lang | local:*) { text } 1530 undefinedContent = (text|anyForeignElement)* 1532 anyElement = 1533 element * { 1534 (attribute * { text } 1535 | text 1536 | anyElement)* 1537 } 1539 anyForeignElement = 1540 element * - metalink:* { 1541 (attribute * { text } 1542 | text 1543 | anyElement)* 1544 } 1546 # EOF 1548 Appendix C. Document History (to be removed by RFC Editor before 1549 publication) 1551 [[ to be removed by the RFC editor before publication as an RFC. ]] 1553 Updated versions can be found at 1554 http://tools.ietf.org/html/draft-bryan-metalink with frequent updates 1555 in Subversion at 1556 http://metalinks.svn.sourceforge.net/viewvc/metalinks/internetdraft/ 1558 Known issues concerning this draft: 1559 o None. 1561 -12 : August 18, 2009. 1562 o Remove "piece" attribute from hash elements in pieces container 1563 elements. 1564 o Rename "uri" attribute of license and publisher elements to "url". 1566 -11 : August 08, 2009. 1567 o Renamed type element (static or dynamic values) to dynamic element 1568 (true or false values). 1569 o Removed metadata inheritance and most other elements from files 1570 element. 1572 -10 : July 28, 2009. 1573 o Schema fixes. 1574 o Rename metadata element to metaurl, add name attribute to it 1575 similar to file element's name attribute. 1576 o Update REC-xmldsig-core reference to second edition. 1578 -09 : July 11, 2009. 1579 o Replace ISO639-2 references with RFC 4646. 1580 o Add ISO3166-1. 1582 -08 : July 04, 2009. 1583 o Clarifications. 1584 o Remove "uri" and "version" attributes from generator element. 1586 -07 : June 18, 2009. 1588 o This ID describes the Metalink document format/schema. 1589 o Remove "Client Implementation Considerations" section. 1590 o Expand "Known issues" section of Document History. 1592 -06 : March 3, 2009. 1593 o Add authors and this Document History section. 1595 -05 : January 13, 2009. 1596 o Clarifications. 1598 -04 : December 31, 2008. 1599 o New IPR notice as required by IETF. 1600 o Correct "metalink:pieces" Element text. 1601 o Add hash examples. 1602 o Slim down "Securing Metalink Documents" section. 1603 o Recommend at least SHA1. 1605 -03 : September 19, 2008. 1606 o New namespace - urn:ietf:params:xml:ns:metalink 1607 o Use the IANA registry named "Operating System Names" to define 1608 values for OS types. 1609 o Add "Client Implementation Considerations" section, which includes 1610 Content Negotiation. 1612 -02 : September 4, 2008. 1613 o Use the IANA registry named "Hash Function Textual Names" for hash 1614 types. 1615 o metadata Element for listing .torrent, .metalink, etc. 1616 o Remove type attribute for url Element. 1618 -01 : August 28, 2008. 1619 o Clarify directory info in name attribute, hash types, add text for 1620 preference attribute. 1622 -00 : August 23, 2008. 1623 o Initial draft; Text largely based on RFC 4287, ideas from Metalink 1624 3.0 specification. 1626 Index 1628 A 1629 application/metalink+xml Media Type 24 1631 C 1632 copyright XML element 13 1634 D 1635 description XML element 14 1637 F 1638 file XML element 10 1639 files XML element 10 1641 G 1642 generator XML element 14 1643 Grammar 1644 metalinkCommonAttributes 7 1645 metalinkCopyright 14 1646 metalinkDateConstruct 8 1647 metalinkDescription 14 1648 metalinkFile 10 1649 metalinkFiles 10 1650 metalinkGenerator 14 1651 metalinkHash 15 1652 metalinkIdentity 16 1653 metalinkLanguage 16 1654 metalinkLicense 16 1655 metalinkLogo 17 1656 metalinkMetalink 9 1657 metalinkOrigin 18 1658 metalinkOS 18 1659 metalinkPieces 13 1660 metalinkPublished 19 1661 metalinkPublisher 19 1662 metalinkResources 12 1663 metalinkSignature 19 1664 metalinkSize 20 1665 metalinkTextConstruct 7 1666 metalinkType 14 1667 metalinkUpdated 20 1668 metalinkURL 17, 20 1669 metalinkVerification 12 1670 metalinkVersion 21 1671 simpleExtensionElement 22 1672 structuredExtensionElement 23 1674 H 1675 hash XML element 15 1677 I 1678 identity XML element 16 1680 L 1681 language XML element 16 1682 license XML element 16 1683 logo XML element 17 1685 M 1686 Media Type 1687 application/metalink+xml 24 1688 metadata XML element 17 1689 metalink XML element 9 1690 metalinkCommonAttributes grammar production 7 1691 metalinkCopyright grammar production 14 1692 metalinkDateConstruct grammar production 8 1693 metalinkDescription grammar production 14 1694 metalinkFile grammar production 10 1695 metalinkFiles grammar production 10 1696 metalinkGenerator grammar production 14 1697 metalinkHash grammar production 15 1698 metalinkIdentity grammar production 16 1699 metalinkLanguage grammar production 16 1700 metalinkLicense grammar production 16 1701 metalinkLogo grammar production 17 1702 metalinkMetalink grammar production 9 1703 metalinkOrigin grammar production 18 1704 metalinkOS grammar production 18 1705 metalinkPieces grammar production 13 1706 metalinkPublished grammar production 19 1707 metalinkPublisher grammar production 19 1708 metalinkResources grammar production 12 1709 metalinkSignature grammar production 19 1710 metalinkSize grammar production 20 1711 metalinkTextConstruct grammar production 7 1712 metalinkType grammar production 14 1713 metalinkUpdated grammar production 20 1714 metalinkURL grammar production 17, 20 1715 metalinkVerification grammar production 12 1716 metalinkVersion grammar production 21 1718 O 1719 origin XML element 18 1720 os XML element 18 1722 P 1723 pieces XML element 13 1724 published XML element 18 1725 publisher XML element 19 1727 R 1728 resources XML element 11 1730 S 1731 signature XML element 19 1732 simpleExtensionElement grammar production 22 1733 size XML element 20 1734 structuredExtensionElement grammar production 23 1736 T 1737 type XML element 14 1739 U 1740 updated XML element 20 1741 url XML element 20 1743 V 1744 verification XML element 12 1745 version XML element 21 1747 X 1748 XML Elements 1749 copyright 13 1750 description 14 1751 entry 10 1752 files 10 1753 generator 14 1754 hash 15 1755 identity 16 1756 language 16 1757 license 16 1758 logo 17 1759 metadata 17 1760 metalink 9 1761 origin 18 1762 os 18 1763 pieces 13 1764 published 18 1765 publisher 19 1766 resources 11 1767 signature 19 1768 size 20 1769 type 14 1770 updated 20 1771 url 20 1772 verification 12 1773 version 21 1775 Authors' Addresses 1777 Anthony Bryan 1778 Metalinker Project 1780 Email: anthonybryan@gmail.com 1781 URI: http://www.metalinker.org 1783 Tatsuhiro Tsujikawa 1784 Metalinker Project 1786 Email: tatsuhiro.t@gmail.com 1787 URI: http://aria2.sourceforge.net 1789 Neil McNab 1790 Metalinker Project 1792 Email: nabber00@gmail.com 1793 URI: http://www.nabber.org 1795 Peter Poeml 1796 Novell, Inc. 1798 Email: info@mirrorbrain.org 1799 URI: http://www.mirrorbrain.org/