idnits 2.17.1 draft-bryan-metalink-09.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 (July 11, 2009) is 5402 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'BITTORRENT' -- Possible downref: Non-RFC (?) normative reference: ref. 'ISO3166-1' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xml' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xml-infoset' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xml-names' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xmlbase' -- Possible downref: Non-RFC (?) normative reference: ref. 'REC-xmldsig-core' ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 3023 (Obsoleted by RFC 7303) ** Downref: Normative reference to an Informational RFC: RFC 3174 ** Obsolete normative reference: RFC 4646 (Obsoleted by RFC 5646) Summary: 5 errors (**), 0 flaws (~~), 1 warning (==), 10 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Bryan, Ed. 3 Internet-Draft T. Tsujikawa, Ed. 4 Intended status: Standards Track N. McNab, Ed. 5 Expires: January 12, 2010 Metalinker Project 6 P. Poeml, Ed. 7 Novell, Inc. 8 July 11, 2009 10 The Metalink Download Description Format 11 draft-bryan-metalink-09 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 January 12, 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 . . . . . . . . . . . . . 11 78 4.1.4. The "metalink:resources" Element . . . . . . . . . . . 12 79 4.1.5. The "metalink:verification" Element . . . . . . . . . 13 80 4.1.6. The "metalink:pieces" Element . . . . . . . . . . . . 13 81 4.2. Metadata Elements . . . . . . . . . . . . . . . . . . . . 14 82 4.2.1. The "metalink:copyright" Element . . . . . . . . . . . 14 83 4.2.2. The "metalink:description" Element . . . . . . . . . . 14 84 4.2.3. The "metalink:generator" Element . . . . . . . . . . . 14 85 4.2.4. The "metalink:hash" Element . . . . . . . . . . . . . 15 86 4.2.5. The "metalink:identity" Element . . . . . . . . . . . 16 87 4.2.6. The "metalink:language" Element . . . . . . . . . . . 17 88 4.2.7. The "metalink:license" Element . . . . . . . . . . . . 17 89 4.2.8. The "metalink:logo" Element . . . . . . . . . . . . . 17 90 4.2.9. The "metalink:metadata" Element . . . . . . . . . . . 17 91 4.2.10. The "metalink:origin" Element . . . . . . . . . . . . 18 92 4.2.11. The "metalink:os" Element . . . . . . . . . . . . . . 18 93 4.2.12. The "metalink:published" Element . . . . . . . . . . . 19 94 4.2.13. The "metalink:publisher" Element . . . . . . . . . . . 19 95 4.2.14. The "metalink:signature" Element . . . . . . . . . . . 19 96 4.2.15. The "metalink:size" Element . . . . . . . . . . . . . 20 97 4.2.16. The "metalink:type" 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 . . . . . . . . . . . . . . . . . . . . . . 22 103 6.1. Extensions from Non-Metalink Vocabularies . . . . . . . . 22 104 6.2. Extensions to the Metalink Vocabulary . . . . . . . . . . 22 105 6.3. Processing Foreign Markup . . . . . . . . . . . . . . . . 22 106 6.4. Extension Elements . . . . . . . . . . . . . . . . . . . . 23 107 6.4.1. Simple Extension Elements . . . . . . . . . . . . . . 23 108 6.4.2. Structured Extension Elements . . . . . . . . . . . . 23 109 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 110 7.1. XML Namespace Registration . . . . . . . . . . . . . . . . 24 111 7.2. application/metalink+xml MIME type . . . . . . . . . . . . 24 112 8. Security Considerations . . . . . . . . . . . . . . . . . . . 25 113 8.1. URIs and IRIs . . . . . . . . . . . . . . . . . . . . . . 25 114 8.2. Spoofing . . . . . . . . . . . . . . . . . . . . . . . . . 25 115 8.3. Cryptographic Hashes . . . . . . . . . . . . . . . . . . . 25 116 8.4. Signing . . . . . . . . . . . . . . . . . . . . . . . . . 26 117 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 26 118 9.1. Normative References . . . . . . . . . . . . . . . . . . . 26 119 9.2. Informative References . . . . . . . . . . . . . . . . . . 27 120 Appendix A. Acknowledgements and Contributors . . . . . . . . . . 28 121 Appendix B. RELAX NG Compact Schema . . . . . . . . . . . . . . . 29 122 Appendix C. Document History (to be removed by RFC Editor 123 before publication) . . . . . . . . . . . . . . . . . 32 124 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 125 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 36 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 discuss@apps.ietf.org 142 or the Metalink discussion mailing list located at 143 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 entries that were published during the course of 346 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 (metalinkPublished? 363 & metalinkOrigin? 364 & metalinkGenerator? 365 & metalinkUpdated? 366 & extensionElement*), 367 metalinkFiles 368 } 370 The following child elements are defined by this specification (note 371 that the presence of some of these elements is required): 373 o metalink:metalink elements MUST contain exactly one metalink:files 374 element. 375 o metalink:metalink elements SHOULD contain exactly one metalink: 376 origin element. 377 o metalink:metalink elements MAY contain exactly one metalink:type 378 element. 379 o metalink:metalink elements MAY contain exactly one metalink: 380 generator element. 381 o metalink:metalink elements MAY contain exactly one metalink: 382 published element. 383 o If metalink:type is "dynamic", metalink:metalink elements MAY 384 contain exactly one metalink:updated element. 386 4.1.1.1. Providing Textual Content 388 Experience teaches that downloads providing textual content are in 389 general more useful than those that do not. Some applications (one 390 example is full-text indexers) require a minimum amount of text to 391 function reliably and predictably. Metalink publishers should be 392 aware of these issues. It is advisable that each metalink:file 393 element contain a non-empty metalink:description element, a non-empty 394 metalink:identity element when that element is present, and a non- 395 empty metalink:version element, and a non-empty metalink:publisher 396 element. However, the absence of metalink:description is not an 397 error, and Metalink Processors MUST NOT fail to function correctly as 398 a consequence of such an absence. 400 4.1.2. The "metalink:files" Element 402 The "metalink:files" element acts as a container for metadata and 403 data associated with the listed files. It contains one or more 404 metalink:file child elements. Certain elements can be listed either 405 under metalink:files or metalink:file. If under metalink:files, they 406 apply to all files listed in each metalink:file. If under metalink: 407 file, then they apply to just that specific file. If an element is 408 listed both under metalink:files and metalink:file, then the element 409 under metalink:file has precedence and the metalink:files element 410 does not apply to that particular file. 412 metalinkFiles = 413 element metalink:files { 414 metalinkCommonAttributes, 415 (metalinkIdentity? 416 & metalinkVersion? 417 & metalinkDescription? 418 & metalinkOS? 419 & metalinkLogo? 420 & metalinkLanguage? 421 & metalinkPublisher? 422 & metalinkCopyright? 423 & metalinkLicense? 424 & extensionElement*) 425 metalinkFile 426 } 428 The following child elements are defined by this specification (note 429 that the presence of some of these elements is required): 431 o metalink:files element MUST contain one or more metalink:file 432 elements. 433 o metalink:files elements SHOULD contain exactly one metalink: 434 identity element. 435 o metalink:files elements SHOULD contain exactly one metalink: 436 version element. 437 o metalink:files elements MAY contain exactly one metalink: 438 description element. 439 o metalink:files elements MAY contain exactly one metalink:os 440 element. 441 o metalink:files elements MAY contain exactly one metalink:logo 442 element. 444 o metalink:files elements MAY contain exactly one metalink:language 445 element. 446 o metalink:files elements MAY contain exactly one metalink:publisher 447 element. 448 o metalink:files elements MAY contain exactly one metalink:copyright 449 element. 450 o metalink:files elements MAY contain exactly one metalink:license 451 element. 453 4.1.3. The "metalink:file" Element 455 The "metalink:file" element represents an individual file, acting as 456 a container for metadata and data associated with the file. 458 metalinkFile = 459 element metalink:file { 460 metalinkCommonAttributes, 461 attribute name { metalinkTextConstruct }, 462 (metalinkVerification? 463 & metalinkIdentity? 464 & metalinkVersion? 465 & metalinkDescription? 466 & metalinkSize? 467 & metalinkOS? 468 & metalinkLogo? 469 & metalinkLanguage? 470 & metalinkPublisher? 471 & metalinkCopyright? 472 & metalinkLicense? 473 & extensionElement*) 474 metalinkResources 475 } 477 This specification assigns no significance to the order of metalink: 478 file elements. 480 The following child elements are defined by this specification (note 481 that it requires the presence of some of these elements): 483 o metalink:file elements MUST contain exactly one metalink:resources 484 element. 485 o metalink:file elements SHOULD contain exactly one metalink: 486 verification element. 487 o metalink:file elements SHOULD contain exactly one metalink: 488 identity element. 489 o metalink:file elements SHOULD contain exactly one metalink:version 490 element. 492 o metalink:file elements MAY contain exactly one metalink: 493 description element. 494 o metalink:file elements SHOULD contain exactly one metalink:size 495 element. 496 o metalink:file elements MAY contain exactly one metalink:os 497 element. 498 o metalink:file elements MAY contain exactly one metalink:logo 499 element. 500 o metalink:file elements MAY contain exactly one metalink:language 501 element. 502 o metalink:file elements MAY contain exactly one metalink:publisher 503 element. 504 o metalink:file elements MAY contain exactly one metalink:copyright 505 element. 506 o metalink:file elements MAY contain exactly one metalink:license 507 element. 509 4.1.3.1. The "name" Attribute 511 metalink:file elements MUST have a "name" attribute, which contains 512 the filename of the file downloaded. 514 Directory information can also be contained in a "path/file" format 515 only, as in: 517 519 In this example, a subdirectory debian-amd64/sarge/ will be created 520 and a file named Contents-amd64.gz will be created inside it. The 521 path MUST NOT contain any directory traversal directives or 522 information. The path MUST be relative. The path MUST NOT begin 523 with a "/", "./" or "../", contain "/../", or end with "/..". 525 4.1.4. The "metalink:resources" Element 527 The "metalink:resources" element acts as a container for metadata and 528 data associated with the listed files. It contains one or more 529 metalink:url child elements. It can also contain one or more 530 metalink:metadata child elements. 532 metalinkResources = 533 element metalink:resources { 534 metalinkCommonAttributes, 535 extensionElement* 536 metalinkURL* 537 metalinkMetadata* 538 } 540 This specification assigns no significance to the order of metalink: 541 url elements. Significance is determined by the value of the 542 "preference" attribute of the metalink:url elements. 544 The following child elements are defined by this specification (note 545 that the presence of some of these elements is required): 547 o metalink:resources element MUST contain at least one metalink:url 548 element or at least one metalink:metadata element. Typically, 549 metalink:resources element contains more than one metalink:url 550 element to provide multiple download sources. 552 4.1.5. The "metalink:verification" Element 554 The "metalink:verification" element acts as a container for metadata 555 and data associated with verifying the listed files. This 556 information is in the form of checksums and digital signatures. 557 Checksums are used to verify the integrity of a complete file or 558 portion of a file to determine if the files have been transferred 559 without any errors. Digital signatures verify that a file is from 560 the entity that has signed it. 562 metalinkVerification = 563 element metalink:verification { 564 metalinkCommonAttributes, 565 (metalinkHash* 566 & metalinkPieces* 567 & metalinkSignature? 568 & extensionElement*) 569 } 571 The following child elements are defined by this specification: 573 o metalink:verification element MAY contain one or more metalink: 574 hash elements. 575 o metalink:verification element MAY contain one or more metalink: 576 pieces elements. 577 o metalink:verification element MAY contain one or more metalink: 578 signature elements. 580 4.1.6. The "metalink:pieces" Element 582 The "metalink:pieces" element acts as a container for metadata and 583 data associated with verifying the listed files. This information is 584 in the form of checksums for a portion of a file. 586 metalinkPieces = 587 element metalink:pieces { 588 attribute length { metalinkTextConstruct }, 589 attribute type { metalinkTextConstruct }, 590 hash+ 591 }+, 593 4.1.6.1. The "type" Attribute 595 metalink:pieces elements MUST have a "type" attribute. 597 The IANA registry named "Hash Function Textual Names" defines values 598 for hash types. If a Metalink Document contains verification 599 information, it SHOULD implement "sha-1" which is SHA1, as specified 600 in [RFC3174]. It MAY also include other verification algorithms. 602 4.1.6.2. The "length" Attribute 604 metalink:pieces elements MUST have a "length" attribute, which is an 605 integer that describes the length of the piece of the file in octets. 607 4.2. Metadata Elements 609 4.2.1. The "metalink:copyright" Element 611 The "metalink:copyright" element is a Text construct that conveys a 612 human-readable copyright for a file. 614 metalinkCopyright = 615 element metalink:copyright { 616 metalinkTextConstruct 617 } 619 4.2.2. The "metalink:description" Element 621 The "metalink:description" element is a Text construct that conveys a 622 human-readable description for a file. 624 metalinkDescription = 625 element metalink:description { 626 metalinkTextConstruct 627 } 629 4.2.3. The "metalink:generator" Element 631 The "metalink:generator" element's content identifies the generating 632 agent name and version, separated by a "/", used to generate a 633 Metalink Document, for debugging and other purposes. 635 metalinkGenerator = element metalink:generator { 636 metalinkCommonAttributes, 637 text 638 } 640 The content of this element, when present, MUST be a string that is a 641 human-readable name and version, separated by a "/", for the 642 generating agent. For example, "MirrorBrain/2.8.1", where 643 "MirrorBrain" is the name and "2.8.1" is the version. Entities such 644 as "&" and "<" represent their corresponding characters ("&" 645 and "<" respectively), not markup. 647 4.2.4. The "metalink:hash" Element 649 The "metalink:hash" element is a Text construct that conveys a hash 650 for a file. All hashes are encoded in lowercase hexadecimal format. 652 metalinkHash = 653 element metalink:hash { 654 attribute piece { xsd:integer }?, 655 attribute type { metalinkTextConstruct }, 656 text 657 } 659 Metalinks can contain multiples hashes for a complete file, for 660 example both SHA-1 and SHA-256. 662 ... 663 664 a97fcf6ba9358f8a6f62beee4421863d3e52b080 665 fc87941af7fd7f03e53b34af393f4c14923d74 666 825f51116ff591336af4880227 667 668 ... 670 Metalinks can also contain hashes for individual pieces of a file. 672 ... 673 674 a97fcf6ba9358f8a6f62beee4421863d3e52b080 675 fc87941af7fd7f03e53b34af393f4c14923d74 676 825f51116ff591336af4880227 677 678 d96b9a4b92a899c2099b7b31bddb5ca423bb9b30 679 10d68f4b1119014c123da2a0a6baf5c8a6d5ba1e 680 3e84219096435c34e092b17b70a011771c52d87a 681 67183e4c3ab892d3ebe8326b7d79eb62d077f487 682 683 684 ... 686 metalink:hash elements MUST have a "type" attribute or a "piece" 687 attribute. metalink:hash elements with a "type" attribute contain a 688 hash of the whole file. metalink:hash elements with a "piece" 689 attribute contain a hash for that specific piece or chunk of the 690 file. 692 4.2.4.1. The "type" Attribute 694 The IANA registry named "Hash Function Textual Names" defines values 695 for hash types. If a Metalink Document contains verification 696 information, it SHOULD implement "sha-1" which is SHA1, as specified 697 in [RFC3174]. It MAY also include other verification algorithms. 699 4.2.4.2. The "piece" Attribute 701 metalink:hash elements MAY have a "piece" attribute, only when they 702 are a sub element of metalink:pieces. The value of "piece" starts at 703 "0" and increases, depending on the "length" attribute of metalink: 704 pieces and the size of the file. Depending on the size of a file, 705 the last piece may not be the same size as the others. 707 4.2.5. The "metalink:identity" Element 709 The "metalink:identity" element is a Text construct that conveys a 710 human-readable identity for a file. The identity of OpenOffice.org 711 3.0 would be "OpenOffice.org". 713 metalinkIdentity = 714 element metalink:identity { 715 metalinkTextConstruct 716 } 718 4.2.6. The "metalink:language" Element 720 The "metalink:language" element is a Text construct that conveys a 721 code for the language of a file, per [RFC4646]. 723 metalinkLanguage = 724 element metalink:language { 725 metalinkTextConstruct 726 } 728 4.2.7. The "metalink:license" Element 730 The "metalink:license" element is a Text construct that conveys a 731 human-readable license name for a file. 733 metalinkLicense = 734 element metalink:license { 735 metalinkCommonAttributes, 736 attribute uri { metalinkUri }?, 737 attribute name { metalinkTextConstruct }?, 738 } 740 The metalink:license element MAY have a "uri" attribute whose value 741 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 742 URI (mapped from an IRI, if necessary) SHOULD produce a 743 representation that is relevant to that agent. 745 The metalink:license element MAY have a "name" attribute that 746 indicates the name of the license. 748 4.2.8. The "metalink:logo" Element 750 The "metalink:logo" element's content is an IRI reference [RFC3987] 751 that identifies an image that provides visual identification for a 752 file. 754 metalinkLogo = element metalink:logo { 755 metalinkCommonAttributes, 756 (metalinkUri) 757 } 759 The image SHOULD have an aspect ratio of one (horizontal) to one 760 (vertical) and SHOULD be suitable for presentation at a small size. 762 4.2.9. The "metalink:metadata" Element 764 The "metalink:metadata" element contains the IRI of metadata about a 765 resource to download. For example, this could be the IRI of a 766 BitTorrent .torrent file or a Metalink Document. Note that the 767 information in the metalink:verification element does not apply to 768 these files. 770 metalinkMetadata = 771 element metalink:metadata { 772 metalinkCommonAttributes, 773 attribute preference { xsd:integer }?, 774 attribute type { metalinkTextConstruct }, 775 metalinkUri 776 }+ 778 4.2.9.1. The "preference" Attribute 780 metalink:metadata elements MAY have a preference attribute, whose 781 value MUST be a number from 1 to 100 for priority, with 100 used 782 first and 1 used last. See the "preference" attribute of the 783 metalink:url element for more information. 785 4.2.9.2. The "type" Attribute 787 metalink:metadata elements MUST have a "type" attribute that 788 indicates the MIME type of the metadata available at the IRI. In the 789 case of BitTorrent as specified in [BITTORRENT], the value "torrent" 790 is required. Types without "/" are reserved. Currently, "torrent" 791 is the only reserved value. 793 4.2.10. The "metalink:origin" Element 795 The "metalink:origin" element is an IRI where the Metalink Document 796 was originally published. If metalink:type is "dynamic", then 797 updated versions of the Metalink can be found at this IRI. 799 metalinkOrigin = element metalink:origin { 800 metalinkCommonAttributes, 801 (metalinkUri) 802 } 804 4.2.11. The "metalink:os" Element 806 The "metalink:os" element is a Text construct that conveys a human- 807 readable Operating System for a file. The IANA registry named 808 "Operating System Names" defines values for OS types. 810 metalinkOS = 811 element metalink:os { 812 metalinkTextConstruct 813 } 815 4.2.12. The "metalink:published" Element 817 The "metalink:published" element is a Date construct indicating an 818 instant in time associated with an event early in the life cycle of 819 the entry. 821 metalinkPublished = 822 element metalink:published { 823 metalinkDateConstruct 824 } 826 Typically, metalink:published will be associated with the initial 827 creation or first availability of the resource. 829 4.2.13. The "metalink:publisher" Element 831 The "metalink:publisher" element indicates a group or other entity 832 which has published the file. 834 metalinkPublisher = 835 element metalink:publisher { 836 metalinkCommonAttributes, 837 attribute uri { metalinkUri }?, 838 attribute name { metalinkTextConstruct }?, 839 } 841 The metalink:publisher element MAY have a "uri" attribute whose value 842 MUST be an IRI reference [RFC3987]. When dereferenced, the resulting 843 URI (mapped from an IRI, if necessary) SHOULD produce a 844 representation that is relevant to that agent. 846 The metalink:publisher element MAY have a "name" attribute that 847 indicates the name of the publisher. 849 4.2.14. The "metalink:signature" Element 851 The "metalink:signature" element is a Text construct that conveys a 852 digital signature for a file described in a Metalink Document. 854 metalinkSignature = 855 element metalink:signature { 856 attribute type { "pgp" }, 857 metalinkTextConstruct 858 } 860 4.2.14.1. The "type" Attribute 862 metalink:signature elements MUST have a "type" attribute. The 863 initial value of "type" is the string that is non-empty and matches 864 "pgp". It may be useful to extend Metalink documents with new types 865 of digital signatures, so unknown types are allowed. 867 4.2.15. The "metalink:size" Element 869 The "metalink:size" element indicates the length of the linked 870 content in octets; it is a hint about the content length of the 871 representation returned when the IRI is mapped to a URI and 872 dereferenced. 874 metalinkSize = 875 element metalink:size { 876 metalinkTextConstruct 877 } 879 4.2.16. The "metalink:type" Element 881 The "metalink:type" element is a Text construct that describes 882 whether the IRI from "metalink:origin" in a Metalink will contain 883 dynamic updated Metalinks or static content that is not updated. 885 metalinkType = 886 element metalink:type { 887 "static" | "dynamic" 888 } 890 4.2.17. The "metalink:updated" Element 892 The "metalink:updated" element is a Date construct indicating the 893 most recent instant in time when a Metalink was modified in a way the 894 publisher considers significant. Therefore, not all modifications 895 necessarily result in a changed metalink:updated value. 897 metalinkUpdated = 898 element metalink:updated { 899 metalinkDateConstruct 900 } 902 Publishers MAY change the value of this element over time. 904 4.2.18. The "metalink:url" Element 906 The "metalink:url" element contains the IRI of a file. All IRIs 907 contained in each metalink:resources element SHOULD lead to identical 908 files. 910 metalinkURL = 911 element metalink:url { 912 metalinkCommonAttributes, 913 attribute location { xsd:string { 914 minLength = "2" maxLength="2"} 915 }?, 916 attribute preference { xsd:integer }?, 917 metalinkUri 918 }+ 920 4.2.18.1. The "preference" Attribute 922 metalink:url elements MAY have a preference attribute, whose value 923 MUST be a number from 1 to 100 for priority, with 100 used first and 924 1 used last. Multiple metalink:url elements can have the same 925 preference, i.e. ten mirrors could have preference="100". 927 4.2.18.2. The "location" Attribute 929 metalink:url elements MAY have a "location" attribute, which is a 930 [ISO3166-1] alpha-2 two letter country code for the geographical 931 location of the physical server an IRI is used to access. 933 4.2.19. The "metalink:version" Element 935 The "metalink:version" element is a Text construct that conveys a 936 human-readable version for a file. The version of OpenOffice.org 3.0 937 would be "3.0". 939 metalinkVersion = 940 element metalink:version { 941 metalinkTextConstruct 942 } 944 5. Securing Metalink Documents 946 Because Metalink is an XML-based format, existing XML security 947 mechanisms can be used to secure its content. 949 Producers of Metalinks may have sound reasons for signing otherwise- 950 unprotected content. For example, a merchant might digitally sign a 951 Metalink that lists a file download to verify its origin. Other 952 merchants may wish to sign and encrypt Metalinks that list digital 953 songs that have been purchased. Of course, many other examples are 954 conceivable as well. 956 The algorithm requirements in this section pertain to the Metalink 957 Processor. They require that a recipient, at a minimum, be able to 958 handle messages that use the specified cryptographic algorithms. 959 These requirements do not limit the algorithms that the sender can 960 choose. 962 Metalink Processors that verify signed Metalink Documents MUST at 963 least support XML-Signature and Syntax Processing [REC-xmldsig-core]. 965 6. Extending Metalink 967 6.1. Extensions from Non-Metalink Vocabularies 969 This specification describes Metalink's XML markup vocabulary. 970 Markup from other vocabularies ("foreign markup") can be used in an 971 Metalink Document. 973 6.2. Extensions to the Metalink Vocabulary 975 The Metalink namespace is reserved for future forward-compatible 976 revisions of Metalink. Future versions of this specification could 977 add new elements and attributes to the Metalink markup vocabulary. 978 Software written to conform to this version of the specification will 979 not be able to process such markup correctly and, in fact, will not 980 be able to distinguish it from markup error. For the purposes of 981 this discussion, unrecognized markup from the Metalink vocabulary 982 will be considered "foreign markup". 984 6.3. Processing Foreign Markup 986 Metalink Processors that encounter foreign markup in a location that 987 is legal according to this specification MUST NOT stop processing or 988 signal an error. It might be the case that the Metalink Processor is 989 able to process the foreign markup correctly and does so. Otherwise, 990 such markup is termed "unknown foreign markup". 992 When unknown foreign markup is encountered as a child of metalink: 993 file, metalink:metalink, Metalink Processors MAY bypass the markup 994 and any textual content and MUST NOT change their behavior as a 995 result of the markup's presence. 997 When unknown foreign markup is encountered in a Text Construct, 998 software SHOULD ignore the markup and process any text content of 999 foreign elements as though the surrounding markup were not present. 1001 6.4. Extension Elements 1003 Metalink allows foreign markup anywhere in an Metalink document, 1004 except where it is explicitly forbidden. Child elements of metalink: 1005 file and metalink:metalink are considered Metadata elements and are 1006 described below. Child elements of Person constructs are considered 1007 to apply to the construct. The role of other foreign markup is 1008 undefined by this specification. 1010 6.4.1. Simple Extension Elements 1012 A Simple Extension element MUST NOT have any attributes or child 1013 elements. The element MAY contain character data or be empty. 1014 Simple Extension elements are not Language-Sensitive. 1016 simpleExtensionElement = 1017 element * - metalink:* { 1018 text 1019 } 1021 The element can be interpreted as a simple property (or name/value 1022 pair) of the parent element that encloses it. The pair consisting of 1023 the namespace-URI of the element and the local name of the element 1024 can be interpreted as the name of the property. The character data 1025 content of the element can be interpreted as the value of the 1026 property. If the element is empty, then the property value can be 1027 interpreted as an empty string. 1029 6.4.2. Structured Extension Elements 1031 The root element of a Structured Extension element MUST have at least 1032 one attribute or child element. It MAY have attributes, it MAY 1033 contain well-formed XML content (including character data), or it MAY 1034 be empty. Structured Extension elements are Language-Sensitive. 1036 structuredExtensionElement = 1037 element * - metalink:* { 1038 (attribute * { text }+, 1039 (text|anyElement)*) 1040 | (attribute * { text }*, 1041 (text?, anyElement+, (text|anyElement)*)) 1042 } 1044 The structure of a Structured Extension element, including the order 1045 of its child elements, could be significant. 1047 This specification does not provide an interpretation of a Structured 1048 Extension element. The syntax of the XML contained in the element 1049 (and an interpretation of how the element relates to its containing 1050 element) is defined by the specification of the Metalink extension. 1052 7. IANA Considerations 1054 7.1. XML Namespace Registration 1056 This document makes use of the XML registry specified in [RFC3688]. 1057 Accordingly, IANA has made the following registration: 1059 Registration request for the Metalink namespace: 1061 URI: urn:ietf:params:xml:ns:metalink 1063 Registrant Contact: See the "Author's Address" section of this 1064 document. 1066 XML: None. Namespace URIs do not represent an XML specification. 1068 7.2. application/metalink+xml MIME type 1070 A Metalink Document, when serialized as XML 1.0, can be identified 1071 with the following media type: 1073 MIME media type name: application 1074 MIME subtype name: metalink+xml 1075 Mandatory parameters: None. 1076 Optional parameters: 1077 "charset": This parameter has semantics identical to the charset 1078 parameter of the "application/xml" media type as specified in 1079 [RFC3023]. 1080 Encoding considerations: Identical to those of "application/xml" as 1081 described in [RFC3023], Section 3.2. 1082 Security considerations: As defined in this specification. 1083 In addition, as this media type uses the "+xml" convention, it 1084 shares the same security considerations as described in [RFC3023], 1085 Section 10. 1086 Interoperability considerations: There are no known interoperability 1087 issues. 1088 Published specification: This specification. 1089 Applications that use this media type: No known applications 1090 currently use this media type. 1092 Additional information: 1094 Magic number(s): As specified for "application/xml" in [RFC3023], 1095 Section 3.2. 1096 File extension: .metalink 1097 Fragment identifiers: As specified for "application/xml" in 1098 [RFC3023], Section 5. 1099 Base URI: As specified in [RFC3023], Section 6. 1100 Macintosh File Type code: TEXT 1101 Person and email address to contact for further information: Anthony 1102 Bryan 1103 Intended usage: COMMON 1104 Author/Change controller: IESG 1106 8. Security Considerations 1108 Publishers are encouraged to offer Metalink documents via 1109 authenticated HTTP under TLS as specified in [RFC2818]. Publishers 1110 are also encouraged to include digital signatures of the files within 1111 the Metalink Documents if they are available. 1113 8.1. URIs and IRIs 1115 Metalink Processors handle URIs and IRIs. See Section 7 of [RFC3986] 1116 and Section 8 of [RFC3987] for security considerations related to 1117 their handling and use. 1119 8.2. Spoofing 1121 There is potential for spoofing attacks where the attacker publishes 1122 Metalinks with false information. Malicious publishers might create 1123 Metalink Documents containing inaccurate information anywhere in the 1124 document. At best, this could deceive unaware downloaders that they 1125 are downloading a malicious or worthless file. At worst, malicious 1126 publishers could attempt a distributed denial of service attack by 1127 inserting unrelated IRIs into Metalink Documents. 1129 8.3. Cryptographic Hashes 1131 Currently, some of the hash types defined in the IANA registry named 1132 "Hash Function Textual Names" are considered insecure. These include 1133 the whole Message Digest family of algorithms which are not suitable 1134 for cryptographically strong verification. Malicious people could 1135 provide files that appear to be identical to another file because of 1136 a collision, i.e. the weak cryptographic hashes of the intended file 1137 and a substituted malicious file could match. 1139 If a Metalink Document contains verification information, it SHOULD 1140 implement "sha-1" which is SHA1, as specified in [RFC3174]. It MAY 1141 also include other verification algorithms. 1143 8.4. Signing 1145 Metalink Documents SHOULD be signed using [REC-xmldsig-core] and are 1146 subject to the security considerations implied by its use. This 1147 addresses the issue of spoofing. 1149 Digital signatures provide authentication, message integrity, and 1150 non-repudiation with proof of origin. 1152 9. References 1154 9.1. Normative References 1156 [BITTORRENT] 1157 Cohen, B., "The BitTorrent Protocol Specification", 1158 BITTORRENT 11031, February 2008, 1159 . 1161 [ISO3166-1] 1162 International Organization for Standardization, "ISO 3166- 1163 1:2006. Codes for the representation of names of 1164 countries and their subdivisions -- Part 1: Country 1165 codes", November 2006. 1167 [REC-xml] Yergeau, F., Paoli, J., Bray, T., Sperberg-McQueen, C., 1168 and E. Maler, "Extensible Markup Language (XML) 1.0 1169 (Fourth Edition)", World Wide Web Consortium 1170 Recommendation REC-xml-20060816, August 2006, 1171 . 1173 [REC-xml-infoset] 1174 Cowan, J. and R. Tobin, "XML Information Set (Second 1175 Edition)", World Wide Web Consortium Recommendation REC- 1176 xml-infoset-20040204, February 2004, 1177 . 1179 [REC-xml-names] 1180 Hollander, D., Bray, T., Tobin, R., and A. Layman, 1181 "Namespaces in XML 1.0 (Second Edition)", World Wide Web 1182 Consortium Recommendation REC-xml-names-20060816, 1183 August 2006, 1184 . 1186 [REC-xmlbase] 1187 Marsh, J., "XML Base", W3C REC W3C.REC-xmlbase-20010627, 1188 June 2001, 1189 . 1191 [REC-xmldsig-core] 1192 Solo, D., Reagle, J., and D. Eastlake, "XML-Signature 1193 Syntax and Processing", World Wide Web Consortium 1194 Recommendation REC-xmldsig-core-20020212, February 2002, 1195 . 1197 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1198 Requirement Levels", BCP 14, RFC 2119, March 1997. 1200 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1202 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media 1203 Types", RFC 3023, January 2001. 1205 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 1206 (SHA1)", RFC 3174, September 2001. 1208 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1209 Timestamps", RFC 3339, July 2002. 1211 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1212 January 2004. 1214 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1215 Resource Identifier (URI): Generic Syntax", STD 66, 1216 RFC 3986, January 2005. 1218 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 1219 Identifiers (IRIs)", RFC 3987, January 2005. 1221 [RFC4646] Phillips, A. and M. Davis, "Tags for Identifying 1222 Languages", BCP 47, RFC 4646, September 2006. 1224 9.2. Informative References 1226 [ISO.8601.1988] 1227 International Organization for Standardization, "Data 1228 elements and interchange formats - Information interchange 1229 - Representation of dates and times", ISO Standard 8601, 1230 June 1988. 1232 [RELAX-NG] 1233 Clark, J., "RELAX NG Compact Syntax", December 2001, . 1237 [RFC4287] Nottingham, M. and R. Sayre, "The Atom Syndication 1238 Format", RFC 4287, December 2005. 1240 [W3C.NOTE-datetime-19980827] 1241 Wolf, M. and C. Wicksteed, "Date and Time Formats", W3C 1242 NOTE NOTE-datetime-19980827, August 1998, 1243 . 1245 [W3C.REC-xmlschema-2-20041028] 1246 Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes 1247 Second Edition", W3C REC REC-xmlschema-2-20041028, 1248 October 2004, 1249 . 1251 Appendix A. Acknowledgements and Contributors 1253 The layout and content of this document relies heavily on work 1254 pioneered in the Atom Syndication Format as specified in [RFC4287]. 1256 The following people contributed to preliminary versions of this 1257 document: Paul Burkhead, Kristian Weston, Darius Liktorius, Michael 1258 Burford, Giorgio Maone, Manuel Subredu, A. Bram Neijt, Max Velasques, 1259 Manolo Valdes, Urs Wolfer, Frederick Cheung, Nils Maier, Hampus 1260 Wessman, Hayden Legendre, Danny Ayers, Nick Dominguez, Rene 1261 Leonhardt, Per Oyvind Karlsen, Gary Zellerbach, James Clark, Daniel 1262 Stenberg, Matt Domsch, Chris Newman, Lisa Dusseault, Ian Macfarlane, 1263 Dave Cridland, Julian Reschke, Barry Leiba, Uri Blumenthal, Paul 1264 Hoffman, Felix Sasaki, Eran Hammer-Lahav, and Mark Nottingham. The 1265 content and concepts within are a product of the Metalink community. 1267 The Metalink community has dozens of contributors who proposed ideas 1268 and wording for this document, or contributed to the evolution of 1269 Metalink, including: 1271 Nicolas Alvarez, Patrick Ruckstuhl, Sebastien Willemijns, Micah 1272 Cowan, Yazsoft, Lukas Appelhans, KGet developers, FDM Team, Orbit 1273 Team, Arne Babenhauserheide, Mathias Berchtold, Xienzhenyu and 1274 TheWorld Browser Team, Xi Software, Bridget and Ethan Fletcher, Ruben 1275 Kerkhof, Agostino Russo, Salvatore and Robin Musumeci, Steve and 1276 Rachel Eshelman, Lucas Hewett, Ryan and Darren Cronin, Dave Winquist, 1277 Bob Denison, Wes Shelton, Kees Cook, Josh Colbert, Steve Kleisath, 1278 Chad Neptune, Nick Carrabba, Chris Carrabba, Erin Solari, Derick 1279 Cordoba, Ryan Alexander, John Sowder, Sandra Amisano, Tom Mainville, 1280 Janie Wargo, Jason Hansen, Tim Bray, Dan Brickley, Markus Hofmann, 1281 Dan Connolly, Tim Berners-Lee, Louis Suarez-Potts, Ross Smith, Jeff 1282 Covey, Ed Lee, Shawn Wilsher, Mike Connor, Johan Svedberg, Dedric 1283 Carter, James Antill, Debi Goulding, the Anthony Family, the Bryan 1284 Family, Juanita Anthony and Zimmy Bryan. 1286 Appendix B. RELAX NG Compact Schema 1288 This appendix is informative. 1290 The Relax NG schema explicitly excludes elements in the Metalink 1291 namespace that are not defined in this revision of the specification. 1292 Requirements for Metalink Processors encountering such markup are 1293 given in Sections 6.2 and 6.3. 1295 # -*- rnc -*- 1296 # RELAX NG Compact Syntax Grammar for the 1297 # Metalink Format Specification Version 2 1299 namespace metalink = "urn:ietf:params:xml:ns:metalink" 1300 namespace xsd = "http://www.w3.org/2001/XMLSchema" 1302 # Common attributes 1304 metalinkCommonAttributes = 1305 attribute xml:base { metalinkUri }?, 1306 attribute xml:lang { metalinkLanguageTag }?, 1307 undefinedAttribute* 1309 # Text Constructs 1311 metalinkTextConstruct = 1312 metalinkCommonAttributes, 1313 text 1315 # Date Construct 1317 metalinkDateConstruct = 1318 metalinkCommonAttributes, 1319 xsd:dateTime 1321 start = 1322 element metalink:metalink { 1323 element metalink:generator { 1324 metalinkTextConstruct 1325 } 1326 element metalink:origin { metalinkUri }?, 1327 element metalink:type { "static" | "dynamic" }?, 1328 element metalink:published { metalinkDateConstruct }?, 1329 element metalink:updated { metalinkDateConstruct }?, 1330 element metalink:files { 1331 element metalink:file { 1332 attribute name { metalinkTextConstruct }, 1333 element metalink:identity { metalinkTextConstruct }?, 1334 element metalink:version { metalinkTextConstruct }?, 1335 element metalink:size { xsd:integer }?, 1336 element metalink:description { metalinkTextConstruct }?, 1337 element metalink:license { 1338 attribute uri { metalinkUri }?, 1339 attribute name { metalinkTextConstruct }?, 1340 }?, 1341 element metalink:logo { metalinkUri }?, 1342 element metalink:publisher { 1343 attribute uri { metalinkUri }?, 1344 attribute name { metalinkTextConstruct }?, 1345 }?, 1346 element metalink:language { metalinkTextConstruct }?, 1347 element metalink:copyright { metalinkTextConstruct }?, 1348 element metalink:license { metalinkTextConstruct }?, 1349 element metalink:os { metalinkTextConstruct }?, 1350 element metalink:verification { 1351 hash+, 1352 element metalink:pieces { 1353 attribute length { metalinkTextConstruct }, 1354 attribute type { metalinkTextConstruct }, 1355 hash+ 1356 }+, 1357 element metalink:signature { 1358 attribute type { "pgp" }, 1359 text 1360 }+ 1361 }?, 1362 element metalink:resources { 1363 element metalink:metadata { 1364 attribute preference { xsd:integer }?, 1365 attribute type { metalinkTextConstruct }, 1366 metalinkUri 1367 element metalink:url { 1368 attribute location { xsd:string { 1369 minLength = "2" maxLength="2"} 1370 }?, 1371 attribute preference { xsd:integer }?, 1372 metalinkUri 1373 }+ 1374 } 1375 }+ 1376 } 1378 } 1379 hash = 1380 element metalink:hash { 1381 attribute piece { metalinkTextConstruct }?, 1382 attribute type { metalinkTextConstruct }, 1383 text 1384 } 1386 # As defined in RFC 3066 and compatible with RFC 4646 1387 metalinkLanguageTag = xsd:string { 1388 pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*" 1389 } 1391 # Unconstrained; it's not entirely clear how IRI fit into 1392 # xsd:anyURI so let's not try to constrain it here 1393 metalinkUri = text 1395 # Simple Extension 1397 simpleExtensionElement = 1398 element * - metalink:* { 1399 text 1400 } 1402 # Structured Extension 1404 structuredExtensionElement = 1405 element * - metalink:* { 1406 (attribute * { text }+, 1407 (text|anyElement)*) 1408 | (attribute * { text }*, 1409 (text?, anyElement+, (text|anyElement)*)) 1410 } 1412 # Other Extensibility 1414 extensionElement = 1415 simpleExtensionElement | structuredExtensionElement 1417 undefinedAttribute = 1418 attribute * - (xml:base | xml:lang | local:*) { text } 1420 undefinedContent = (text|anyForeignElement)* 1422 anyElement = 1423 element * { 1424 (attribute * { text } 1425 | text 1426 | anyElement)* 1427 } 1429 anyForeignElement = 1430 element * - metalink:* { 1431 (attribute * { text } 1432 | text 1433 | anyElement)* 1434 } 1436 # EOF 1438 Appendix C. Document History (to be removed by RFC Editor before 1439 publication) 1441 [[ to be removed by the RFC editor before publication as an RFC. ]] 1443 Updated versions can be found at 1444 http://tools.ietf.org/html/draft-bryan-metalink with frequent updates 1445 in Subversion at 1446 http://metalinks.svn.sourceforge.net/viewvc/metalinks/internetdraft/ 1448 Known issues concerning this draft: 1449 o None. 1451 -09 : July 11, 2009. 1452 o Replace ISO639-2 references with RFC 4646. 1453 o Add ISO3166-1. 1455 -08 : July 04, 2009. 1456 o Clarifications. 1457 o Remove "uri" and "version" attributes from generator element. 1459 -07 : June 18, 2009. 1460 o This ID describes the Metalink document format/schema. 1461 o Remove "Client Implementation Considerations" section. 1462 o Expand "Known issues" section of Document History. 1464 -06 : March 3, 2009. 1465 o Add authors and this Document History section. 1467 -05 : January 13, 2009. 1468 o Clarifications. 1470 -04 : December 31, 2008. 1472 o New IPR notice as required by IETF. 1473 o Correct "metalink:pieces" Element text. 1474 o Add hash examples. 1475 o Slim down "Securing Metalink Documents" section. 1476 o Recommend at least SHA1. 1478 -03 : September 19, 2008. 1479 o New namespace - urn:ietf:params:xml:ns:metalink 1480 o Use the IANA registry named "Operating System Names" to define 1481 values for OS types. 1482 o Add "Client Implementation Considerations" section, which includes 1483 Content Negotiation. 1485 -02 : September 4, 2008. 1486 o Use the IANA registry named "Hash Function Textual Names" for hash 1487 types. 1488 o metadata Element for listing .torrent, .metalink, etc. 1489 o Remove type attribute for url Element. 1491 -01 : August 28, 2008. 1492 o Clarify directory info in name attribute, hash types, add text for 1493 preference attribute. 1495 -00 : August 23, 2008. 1496 o Initial draft; Text largely based on RFC 4287, ideas from Metalink 1497 3.0 specification. 1499 Index 1501 A 1502 application/metalink+xml Media Type 24 1504 C 1505 copyright XML element 14 1507 D 1508 description XML element 14 1510 F 1511 file XML element 11 1512 files XML element 10 1514 G 1515 generator XML element 14 1516 Grammar 1517 metalinkCommonAttributes 7 1518 metalinkCopyright 14 1519 metalinkDateConstruct 8 1520 metalinkDescription 14 1521 metalinkFile 11 1522 metalinkFiles 10 1523 metalinkGenerator 15 1524 metalinkHash 15 1525 metalinkIdentity 16 1526 metalinkLanguage 17 1527 metalinkLicense 17 1528 metalinkLogo 17 1529 metalinkMetalink 9 1530 metalinkOrigin 18 1531 metalinkOS 18 1532 metalinkPieces 14 1533 metalinkPublished 19 1534 metalinkPublisher 19 1535 metalinkResources 12 1536 metalinkSignature 19 1537 metalinkSize 20 1538 metalinkTextConstruct 7 1539 metalinkType 20 1540 metalinkUpdated 20 1541 metalinkURL 18, 21 1542 metalinkVerification 13 1543 metalinkVersion 21 1544 simpleExtensionElement 23 1545 structuredExtensionElement 23 1547 H 1548 hash XML element 15 1550 I 1551 identity XML element 16 1553 L 1554 language XML element 17 1555 license XML element 17 1556 logo XML element 17 1558 M 1559 Media Type 1560 application/metalink+xml 24 1561 metadata XML element 17 1562 metalink XML element 9 1563 metalinkCommonAttributes grammar production 7 1564 metalinkCopyright grammar production 14 1565 metalinkDateConstruct grammar production 8 1566 metalinkDescription grammar production 14 1567 metalinkFile grammar production 11 1568 metalinkFiles grammar production 10 1569 metalinkGenerator grammar production 15 1570 metalinkHash grammar production 15 1571 metalinkIdentity grammar production 16 1572 metalinkLanguage grammar production 17 1573 metalinkLicense grammar production 17 1574 metalinkLogo grammar production 17 1575 metalinkMetalink grammar production 9 1576 metalinkOrigin grammar production 18 1577 metalinkOS grammar production 18 1578 metalinkPieces grammar production 14 1579 metalinkPublished grammar production 19 1580 metalinkPublisher grammar production 19 1581 metalinkResources grammar production 12 1582 metalinkSignature grammar production 19 1583 metalinkSize grammar production 20 1584 metalinkTextConstruct grammar production 7 1585 metalinkType grammar production 20 1586 metalinkUpdated grammar production 20 1587 metalinkURL grammar production 18, 21 1588 metalinkVerification grammar production 13 1589 metalinkVersion grammar production 21 1591 O 1592 origin XML element 18 1593 os XML element 18 1595 P 1596 pieces XML element 13 1597 published XML element 19 1598 publisher XML element 19 1600 R 1601 resources XML element 12 1603 S 1604 signature XML element 19 1605 simpleExtensionElement grammar production 23 1606 size XML element 20 1607 structuredExtensionElement grammar production 23 1609 T 1610 type XML element 20 1612 U 1613 updated XML element 20 1614 url XML element 20 1616 V 1617 verification XML element 13 1618 version XML element 21 1620 X 1621 XML Elements 1622 copyright 14 1623 description 14 1624 entry 11 1625 files 10 1626 generator 14 1627 hash 15 1628 identity 16 1629 language 17 1630 license 17 1631 logo 17 1632 metadata 17 1633 metalink 9 1634 origin 18 1635 os 18 1636 pieces 13 1637 published 19 1638 publisher 19 1639 resources 12 1640 signature 19 1641 size 20 1642 type 20 1643 updated 20 1644 url 20 1645 verification 13 1646 version 21 1648 Authors' Addresses 1650 Anthony Bryan (editor) 1651 Metalinker Project 1653 Email: anthonybryan@gmail.com 1654 URI: http://www.metalinker.org 1656 Tatsuhiro Tsujikawa (editor) 1657 Metalinker Project 1659 Email: tatsuhiro.t@gmail.com 1660 URI: http://aria2.sourceforge.net 1661 Neil McNab (editor) 1662 Metalinker Project 1664 Email: nabber00@gmail.com 1665 URI: http://www.nabber.org 1667 Peter Poeml (editor) 1668 Novell, Inc. 1670 Email: info@mirrorbrain.org 1671 URI: http://www.mirrorbrain.org/