One document matched: draft-bryan-metalink-05.xml
<?xml version="1.0" encoding="UTF-8"?><?rfc linefile="1:draft-bryan-metalink-04.xml"?>
<!-- automatically generated by xml2rfc v1.32 on 2007-04-02T19:01:17Z -->
<!--
This XML document is the output of clean-for-DTD.xslt; a tool that strips
extensions to RFC2629(bis) from documents for processing with xml2rfc.
-->
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes" ?>
<?rfc tocdepth="3" ?>
<?rfc tocindent="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc compact="yes" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>
<?rfc inline="yes" ?><!--
This version may use non-xml2rfc extensions, currently only supported
in rfc2629xslt. See <http://greenbytes.de/tech/webdav/rfc2629xslt/rfc2629xslt.html>
for instructions to downgrade to the xml2rfc grammar (DWNGRD).
-->
<!DOCTYPE rfc
PUBLIC "" "rfc2629.dtd">
<rfc category="std" docName="draft-bryan-metalink-05" ipr="trust200811">
<front>
<title abbrev="Metalink Download Description Format">The Metalink Download Description Format</title>
<author initials="A." surname="Bryan" fullname="Anthony Bryan" role="editor">
<organization>Metalinker Project</organization>
<address>
<email>anthonybryan@gmail.com</email>
<uri>http://www.metalinker.org</uri>
</address>
</author>
<date month="January" year="2009"/>
<abstract>
<t>This document specifies Metalink Documents, an XML-based download description format.</t>
</abstract>
</front>
<middle>
<section title="Introduction">
<t>Metalink is an XML-based document format that describes a file or lists of files to be added to a download queue. Lists are composed of a number of files,
each with an extensible set of attached
metadata. For example, each file can have a description, checksum, and list of URIs that it is available from.</t>
<t>The primary use case that Metalink addresses is the description of downloadable content in a format so download agents can act intelligently and
recover from common errors with little or no user interaction necessary. These errors can include multiple servers going down and data corrupted in transmission.</t>
<t>Discussion of this draft should take place on discuss@apps.ietf.org or the Metalink discussion mailing list
located at metalink-discussion@googlegroups.com. To join the list, visit
http://groups.google.com/group/metalink-discussion .</t>
<section title="Examples"><t><figure>
<preamble>A brief, single file Metalink Document:</preamble>
<artwork type="example">
<?xml version="1.0" encoding="UTF-8"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
<files>
<file name="example.ext">
<resources>
<url>ftp://ftp.example.com/example.ext</url>
<url>http://example.com/example.ext</url>
<metadata type="torrent">
http://example.com/example.ext.torrent
</metadata>
</resources>
</file>
</files>
</metalink>
</artwork></figure></t>
<t>
<figure>
<preamble>A more extensive, single file Metalink Document:</preamble>
<artwork type="example">
<?xml version="1.0" encoding="UTF-8"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
<published>2008-05-15T12:23:23Z</published>
<files>
<file name="example.ext">
<identity>Example</identity>
<version>1.0</version>
<description>A description of the example file for
download.</description>
<verification>
<hash type="sha-1">80bc95fd391772fa61c91ed68567f0980bb45fd9
</hash>
</verification>
<resources>
<url>ftp://ftp.example.com/example.ext</url>
<url>http://example.com/example.ext</url>
<metadata type="torrent">
http://example.com/example.ext.torrent
</metadata>
</resources>
</file>
</files>
</metalink></artwork>
</figure>
</t>
</section>
<section title="Namespace and Version" anchor="namespace.and.version">
<t>The XML Namespaces URI <xref target="REC-xml-names"/> for the XML data
format described in this specification is:</t>
<t>urn:ietf:params:xml:ns:metalink</t>
<t>For convenience, this data format may be referred to as
"Metalink", which this specification uses internally.</t>
</section>
<section title="Notational Conventions">
<t>This specification describes conformance of Metalink
Documents. Additionally, it places some requirements on Metalink
Processors.</t>
<t>This specification uses the namespace prefix "metalink:" for
the Namespace URI identified in <xref target="namespace.and.version"/>, above. Note that
the choice of namespace prefix is arbitrary and not
semantically significant.</t>
<t>Metalink is specified using terms from the XML Infoset <xref target="REC-xml-infoset"/>. However, this
specification uses a shorthand for two common terms: the
phrase "Information Item" is omitted when naming Element
Information Items and Attribute Information Items. Therefore,
when this specification uses the term "element," it is
referring to an Element Information Item in Infoset
terms. Likewise, when it uses the term "attribute," it is
referring to an Attribute Information Item.</t>
<t>Some sections of this specification are illustrated with fragments
of a non-normative RELAX NG Compact schema <xref target="RELAX-NG"/>. However, the text of this specification provides the definition of
conformance. A complete schema appears in <xref target="schema"/>.
</t>
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in BCP 14, <xref target="RFC2119"/>, as scoped to those conformance targets.</t>
</section>
</section>
<section title="Metalink Documents" anchor="metalink.documents">
<t>This specification describes Metalink Documents.</t>
<t>A Metalink Document describes a file or group of files,
how to access them, and metadata that identifies them. Its root is the <xref target="element.metalink" format="none">metalink:metalink</xref> element.</t>
<figure>
<artwork type="rnc">
namespace metalink = "urn:ietf:params:xml:ns:metalink"
start = metalinkMetalink</artwork>
</figure>
<t>Metalink Documents are specified in terms of the
XML Information Set, serialized as XML 1.0 <xref target="REC-xml"/> and identified with the
"application/metalink+xml" media type.</t>
<t>Metalink Documents MUST be
well-formed XML. This specification does not define a DTD for
Metalink Documents, and hence does not require them to be valid (in
the sense used by XML).</t>
<t>Metalink allows the use of IRIs <xref target="RFC3987"/>. Every
URI <xref target="RFC3986"/> is also an IRI, so a URI may be
used wherever below an IRI is named. There is one special
consideration: when an IRI that is not also a URI is given for
dereferencing, it MUST be mapped to a URI using the steps in
Section 3.1 of <xref target="RFC3987"/>.</t>
<t>Any element defined by this specification MAY have an
xml:base attribute <xref target="REC-xmlbase"/>.
When xml:base is used in an Metalink Document, it serves the
function described in Section 5.1.1 of <xref target="RFC3986"/>,
establishing the base URI (or IRI) for resolving any relative
references found within the effective scope of the xml:base
attribute.</t>
<t>Any element defined by this specification MAY have an
xml:lang attribute, whose content indicates the natural language
for the element and its descendents. The language context is only
significant for elements and attributes declared to be
"Language-Sensitive" by this specification. Requirements
regarding the content and interpretation of xml:lang are
specified in <xref target="REC-xml">XML 1.0</xref>,
Section 2.12.
<figure>
<iref item="metalinkCommonAttributes grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkCommonAttributes" primary="true"/>
<artwork type="rnc">
metalinkCommonAttributes =
attribute xml:base { metalinkUri }?,
attribute xml:lang { metalinkLanguageTag }?,
undefinedAttribute*</artwork> </figure></t>
<t>Metalink is an extensible format. See <xref target="extending_metalink"/>
of this document for a full description of how Metalink Documents can
be extended.</t>
</section>
<section title="Common Metalink Constructs">
<t>Many of Metalink's elements share a few common structures. This section
defines those structures and their requirements for convenient
reference by the appropriate element definitions.</t>
<t>When an element is identified as being a particular kind of
construct, it inherits the corresponding requirements from that
construct's definition in this section.</t>
<t>Note that there MUST NOT be any white space in a Date construct
or in any IRI. Some XML-emitting implementations erroneously insert
white space around values by default, and such implementations will emit
invalid Metalink Documents.</t>
<section title="Text Constructs" anchor="text.constructs">
<t>A Text construct contains human-readable text, usually in
small quantities. The content of Text constructs is
Language-Sensitive.
<figure>
<iref item="metalinkTextConstruct grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkTextConstruct" primary="true"/>
<artwork type="rnc">
metalinkTextConstruct =
metalinkCommonAttributes,
text</artwork></figure></t>
<section title="Text">
<t>Example <xref target="element.description" format="none">metalink:description</xref> with text content:
<figure>
<artwork type="example">
...
<description>
A description of the example file for download.
</description>
...</artwork>
</figure>
</t>
<t>The content of the Text
construct MUST NOT contain child elements. Such text is
intended to be presented to humans in a readable fashion.
Thus, Metalink Processors MAY collapse white space (including
line breaks) and display the text using typographic
techniques such as justification and proportional
fonts.</t>
</section>
</section>
<section title="Date Constructs" anchor="date.constructs">
<t>A Date construct is an element whose content MUST conform
to the "date-time" production in <xref target="RFC3339"/>. In addition, an uppercase "T" character
MUST be used to separate date and time, and an uppercase "Z"
character MUST be present in the absence of a numeric time zone
offset.
<figure>
<iref item="metalinkDateConstruct grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkDateConstruct" primary="true"/>
<artwork type="rnc">
metalinkDateConstruct =
metalinkCommonAttributes,
xsd:dateTime</artwork></figure></t>
<t>Such date values happen to be compatible with the following
specifications:
<xref target="ISO.8601.1988"/>,
<xref target="W3C.NOTE-datetime-19980827"/>,
and <xref target="W3C.REC-xmlschema-2-20041028"/>.</t>
<t>Example Date constructs:
<figure>
<artwork type="example">
<updated>2008-12-13T18:30:02Z</updated>
<updated>2008-12-13T18:30:02.25Z</updated>
<updated>2008-12-13T18:30:02+01:00</updated>
<updated>2008-12-13T18:30:02.25+01:00</updated>
</artwork>
</figure>
</t>
<t>Date values SHOULD be as accurate as possible. For
example, it would be generally inappropriate for a publishing
system to apply the same timestamp to several entries that
were published during the course of a single day.</t>
</section>
</section>
<section title="Metalink Element Definitions">
<section title="Container Elements">
<section anchor="element.metalink" title="The "metalink:metalink" Element">
<iref item="XML Elements" subitem="metalink" primary="true"/>
<iref item="metalink XML element" primary="true"/>
<t>The "metalink:metalink" element is the document (i.e., top-level) element
of a Metalink Document, acting as a container for metadata and
data associated with the listed files. It contains one "metalink:files" element whose element children consist of
metadata elements followed by one or more <xref target="element.file" format="none">metalink:file</xref> child
elements.
<figure>
<iref item="metalinkMetalink grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkMetalink" primary="true"/>
<artwork type="rnc">
metalinkMetalink =
element metalink:metalink {
metalinkCommonAttributes,
(metalinkPublished?
& metalinkOrigin?
& metalinkGenerator?
& metalinkUpdated?
& extensionElement*),
metalinkFiles
}</artwork></figure></t>
<t>The following child elements are defined by this specification
(note that the presence of some of these elements is required):</t>
<t>
<list style="symbols">
<t><xref target="element.metalink" format="none">metalink:metalink</xref> elements MUST contain exactly one <xref target="element.files" format="none">metalink:files</xref> element.</t>
<t>If <xref target="element.type" format="none">metalink:type</xref> is "dynamic", <xref target="element.metalink" format="none">metalink:metalink</xref> elements MAY contain exactly one <xref target="element.origin" format="none">metalink:origin</xref> element.</t>
<t><xref target="element.metalink" format="none">metalink:metalink</xref> elements MAY contain exactly one <xref target="element.type" format="none">metalink:type</xref> element.</t>
<t><xref target="element.metalink" format="none">metalink:metalink</xref> elements MAY contain exactly one <xref target="element.generator" format="none">metalink:generator</xref> element.</t>
<t><xref target="element.metalink" format="none">metalink:metalink</xref> elements MAY contain exactly one <xref target="element.published" format="none">metalink:published</xref> element.</t>
<t>If <xref target="element.type" format="none">metalink:type</xref> is "dynamic", <xref target="element.metalink" format="none">metalink:metalink</xref> elements MAY contain exactly one <xref target="element.updated" format="none">metalink:updated</xref> element.</t>
</list></t>
<section toc="exclude" title="Providing Textual Content">
<t>Experience teaches that downloads providing textual
content are in general more useful than those that do
not. Some applications (one example is full-text indexers)
require a minimum amount of text to function
reliably and predictably. Metalink publishers should be aware
of these issues. It is advisable that each <xref target="element.file" format="none">metalink:file</xref>
element contain a non-empty <xref target="element.description" format="none">metalink:description</xref> element, a
non-empty <xref target="element.identity" format="none">metalink:identity</xref> element when that element is
present, and a non-empty <xref target="element.version" format="none">metalink:version</xref> element, and a non-empty
<xref target="element.publisher" format="none">metalink:publisher</xref> element. However, the
absence of <xref target="element.description" format="none">metalink:description</xref> is not an error, and Metalink
Processors MUST NOT fail to function correctly as a
consequence of such an absence.</t>
</section>
</section>
<section anchor="element.files" title="The "metalink:files" Element">
<iref item="XML Elements" subitem="files" primary="true"/>
<iref item="files XML element" primary="true"/>
<t>The "metalink:files" element acts as a container for metadata and
data associated with the listed files. It contains one or more <xref target="element.file" format="none">metalink:file</xref> child
elements. Certain elements can be listed either under <xref target="element.files" format="none">metalink:files</xref> or <xref target="element.file" format="none">metalink:file</xref>.
If under <xref target="element.files" format="none">metalink:files</xref>, they apply to all files listed in each <xref target="element.file" format="none">metalink:file</xref>. If under <xref target="element.file" format="none">metalink:file</xref>, then they apply to just that specific file.
If an element is listed both under <xref target="element.files" format="none">metalink:files</xref> and <xref target="element.file" format="none">metalink:file</xref>, then the element under <xref target="element.file" format="none">metalink:file</xref> has precedence and the <xref target="element.files" format="none">metalink:files</xref> element does not apply to that particular file.
<figure>
<iref item="metalinkFiles grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkFiles" primary="true"/>
<artwork type="rnc">
metalinkFiles =
element metalink:files {
metalinkCommonAttributes,
(metalinkIdentity?
& metalinkVersion?
& metalinkDescription?
& metalinkOS?
& metalinkLogo?
& metalinkLanguage?
& metalinkPublisher?
& metalinkCopyright?
& metalinkLicense?
& extensionElement*)
metalinkFile
}</artwork></figure></t>
<t>The following child elements are defined by this specification
(note that the presence of some of these elements is required):</t>
<t>
<list style="symbols">
<t><xref target="element.files" format="none">metalink:files</xref> element MUST contain one or more <xref target="element.file" format="none">metalink:file</xref>
elements.</t>
<t><xref target="element.files" format="none">metalink:files</xref> elements SHOULD contain exactly one <xref target="element.identity" format="none">metalink:identity</xref>
element.</t>
<t><xref target="element.files" format="none">metalink:files</xref> elements SHOULD contain exactly one <xref target="element.version" format="none">metalink:version</xref>
element.</t>
<t><xref target="element.files" format="none">metalink:files</xref> elements MAY contain exactly one <xref target="element.description" format="none">metalink:description</xref>
element.</t>
<t><xref target="element.files" format="none">metalink:files</xref> elements MAY contain exactly one <xref target="element.os" format="none">metalink:os</xref>
element.</t>
<t><xref target="element.files" format="none">metalink:files</xref> elements MAY contain exactly one <xref target="element.logo" format="none">metalink:logo</xref>
element.</t>
<t><xref target="element.files" format="none">metalink:files</xref> elements MAY contain exactly one <xref target="element.language" format="none">metalink:language</xref>
element.</t>
<t><xref target="element.files" format="none">metalink:files</xref> elements MAY contain exactly one <xref target="element.publisher" format="none">metalink:publisher</xref>
element.</t>
<t><xref target="element.files" format="none">metalink:files</xref> elements MAY contain exactly one <xref target="element.copyright" format="none">metalink:copyright</xref>
element.</t>
<t><xref target="element.files" format="none">metalink:files</xref> elements MAY contain exactly one <xref target="element.license" format="none">metalink:license</xref>
element.</t>
</list></t>
</section>
<section anchor="element.file" title="The "metalink:file" Element">
<iref item="XML Elements" subitem="entry" primary="true"/>
<iref item="file XML element" primary="true"/>
<t>The "<xref target="element.file" format="none">metalink:file</xref>" element represents an individual file,
acting as a container for metadata and data associated with
the file.
<figure>
<iref item="metalinkFile grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkFile" primary="true"/>
<artwork type="rnc">
metalinkFile =
element metalink:file {
metalinkCommonAttributes,
attribute name { metalinkTextConstruct },
(metalinkVerification?
& metalinkIdentity?
& metalinkVersion?
& metalinkDescription?
& metalinkSize?
& metalinkOS?
& metalinkLogo?
& metalinkLanguage?
& metalinkPublisher?
& metalinkCopyright?
& metalinkLicense?
& extensionElement*)
metalinkResources
}</artwork></figure></t>
<t>This specification assigns no significance to the order of
<xref target="element.file" format="none">metalink:file</xref> elements.</t>
<t>The following child elements are defined by this specification
(note that it requires the presence of some of these elements):</t>
<t>
<list style="symbols">
<t><xref target="element.file" format="none">metalink:file</xref> elements MUST contain exactly one <xref target="element.resources" format="none">metalink:resources</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements SHOULD contain exactly one <xref target="element.verification" format="none">metalink:verification</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements SHOULD contain exactly one <xref target="element.identity" format="none">metalink:identity</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements SHOULD contain exactly one <xref target="element.version" format="none">metalink:version</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements MAY contain exactly one <xref target="element.description" format="none">metalink:description</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements SHOULD contain exactly one <xref target="element.size" format="none">metalink:size</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements MAY contain exactly one <xref target="element.os" format="none">metalink:os</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements MAY contain exactly one <xref target="element.logo" format="none">metalink:logo</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements MAY contain exactly one <xref target="element.language" format="none">metalink:language</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements MAY contain exactly one <xref target="element.publisher" format="none">metalink:publisher</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements MAY contain exactly one <xref target="element.copyright" format="none">metalink:copyright</xref>
element.</t>
<t><xref target="element.file" format="none">metalink:file</xref> elements MAY contain exactly one <xref target="element.license" format="none">metalink:license</xref>
element.</t>
</list>
</t>
<section title="The "name" Attribute">
<t><xref target="element.file" format="none">metalink:file</xref> elements MUST have a "name" attribute, which contains the filename of the file downloaded.
<figure>
<preamble>Directory information can also be contained in a "path/file" format only, as in:</preamble>
<artwork type="example">
<file name="debian-amd64/sarge/Contents-amd64.gz">
</artwork></figure></t>
<t>In this example, a subdirectory debian-amd64/sarge/ will be created
and a file named Contents-amd64.gz will be created inside it. The
path MUST be relative. The path MUST NOT begin with a "/", "./" or
"../", contain "/../", or end with "/..". Metalink Processors MUST NOT allow
directory traversal.</t>
<t>A Metalink Processor MAY alter the name of the subdirectory or file
if they contain characters which are invalid in the destination
filesystem.</t>
</section>
</section>
<section anchor="element.resources" title="The "metalink:resources" Element">
<iref item="XML Elements" subitem="resources" primary="true"/>
<iref item="resources XML element" primary="true"/>
<t>The "metalink:resources" element acts as a container for metadata and
data associated with the listed files. It contains one or more <xref target="element.url" format="none">metalink:url</xref> child
elements. It can also contain one or more <xref target="element.metadata" format="none">metalink:metadata</xref> child
elements.
<figure>
<iref item="metalinkResources grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkResources" primary="true"/>
<artwork type="rnc">
metalinkResources =
element metalink:resources {
metalinkCommonAttributes,
extensionElement*
metalinkURL*
metalinkMetadata*
}</artwork></figure></t>
<t>This specification assigns no significance to the order of
<xref target="element.url" format="none">metalink:url</xref> elements. Significance is determined by the value of the "preference" attribute of the <xref target="element.url" format="none">metalink:url</xref> elements.</t>
<t>The following child elements are defined by this specification
(note that the presence of some of these elements is required):</t>
<t>
<list style="symbols">
<t><xref target="element.resources" format="none">metalink:resources</xref> element MUST contain at least one <xref target="element.metadata" format="none">metalink:metadata</xref> element or at least one <xref target="element.url" format="none">metalink:url</xref> element. Typically, <xref target="element.resources" format="none">metalink:resources</xref> element contains more than one <xref target="element.url" format="none">metalink:url</xref> element to provide multiple download sources.</t>
</list></t>
</section>
<section anchor="element.verification" title="The "metalink:verification" Element">
<iref item="XML Elements" subitem="verification" primary="true"/>
<iref item="verification XML element" primary="true"/>
<t>The "metalink:verification" element acts as a container for metadata and
data associated with verifying the listed files. This information is in the form of checksums and digital signatures.
Checksums are used to verify the integrity of a complete file or portion of a file to determine if the files have been transferred without any errors.
Digital signatures verify that a file is from the entity that has signed it.
<figure>
<iref item="metalinkVerification grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkVerification" primary="true"/>
<artwork type="rnc">
metalinkVerification =
element metalink:verification {
metalinkCommonAttributes,
(metalinkHash*
& metalinkPieces*
& metalinkSignature?
& extensionElement*)
}</artwork></figure></t>
<t>The following child elements are defined by this specification:</t>
<t>
<list style="symbols">
<t><xref target="element.verification" format="none">metalink:verification</xref> element MAY contain one or more
<xref target="element.hash" format="none">metalink:hash</xref> elements.</t>
<t><xref target="element.verification" format="none">metalink:verification</xref> element MAY contain one or more
<xref target="element.pieces" format="none">metalink:pieces</xref> elements.</t>
<t><xref target="element.verification" format="none">metalink:verification</xref> element MAY contain one or more
<xref target="element.signature" format="none">metalink:signature</xref> elements.</t>
</list></t>
</section>
<section anchor="element.pieces" title="The "metalink:pieces" Element">
<iref item="XML Elements" subitem="pieces" primary="true"/>
<iref item="pieces XML element" primary="true"/>
<t>The "<xref target="element.pieces" format="none">metalink:pieces</xref>" element acts as a container for metadata
and data associated with verifying the listed files. This information is in the form of checksums for a portion of a file.
<figure>
<iref item="metalinkPieces grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkPieces" primary="true"/>
<artwork type="rnc">
metalinkPieces =
element metalink:pieces {
attribute length { metalinkTextConstruct },
attribute type { metalinkTextConstruct },
hash+
}+,</artwork></figure></t>
<section title="The "type" Attribute">
<t><xref target="element.pieces" format="none">metalink:pieces</xref> elements MUST have a "type" attribute.
</t>
<t>The IANA registry named "Hash Function Textual Names" defines values for hash types. Metalink Generators and Processors supporting verification SHOULD at least implement
"sha-1" which is SHA1, as specified in <xref target="RFC3174"/>.</t>
</section>
<section title="The "length" Attribute">
<t><xref target="element.pieces" format="none">metalink:pieces</xref> elements MUST have a "length" attribute, which is an integer
that describes the length of the piece of the file in octets.
</t>
</section>
</section>
</section>
<section title="Metadata Elements">
<section anchor="element.copyright" title="The "metalink:copyright" Element">
<iref item="XML Elements" subitem="copyright" primary="true"/>
<iref item="copyright XML element" primary="true"/>
<t>The "<xref target="element.copyright" format="none">metalink:copyright</xref>" element is a Text construct that conveys a
human-readable copyright for a file.
<figure>
<iref item="metalinkCopyright grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkCopyright" primary="true"/>
<artwork type="rnc">
metalinkCopyright =
element metalink:copyright {
metalinkTextConstruct
}</artwork></figure></t>
</section>
<section anchor="element.description" title="The "metalink:description" Element">
<iref item="XML Elements" subitem="description" primary="true"/>
<iref item="description XML element" primary="true"/>
<t>The "<xref target="element.description" format="none">metalink:description</xref>" element is a Text construct that conveys a
human-readable description for a file.
<figure>
<iref item="metalinkDescription grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkDescription" primary="true"/>
<artwork type="rnc">
metalinkDescription =
element metalink:description {
metalinkTextConstruct
}</artwork></figure></t>
</section>
<section anchor="element.generator" title="The "metalink:generator" Element">
<iref item="XML Elements" subitem="generator" primary="true"/>
<iref item="generator XML element" primary="true"/>
<t>The "<xref target="element.generator" format="none">metalink:generator</xref>" element's content identifies the agent used
to generate a Metalink Document, for debugging and other purposes.
<figure>
<iref item="metalinkGenerator grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkGenerator" primary="true"/>
<artwork type="rnc">
metalinkGenerator = element metalink:generator {
metalinkCommonAttributes,
attribute uri { metalinkUri }?,
attribute version { text }?,
text
}</artwork></figure></t>
<t>The content of this element, when present, MUST be a
string that is a human-readable name for the generating
agent. Entities such as "&" and "<"
represent their corresponding characters ("&" and "<"
respectively), not markup.</t>
<t>The <xref target="element.generator" format="none">metalink:generator</xref> element MAY have a "uri" attribute
whose value MUST be an IRI reference <xref target="RFC3987"/>. When dereferenced, the resulting URI (mapped from an
IRI, if necessary) SHOULD produce a representation that is
relevant to that agent.</t>
<t>The <xref target="element.generator" format="none">metalink:generator</xref> element MAY have a "version" attribute that
indicates the version of the generating agent.</t>
</section>
<section anchor="element.hash" title="The "metalink:hash" Element">
<iref item="XML Elements" subitem="hash" primary="true"/>
<iref item="hash XML element" primary="true"/>
<t>The "<xref target="element.hash" format="none">metalink:hash</xref>" element is a Text construct that conveys a
hash for a file. All hashes are encoded in lowercase hexadecimal format.
<figure>
<iref item="metalinkHash grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkHash" primary="true"/>
<artwork type="rnc">
metalinkHash =
element metalink:hash {
attribute piece { xsd:integer }?,
attribute type { metalinkTextConstruct },
text
}</artwork></figure></t>
<t>Metalinks can contain multiples hashes for a complete file, for example both SHA-1 and SHA-256.
<figure>
<artwork type="example">
...
<verification>
<hash type="sha-1">a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash>
<hash type="sha-256">fc87941af7fd7f03e53b34af393f4c14923d74
825f51116ff591336af4880227</hash>
</verification>
...</artwork>
</figure>
</t>
<t>Metalinks can also contain hashes for individual pieces of a file.
<figure>
<artwork type="example">
...
<verification>
<hash type="sha-1">a97fcf6ba9358f8a6f62beee4421863d3e52b080</hash>
<hash type="sha-256">fc87941af7fd7f03e53b34af393f4c14923d74
825f51116ff591336af4880227</hash>
<pieces length="1048576" type="sha-1">
<hash piece="0">d96b9a4b92a899c2099b7b31bddb5ca423bb9b30</hash>
<hash piece="1">10d68f4b1119014c123da2a0a6baf5c8a6d5ba1e</hash>
<hash piece="2">3e84219096435c34e092b17b70a011771c52d87a</hash>
<hash piece="3">67183e4c3ab892d3ebe8326b7d79eb62d077f487</hash>
</pieces>
</verification>
...</artwork>
</figure>
</t>
<t><xref target="element.hash" format="none">metalink:hash</xref> elements MUST have a "type" attribute or a "piece" attribute. <xref target="element.hash" format="none">metalink:hash</xref> elements
with a "type" attribute contain a hash of the whole file. <xref target="element.hash" format="none">metalink:hash</xref> elements with a "piece" attribute contain a hash for that specific piece or chunk of the file.</t>
<section title="The "type" Attribute">
<t>The IANA registry named "Hash Function Textual Names" defines values for hash types. Metalink Generators and Processors supporting verification SHOULD at least implement
"sha-1" which is SHA1, as specified in <xref target="RFC3174"/>.</t>
</section>
<section title="The "piece" Attribute">
<t><xref target="element.hash" format="none">metalink:hash</xref> elements MAY have a "piece" attribute, only when they are a sub element of <xref target="element.pieces" format="none">metalink:pieces</xref>.
The value of "piece" starts at "0" and increases, depending on the "length" attribute of <xref target="element.pieces" format="none">metalink:pieces</xref> and the size of the file. Depending on the size of a file, the last piece may not be the same size as the others.
</t>
</section>
</section>
<section anchor="element.identity" title="The "metalink:identity" Element">
<iref item="XML Elements" subitem="identity" primary="true"/>
<iref item="identity XML element" primary="true"/>
<t>The "<xref target="element.identity" format="none">metalink:identity</xref>" element is a Text construct that conveys a
human-readable identity for a file. The identity of OpenOffice.org 3.0 would be "OpenOffice.org".
<figure>
<iref item="metalinkIdentity grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkIdentity" primary="true"/>
<artwork type="rnc">
metalinkIdentity =
element metalink:identity {
metalinkTextConstruct
}</artwork></figure></t>
</section>
<section anchor="element.language" title="The "metalink:language" Element">
<iref item="XML Elements" subitem="language" primary="true"/>
<iref item="language XML element" primary="true"/>
<t>The "<xref target="element.language" format="none">metalink:language</xref>" element is a Text construct that conveys a
code for the language of a file, per <xref target="ISO639-2"/>.
<figure>
<iref item="metalinkLanguage grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkLanguage" primary="true"/>
<artwork type="rnc">
metalinkLanguage =
element metalink:language {
metalinkTextConstruct
}</artwork></figure></t>
</section>
<section anchor="element.license" title="The "metalink:license" Element">
<iref item="XML Elements" subitem="license" primary="true"/>
<iref item="license XML element" primary="true"/>
<t>The "<xref target="element.license" format="none">metalink:license</xref>" element is a Text construct that conveys a
human-readable license name for a file.
<figure>
<iref item="metalinkLicense grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkLicense" primary="true"/>
<artwork type="rnc">
metalinkLicense =
element metalink:license {
metalinkCommonAttributes,
attribute uri { metalinkUri }?,
attribute name { metalinkTextConstruct }?,
}</artwork></figure></t>
<t>The <xref target="element.license" format="none">metalink:license</xref> element MAY have a "uri" attribute
whose value MUST be an IRI reference <xref target="RFC3987"/>. When dereferenced, the resulting URI (mapped from an
IRI, if necessary) SHOULD produce a representation that is
relevant to that agent.</t>
<t>The <xref target="element.license" format="none">metalink:license</xref> element MAY have a "name" attribute that
indicates the name of the license.</t>
</section>
<section anchor="element.logo" title="The "metalink:logo" Element">
<iref item="XML Elements" subitem="logo" primary="true"/>
<iref item="logo XML element" primary="true"/>
<t>The "<xref target="element.logo" format="none">metalink:logo</xref>" element's content is an IRI reference <xref target="RFC3987"/> that identifies an image that provides visual
identification for a file.
<figure>
<iref item="metalinkLogo grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkLogo" primary="true"/>
<artwork type="rnc">
metalinkLogo = element metalink:logo {
metalinkCommonAttributes,
(metalinkUri)
}</artwork></figure></t>
<t>The image SHOULD have an aspect ratio of one (horizontal)
to one (vertical) and SHOULD be suitable for presentation
at a small size.</t>
</section>
<section anchor="element.metadata" title="The "metalink:metadata" Element">
<iref item="XML Elements" subitem="metadata" primary="true"/>
<iref item="metadata XML element" primary="true"/>
<t>The "<xref target="element.metadata" format="none">metalink:metadata</xref>" element contains the IRI of metadata about a resource to download. For example, this could be the IRI of a BitTorrent .torrent file or a Metalink Document.
<figure>
<iref item="metalinkURL grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkURL" primary="true"/>
<artwork type="rnc">
metalinkMetadata =
element metalink:metadata {
metalinkCommonAttributes,
attribute preference { xsd:integer }?,
attribute type { metalinkTextConstruct },
metalinkUri
}+</artwork></figure></t>
<section title="The "preference" Attribute">
<t><xref target="element.metadata" format="none">metalink:metadata</xref>
elements MAY have a preference attribute, whose value MUST be a number from 1 to 100
for priority, with 100 used first and 1 used last. See the "preference" attribute of the <xref target="element.url" format="none">metalink:url</xref> element for more information.</t>
</section>
<section title="The "type" Attribute">
<t><xref target="element.metadata" format="none">metalink:metadata</xref> elements MUST have a "type" attribute that indicates
the MIME type of the metadata available at the IRI. In the case of BitTorrent as specified in <xref target="BITTORRENT"/>, the value "torrent" is required. Types without "/" are reserved. Currently, "torrent" is the only reserved value.</t>
<t>Metalink Processors that do not support a specified type of metadata about a resource to download MUST ignore that metadata.</t>
</section>
</section>
<section anchor="element.origin" title="The "metalink:origin" Element">
<iref item="XML Elements" subitem="origin" primary="true"/>
<iref item="origin XML element" primary="true"/>
<t>The "<xref target="element.origin" format="none">metalink:origin</xref>" element is an IRI where the Metalink Document was originally published. If <xref target="element.type" format="none">metalink:type</xref> is "dynamic", then updated
versions of the Metalink can be found at this IRI.
<figure>
<iref item="metalinkOrigin grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkOrigin" primary="true"/>
<artwork type="rnc">
metalinkOrigin = element metalink:origin {
metalinkCommonAttributes,
(metalinkUri)
}</artwork></figure></t>
</section>
<section anchor="element.os" title="The "metalink:os" Element">
<iref item="XML Elements" subitem="os" primary="true"/>
<iref item="os XML element" primary="true"/>
<t>The "<xref target="element.os" format="none">metalink:os</xref>" element is a Text construct that conveys a
human-readable Operating System for a file. The IANA registry named "Operating System Names" defines values for OS types.
<figure>
<iref item="metalinkOS grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkOS" primary="true"/>
<artwork type="rnc">
metalinkOS =
element metalink:os {
metalinkTextConstruct
}</artwork></figure></t>
</section>
<section anchor="element.published" title="The "metalink:published" Element">
<iref item="XML Elements" subitem="published" primary="true"/>
<iref item="published XML element" primary="true"/>
<t>The "<xref target="element.published" format="none">metalink:published</xref>" element is a Date construct indicating an
instant in time associated with an event early in the life cycle of
the entry.
<figure>
<iref item="metalinkPublished grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkPublished" primary="true"/>
<artwork type="rnc">
metalinkPublished =
element metalink:published {
metalinkDateConstruct
}</artwork></figure></t>
<t>Typically, <xref target="element.published" format="none">metalink:published</xref> will be associated with the
initial creation or first availability of the resource.</t>
</section>
<section anchor="element.publisher" title="The "metalink:publisher" Element">
<iref item="XML Elements" subitem="publisher" primary="true"/>
<iref item="publisher XML element" primary="true"/>
<t>The "<xref target="element.publisher" format="none">metalink:publisher</xref>" element
indicates a group or other entity which has published the file.
<figure>
<iref item="metalinkPublisher grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkPublisher" primary="true"/>
<artwork type="rnc">
metalinkPublisher =
element metalink:publisher {
metalinkCommonAttributes,
attribute uri { metalinkUri }?,
attribute name { metalinkTextConstruct }?,
}</artwork></figure></t>
<t>The <xref target="element.publisher" format="none">metalink:publisher</xref> element MAY have a "uri" attribute
whose value MUST be an IRI reference <xref target="RFC3987"/>. When dereferenced, the resulting URI (mapped from an
IRI, if necessary) SHOULD produce a representation that is
relevant to that agent.</t>
<t>The <xref target="element.publisher" format="none">metalink:publisher</xref> element MAY have a "name" attribute that
indicates the name of the publisher.</t>
</section>
<section anchor="element.signature" title="The "metalink:signature" Element">
<iref item="XML Elements" subitem="signature" primary="true"/>
<iref item="signature XML element" primary="true"/>
<t>The "<xref target="element.signature" format="none">metalink:signature</xref>" element is a Text construct that conveys a
digital signature for a file described in a Metalink Document.
<figure>
<iref item="metalinkSignature grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkSignature" primary="true"/>
<artwork type="rnc">
metalinkSignature =
element metalink:signature {
attribute type { "pgp" },
metalinkTextConstruct
}</artwork></figure></t>
<section title="The "type" Attribute">
<t><xref target="element.signature" format="none">metalink:signature</xref> elements MUST have a "type" attribute.
The inital value of "type" is the string that is non-empty and matches "pgp". It may be useful to extend Metalink documents with new types of
digital signatures, so unknown types are allowed.
</t>
</section>
</section>
<section anchor="element.size" title="The "metalink:size" Element">
<iref item="XML Elements" subitem="size" primary="true"/>
<iref item="size XML element" primary="true"/>
<t>The "<xref target="element.size" format="none">metalink:size</xref>" element indicates the length of
the linked content in octets; it is a hint about the
content length of the representation returned when the IRI
is mapped to a URI and
dereferenced. Note that the "<xref target="element.size" format="none">metalink:size</xref>" element MUST
override the actual content length of the representation
as reported by the underlying protocol, i.e. files with different sizes should be discarded.
<figure>
<iref item="metalinkSize grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkSize" primary="true"/>
<artwork type="rnc">
metalinkSize =
element metalink:size {
metalinkTextConstruct
}</artwork></figure></t>
</section>
<section anchor="element.type" title="The "metalink:type" Element">
<iref item="XML Elements" subitem="type" primary="true"/>
<iref item="type XML element" primary="true"/>
<t>The "<xref target="element.type" format="none">metalink:type</xref>" element is a Text construct that describes
whether the IRI from "<xref target="element.origin" format="none">metalink:origin</xref>" a Metalink will contain dynamic updated Metalinks or static content that is not updated.
<figure>
<iref item="metalinkType grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkType" primary="true"/>
<artwork type="rnc">
metalinkType =
element metalink:type {
"static" | "dynamic"
}</artwork></figure></t>
</section>
<section anchor="element.updated" title="The "metalink:updated" Element">
<iref item="XML Elements" subitem="updated" primary="true"/>
<iref item="updated XML element" primary="true"/>
<t>The "<xref target="element.updated" format="none">metalink:updated</xref>" element is a Date construct indicating the
most recent instant in time when a Metalink was modified in a
way the publisher considers significant. Therefore, not all
modifications necessarily result in a changed <xref target="element.updated" format="none">metalink:updated</xref>
value.
<figure>
<iref item="metalinkUpdated grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkUpdated" primary="true"/>
<artwork type="rnc">
metalinkUpdated =
element metalink:updated {
metalinkDateConstruct
}</artwork></figure></t>
<t>Publishers MAY change the value of this element over time.</t>
</section>
<section anchor="element.url" title="The "metalink:url" Element">
<iref item="XML Elements" subitem="url" primary="true"/>
<iref item="url XML element" primary="true"/>
<t>The "<xref target="element.url" format="none">metalink:url</xref>" element contains the IRI of a file. All IRIs MUST lead to identical files.
<figure>
<iref item="metalinkURL grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkURL" primary="true"/>
<artwork type="rnc">
metalinkURL =
element metalink:url {
metalinkCommonAttributes,
attribute location { xsd:string {
minLength = "2" maxLength="2"}
}?,
attribute preference { xsd:integer }?,
metalinkUri
}+</artwork></figure></t>
<section title="The "preference" Attribute">
<t><xref target="element.url" format="none">metalink:url</xref>
elements MAY have a preference attribute, whose value MUST be a number from 1 to 100
for priority, with 100 used first and 1 used last. Multiple <xref target="element.url" format="none">metalink:url</xref> elements can have the same
preference, i.e. ten mirrors could have preference="100". A Metalink Processor MAY download different segments of a file from more than one IRI simultaneously, and when doing so SHOULD first use the highest priority IRIs and then use lower ones.</t>
<t>When one or more <xref target="element.url" format="none">metalink:url</xref> elements have a preference attribute value of "100", other <xref target="element.url" format="none">metalink:url</xref> elements
SHOULD NOT be used, unless the elements with a preference of 100 cannot be processed (e.g. if
they are of a <xref target="element.metadata" format="none">metalink:metadata</xref> element type which is not supported by the Metalink Processor,
such as BitTorrent, or if the servers are unavailable).</t>
<t>Any <xref target="element.url" format="none">metalink:url</xref> elements with a preference attribute value of "1" SHOULD NOT be used unless all
other <xref target="element.url" format="none">metalink:url</xref> elements cannot be processed (e.g. if
they are of a <xref target="element.metadata" format="none">metalink:metadata</xref> element type which is not supported by the Metalink Processor,
such as BitTorrent, or if the servers are unavailable).</t>
</section>
<section title="The "location" Attribute">
<t><xref target="element.url" format="none">metalink:url</xref> elements MAY have a "location" attribute, which
is a <xref target="ISO3166"/> alpha-2 two letter country code for the geographical location of the physical server an IRI is used
to access.
</t>
</section>
</section>
<section anchor="element.version" title="The "metalink:version" Element">
<iref item="XML Elements" subitem="version" primary="true"/>
<iref item="version XML element" primary="true"/>
<t>The "<xref target="element.version" format="none">metalink:version</xref>" element is a Text construct that conveys a
human-readable version for a file. The version of OpenOffice.org 3.0 would be "3.0".
<figure>
<iref item="metalinkVersion grammar production" primary="true"/>
<iref item="Grammar" subitem="metalinkVersion" primary="true"/>
<artwork type="rnc">
metalinkVersion =
element metalink:version {
metalinkTextConstruct
}</artwork></figure></t>
</section>
</section>
</section>
<section title="Client Implementation Considerations">
<t>Metalink Processors that support HTTP MUST support transparent content negotiation with HTTP <xref target="RFC2295"/>. Transparent content negotiation is accomplished
by adding the Metalink media type to the Accept request header. Metalink Processors MUST check the returned content type, and if the Metalink media type is used, it MUST process the Metalink.
If the content type does not match the Metalink media type, then Metalink Processors SHOULD handle the response as a normal response. Metalink Processors MUST NOT add the Metalink media type to Accept when requesting
a URI from a <xref target="element.url" format="none">metalink:url</xref> element, thus avoiding loops. Metalink Processors SHOULD handle external redirects that might lead to a Metalink.</t>
<t>When multiple hash types methods are provided, a Metalink Processor MAY verify using more than one of these hash types. Metalink Processors are encouraged to check all hash types given which they are able to verify.</t>
</section>
<section title="Securing Metalink Documents">
<t>Because Metalink is an XML-based format, existing XML security
mechanisms can be used to secure its content.</t>
<t>Producers of Metalinks may have sound
reasons for signing
otherwise-unprotected content. For example, a merchant
might digitally sign a Metalink that lists a file download to verify its origin. Other merchants may wish to sign and encypt Metalinks that list digital songs that have been purchased. Of course,
many other examples exist as well.</t>
<t>The algorithm requirements in this section pertain to
the Metalink Processor. They require that a recipient, at a
minimum, be able to handle messages that use the specified
cryptographic algorithms. These requirements do not limit the
algorithms that the sender can choose.</t>
<t>Metalink Processors that verify signed Metalink Documents MUST at least support <xref target="REC-xmldsig-core">XML-Signature and
Syntax Processing</xref>.</t>
</section>
<section title="Extending Metalink" anchor="extending_metalink">
<section title="Extensions from Non-Metalink Vocabularies">
<t>This specification describes Metalink's XML markup
vocabulary. Markup from other vocabularies ("foreign markup")
can be used in an Metalink Document.</t>
</section>
<section title="Extensions to the Metalink Vocabulary" anchor="extensions.to.the.metalink.vocabulary">
<t>The Metalink namespace is reserved for future
forward-compatible revisions of Metalink. Future versions
of this specification could add new elements and
attributes to the Metalink markup vocabulary. Software
written to conform to this version of the specification
will not be able to process such markup correctly and,
in fact, will not be able to distinguish it from markup
error. For the purposes of this discussion, unrecognized
markup from the Metalink vocabulary will be considered
"foreign markup".</t>
</section>
<section title="Processing Foreign Markup" anchor="processing.foreign.markup">
<t>Metalink Processors that encounter foreign markup in a
location that is legal according to this specification
MUST NOT stop processing or signal an error. It might be
the case that the Metalink Processor is able to process the
foreign markup correctly and does so. Otherwise, such
markup is termed "unknown foreign markup".</t>
<t>When unknown foreign markup is encountered as a child of
<xref target="element.file" format="none">metalink:file</xref>, <xref target="element.metalink" format="none">metalink:metalink</xref>, Metalink Processors MAY
bypass the markup and any textual content and MUST NOT change
their behavior as a result of the markup's presence.</t>
<t>When unknown foreign markup is encountered in a Text
Construct, software SHOULD ignore
the markup and process any text content of foreign
elements as though the surrounding markup were not
present.</t>
</section>
<section title="Extension Elements" anchor="extension">
<t>Metalink allows foreign markup anywhere in an Metalink
document, except where it is explicitly forbidden.
Child elements of <xref target="element.file" format="none">metalink:file</xref> and <xref target="element.metalink" format="none">metalink:metalink</xref>
are considered Metadata elements and
are described below. Child elements of Person constructs
are considered to apply to the construct. The role of
other foreign markup is undefined by this
specification.</t>
<section title="Simple Extension Elements" anchor="simple.extension.elements">
<t>A Simple Extension element MUST NOT have any
attributes or child elements. The element MAY contain
character data or be empty. Simple Extension elements
are not Language-Sensitive.
<figure>
<iref item="simpleExtensionElement grammar production" primary="true"/>
<iref item="Grammar" subitem="simpleExtensionElement" primary="true"/>
<artwork type="rnc">
simpleExtensionElement =
element * - metalink:* {
text
}</artwork></figure></t>
<t>The element can be interpreted as a simple property (or
name/value pair) of the parent element that encloses it. The
pair consisting of the namespace-URI of the element and the
local name of the element can be interpreted as the name of
the property. The character data content of the element can
be interpreted as the value of the property. If the element
is empty, then the property value can be interpreted as an
empty string.</t>
</section>
<section title="Structured Extension Elements" anchor="structured.extension.elements">
<t>The root element of a Structured Extension element
MUST have at least one attribute or child element. It
MAY have attributes, it MAY contain well-formed XML
content (including character data), or it MAY be
empty. Structured Extension elements are
Language-Sensitive.
<figure>
<iref item="structuredExtensionElement grammar production" primary="true"/>
<iref item="Grammar" subitem="structuredExtensionElement" primary="true"/>
<artwork type="rnc">
structuredExtensionElement =
element * - metalink:* {
(attribute * { text }+,
(text|anyElement)*)
| (attribute * { text }*,
(text?, anyElement+, (text|anyElement)*))
}</artwork></figure></t>
<t>The structure of a Structured Extension element, including
the order of its child elements, could be significant.</t>
<t>This specification does not provide an interpretation of a
Structured Extension element. The syntax of the XML contained
in the element (and an interpretation of how the element
relates to its containing element) is defined by the
specification of the Metalink extension.</t>
</section>
</section>
</section>
<section title="IANA Considerations" anchor="IANA">
<section title="XML Namespace Registration">
<t>This document makes use of the XML registry specified in <xref target="RFC3688"/>. Accordingly, IANA has made the following registration:</t>
<t>Registration request for the Metalink namespace:</t>
<t>URI: urn:ietf:params:xml:ns:metalink</t>
<t>Registrant Contact: See the "Author's Address" section of this
document.</t>
<t>XML: None. Namespace URIs do not represent an XML specification.</t>
</section>
<section title="application/metalink+xml MIME type">
<iref item="Media Type" subitem="application/metalink+xml" primary="true"/>
<iref item="application/metalink+xml Media Type" primary="true"/>
<t>A Metalink Document, when serialized as XML 1.0, can be identified
with the following media type:</t>
<t>
<list style="hanging">
<t hangText="MIME media type name:"> application</t>
<t hangText="MIME subtype name:"> metalink+xml</t>
<t hangText="Mandatory parameters:"> None.</t>
<t hangText="Optional parameters:">
<list style="hanging">
<t hangText=""charset":"> This parameter has semantics identical
to the charset parameter of the
"application/xml" media type as specified in <xref target="RFC3023"/>.</t>
</list>
</t>
<t hangText="Encoding considerations:"> Identical to those of
"application/xml" as described in <xref target="RFC3023"/>, Section 3.2.</t>
<t hangText="Security considerations:"> As defined in this
specification.</t>
<t>In addition, as this media type uses the "+xml" convention,
it shares the same security considerations as described in
<xref target="RFC3023"/>, Section 10.</t>
<t hangText="Interoperability considerations:"> There are no
known interoperability issues.</t>
<t hangText="Published specification:"> This
specification.</t>
<t hangText="Applications that use this media type:"> No known
applications currently use this media type.</t>
</list>
</t>
<t>Additional information:</t>
<t>
<list style="hanging">
<t hangText="Magic number(s):"> As specified for
"application/xml" in <xref target="RFC3023"/>, Section 3.2.</t>
<t hangText="File extension:"> .metalink</t>
<t hangText="Fragment identifiers:"> As specified for
"application/xml" in <xref target="RFC3023"/>, Section 5.</t>
<t hangText="Base URI:"> As specified in <xref target="RFC3023"/>, Section 6.</t>
<t hangText="Macintosh File Type code:"> TEXT</t>
<t hangText="Person and email address to contact for further information:"> Anthony Bryan <anthonybryan@gmail.com></t>
<t hangText="Intended usage:">
COMMON</t> <t hangText="Author/Change controller:">IESG</t>
</list></t>
</section>
</section>
<section title="Security Considerations">
<t>Publishers are encouraged to offer Metalink documents via authenticated HTTP under TLS as specified in <xref target="RFC2818"/>. Publishers are also encouraged to include digital signatures of the files within the Metalink Documents if they are available.</t>
<section title="URIs and IRIs">
<t>Metalink Processors handle URIs and IRIs. See Section 7 of <xref target="RFC3986"/> and Section 8 of <xref target="RFC3987"/> for security
considerations related to their handling and use.</t>
</section>
<section title="Spoofing">
<t>Metalink Processors should be aware of the potential for
spoofing attacks where the attacker publishes Metalinks
with false information. Malicious publishers might create Metalink Documents containing inaccurate information anywhere in the document.
At best, this could deceive unaware downloaders that they are downloading a malicious or worthless file. At worst, malicious publishers could attempt a distributed denial of service attack by inserting unrelated IRIs into Metalink Documents.</t>
</section>
<section title="Cryptographic Hashes">
<t>Currently, some of the hash types defined in the IANA registry named "Hash Function Textual Names" are considered insecure. These include the whole Message Digest family of algorithms which are not suitable for cryptographically strong verification. Malicious people could provide files that appear to be identical to another file because of a collision, i.e. the weak cryptographic hashes match.</t>
<t>Metalink Generators and Processors supporting verification SHOULD at least implement
"sha-1" which is SHA1, as specified in <xref target="RFC3174"/>. </t>
</section>
<section title="Signing">
<t>Metalink Documents SHOULD be signed using <xref target="REC-xmldsig-core"/> and are
subject to the security considerations implied by its
use. This addresses the issue of spoofing.</t>
<t>Digital signatures provide authentication, message
integrity, and non-repudiation with proof of
origin.</t>
</section>
</section>
</middle>
<back>
<references title="Normative References">
<reference anchor="BITTORRENT" target="http://www.bittorrent.org/beps/bep_0003.html">
<front>
<title>The BitTorrent Protocol Specification</title>
<author initials="B" surname="Cohen" fullname="Bram Cohen">
<organization/>
</author>
<date month="February" day="28" year="2008"/>
</front>
<seriesInfo name="BITTORRENT" value="11031"/>
</reference>
<reference anchor="RFC2119">
<front>
<title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner">
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>sob@harvard.edu</email></address></author>
<date year="1997" month="March"/>
<area>General</area>
<keyword>keyword</keyword>
<abstract>
<t>
In many standards track documents several words are used to signify
the requirements in the specification. These words are often
capitalized. This document defines these words as they should be
interpreted in IETF documents. Authors who follow these guidelines
should incorporate this phrase near the beginning of their document:
<list>
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
RFC 2119.
</t></list></t>
<t>
Note that the force of these words is modified by the requirement
level of the document in which they are used.
</t></abstract></front>
<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
</reference>
<reference anchor="RFC2295">
<front>
<title>Transparent Content Negotiation in HTTP</title>
<author initials="K." surname="Holtman" fullname="K. Holtman">
<organization/></author>
<author initials="A." surname="Mutz" fullname="A. Mutz">
<organization/></author>
<date year="1998" month="March"/></front>
<seriesInfo name="RFC" value="2295"/>
</reference>
<reference anchor="RFC2818">
<front>
<title>HTTP Over TLS</title>
<author fullname="E. Rescorla" surname="Rescorla" initials="E.">
<organization></organization></author>
<date month="May" year="2000"></date>
</front>
<seriesInfo name="RFC" value="2818"></seriesInfo>
</reference>
<reference anchor="RFC3023">
<front>
<title>XML Media Types</title>
<author initials="M." surname="Murata" fullname="M. Murata">
<organization/></author>
<author initials="S." surname="St. Laurent" fullname="S. St. Laurent">
<organization/></author>
<author initials="D." surname="Kohn" fullname="D. Kohn">
<organization/></author>
<date year="2001" month="January"/>
<abstract>
<t>This document standardizes five new media types -- text/xml, application/xml, text/xml-external-parsed-entity, application/xml-external-parsed-entity, and application/xml-dtd -- for use in exchanging network entities that are related to the Extensible Markup Language (XML). This document also standardizes a convention (using the suffix '+xml') for naming media types outside of these five types when those media types represent XML MIME (Multipurpose Internet Mail Extensions) entities.</t></abstract></front>
<seriesInfo name="RFC" value="3023"/>
</reference>
<reference anchor="RFC3174">
<front>
<title>US Secure Hash Algorithm 1 (SHA1)</title>
<author initials="D." surname="Eastlake" fullname="D. Eastlake">
<organization/></author>
<author initials="P." surname="Jones" fullname="P. Jones">
<organization/></author>
<date year="2001" month="September"/></front>
<seriesInfo name="RFC" value="3174"/>
</reference>
<reference anchor="RFC3339">
<front>
<title>Date and Time on the Internet: Timestamps</title>
<author initials="G." surname="Klyne" fullname="G. Klyne">
<organization/></author>
<author initials="C." surname="Newman" fullname="C. Newman">
<organization/></author>
<date year="2002" month="July"/>
<abstract>
<t>This document defines a date and time format for use in Internet protocols that is a profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.</t></abstract></front>
<seriesInfo name="RFC" value="3339"/>
</reference>
<reference anchor="RFC3688">
<front>
<title>The IETF XML Registry</title>
<author initials="M." surname="Mealling" fullname="M. Mealling">
<organization/></author>
<date year="2004" month="January"/></front>
<seriesInfo name="BCP" value="81"/>
<seriesInfo name="RFC" value="3688"/>
</reference>
<reference anchor="RFC3986">
<front>
<title>Uniform Resource Identifier (URI): Generic Syntax</title>
<author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
<organization/></author>
<author initials="R." surname="Fielding" fullname="R. Fielding">
<organization/></author>
<author initials="L." surname="Masinter" fullname="L. Masinter">
<organization/></author>
<date year="2005" month="January"/></front>
<seriesInfo name="STD" value="66"/>
<seriesInfo name="RFC" value="3986"/>
</reference>
<reference anchor="RFC3987">
<front>
<title>Internationalized Resource Identifiers (IRIs)</title>
<author initials="M." surname="Duerst" fullname="M. Duerst">
<organization/></author>
<author initials="M." surname="Suignard" fullname="M. Suignard">
<organization/></author>
<date year="2005" month="January"/></front>
<seriesInfo name="RFC" value="3987"/>
</reference>
<reference anchor="REC-xml-infoset" target="http://www.w3.org/TR/2004/REC-xml-infoset-20040204">
<front>
<title>XML Information Set (Second Edition)</title>
<author fullname="John Cowan" surname="Cowan" initials="J.">
<organization></organization>
</author>
<author fullname="Richard Tobin" surname="Tobin" initials="R.">
<organization></organization>
</author>
<date year="2004" day="4" month="February"></date>
</front>
<seriesInfo name="World Wide Web Consortium Recommendation" value="REC-xml-infoset-20040204"></seriesInfo>
</reference>
<reference anchor="REC-xmlbase" target="http://www.w3.org/TR/2001/REC-xmlbase-20010627">
<front>
<title>XML Base</title>
<author fullname="J. Marsh" surname="Marsh" initials="J">
<organization></organization>
</author>
<date year="2001" day="27" month="June"></date>
</front>
<seriesInfo name="W3C REC" value="W3C.REC-xmlbase-20010627"></seriesInfo>
</reference>
<reference anchor="REC-xml-names" target="http://www.w3.org/TR/2006/REC-xml-names-20060816">
<front>
<title>Namespaces in XML 1.0 (Second Edition)</title>
<author fullname="Dave Hollander" surname="Hollander" initials="D.">
<organization></organization>
</author>
<author fullname="Tim Bray" surname="Bray" initials="T.">
<organization></organization>
</author>
<author fullname="Richard Tobin" surname="Tobin" initials="R.">
<organization></organization>
</author>
<author fullname="Andrew Layman" surname="Layman" initials="A.">
<organization></organization>
</author>
<date year="2006" day="16" month="August"></date>
</front>
<seriesInfo name="World Wide Web Consortium Recommendation" value="REC-xml-names-20060816"></seriesInfo>
</reference>
<reference anchor="REC-xml" target="http://www.w3.org/TR/2006/REC-xml-20060816">
<front>
<title>Extensible Markup Language (XML) 1.0 (Fourth Edition)</title>
<author fullname="Francois Yergeau" surname="Yergeau" initials="F.">
<organization></organization>
</author>
<author fullname="Jean Paoli" surname="Paoli" initials="J.">
<organization></organization>
</author>
<author fullname="Tim Bray" surname="Bray" initials="T.">
<organization></organization>
</author>
<author fullname="C. M. Sperberg-McQueen" surname="Sperberg-McQueen" initials="C.">
<organization></organization>
</author>
<author fullname="Eve Maler" surname="Maler" initials="E.">
<organization></organization>
</author>
<date year="2006" day="16" month="August"></date>
</front>
<seriesInfo name="World Wide Web Consortium Recommendation" value="REC-xml-20060816"></seriesInfo>
</reference>
<reference anchor="REC-xmldsig-core" target="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212">
<front>
<title>XML-Signature Syntax and Processing</title>
<author fullname="David Solo" surname="Solo" initials="D.">
<organization></organization>
</author>
<author fullname="Joseph Reagle" surname="Reagle" initials="J.">
<organization></organization>
</author>
<author fullname="Donald Eastlake" surname="Eastlake" initials="D.">
<organization></organization>
</author>
<date year="2002" day="12" month="February"></date>
</front>
<seriesInfo name="World Wide Web Consortium Recommendation" value="REC-xmldsig-core-20020212"></seriesInfo>
</reference>
<reference anchor="ISO639-2">
<front>
<title>ISO 639-2:1998 - Codes for the representation of names of languages -- Part 2: Alpha-3 code - edition 1, 1998-11-01, 66 pages, prepared by a Joint Working Group of ISO TC46/SC4 and ISO TC37/SC2.</title>
<author>
<organization>International Organization for Standardization</organization>
</author>
<date year="1998"/>
</front>
<seriesInfo name="ISO" value="Standard 639-2"/>
</reference>
<reference anchor="ISO3166">
<front>
<title>ISO 3166:1988 (E/F) - Codes for the representation of names of countries - The International Organization for Standardization, 3rd edition, 1988-08-15.</title>
<author>
<organization>International Organization for Standardization</organization>
</author>
<date year="1988"/></front>
<seriesInfo name="ISO" value="Standard 3166"/>
</reference>
</references>
<references title="Informative References">
<reference anchor="ISO.8601.1988">
<front>
<title>Data elements and interchange formats - Information interchange - Representation of dates and times</title>
<author>
<organization>International Organization for Standardization</organization>
</author>
<date month="June" year="1988"/>
</front>
<seriesInfo name="ISO" value="Standard 8601"/>
</reference>
<reference anchor="W3C.REC-xmlschema-2-20041028" target="http://www.w3.org/TR/2004/REC-xmlschema-2-20041028">
<front>
<title>XML Schema Part 2: Datatypes Second Edition</title>
<author initials="A" surname="Malhotra" fullname="Ashok Malhotra">
<organization/>
</author>
<author initials="P" surname="Biron" fullname="Paul V. Biron">
<organization/>
</author>
<date month="October" day="28" year="2004"/>
</front>
<seriesInfo name="W3C REC" value="REC-xmlschema-2-20041028"/>
</reference>
<reference anchor="W3C.NOTE-datetime-19980827" target="http://www.w3.org/TR/1998/NOTE-datetime-19980827">
<front>
<title>Date and Time Formats</title>
<author initials="M" surname="Wolf" fullname="Misha Wolf">
<organization/>
</author>
<author initials="C" surname="Wicksteed" fullname="Charles Wicksteed">
<organization/>
</author>
<date month="August" day="27" year="1998"/>
</front>
<seriesInfo name="W3C NOTE" value="NOTE-datetime-19980827"/>
</reference>
<reference anchor="RELAX-NG" target="http://www.oasis-open.org/committees/relax-ng/compact-20021121.html">
<front>
<title>RELAX NG Compact Syntax</title>
<author initials="J" surname="Clark" fullname="James Clark">
<organization>OASIS Technical Committee: RELAX NG</organization>
</author>
<date year="2001" month="December" day="03"/>
</front>
</reference>
<reference anchor="RFC4287">
<front>
<title>The Atom Syndication Format</title>
<author fullname="M. Nottingham" surname="Nottingham" initials="M.">
<organization></organization></author>
<author fullname="R. Sayre" surname="Sayre" initials="R.">
<organization></organization></author>
<date month="December" year="2005"></date></front>
<seriesInfo name="RFC" value="4287"></seriesInfo>
</reference>
</references>
<section title="Contributors">
<t>The layout and content of this document relies heavily on work pioneered in the Atom Syndication Format as specified in <xref target="RFC4287"/>.</t>
<t>The following people contributed to preliminary
versions of this document: Paul Burkhead, Kristian Weston, Darius Liktorius, Michael Burford,
Giorgio Maone, Manuel Subredu, Tatsuhiro
Tsujikawa, A. Bram Neijt, Max Velasques, Manolo Valdes, Urs Wolfer,
Frederick Cheung, Nils Maier, Hampus Wessman, Neil McNab, Hayden
Legendre, Danny Ayers, Nick Dominguez, Rene Leonhardt, Per Oyvind Karlsen, Gary Zellerbach, James Clark, Daniel
Stenberg, Peter Poeml, Matt Domsch, Chris Newman, Lisa Dusseault, Ian Macfarlane, Dave Cridland, Julian Reschke, Barry Leiba, Uri Blumenthal, and Paul Hoffman. The content and concepts within are a product of the Metalink
community.</t>
<t>The Metalink community has dozens of contributors who proposed ideas and wording for this
document, or contributed to the evolution of Metalink, including:</t>
<t>Nicolas Alvarez, Patrick Ruckstuhl, Mike Wells, Sebastien Willemijns, Micah Cowan, Dan Fandrich, Francis Giannaros, Yazsoft, Lukas Appelhans, KGet developers, FDM Team, Orbit Team, Arne Babenhauserheide, Mathias Berchtold,
Xienzhenyu and TheWorld Browser Team, Xi Software, Bridget and Ethan Fletcher, Ruben Kerkhof, Agostino Russo,
Gervase Markham, Salvatore and Robin Musumeci, Steve and Rachel Eshelman,
Lucas Hewett, Ryan and Darren Cronin, Dave Winquist, Bob Denison,
Wes Shelton, Kees Cook, Josh Colbert, Steve Kleisath, Chad Neptune, Nick Carrabba, Chris
Carrabba, Erin Solari, Derick Cordoba, Ryan Alexander, John Sowder, Sandra Amisano,
Tom Mainville, Janie Wargo, Jason Hansen, Tim Bray, Dan Brickley, Markus Hofmann,
Dan Connolly, Tim Berners-Lee, Harry Chen, Adrien Macneil, Louis Suarez-Potts, Ross Smith, Rahul
Sundaram, Jesse Keating, Michal Bentkowski, Andrew Pantyukhin, Judd Vinet, Charles
Landemaine, Pascal Bleser, Jeff@BLAG, Yuichiro Nakada, Jereme
Hancock, Marcel Hauser, Jeff Covey, Doug Lang, Seth Brown,
Alexander Lazic, Mayank Sharma, Robin Heggelund Hansen, Steve Langasek, Federico
Parodi, Stefano Verna, Jason Green, James Linden,
Matt Nederlanden, Aren Olsen, Dag Odenhall, Troy
Sobotka, Corey Farwell, Ed Lee, Shawn Wilsher, Mike Connor, Anand Muttagi, Dedric Carter, Debi
Goulding, the Anthony Family, the Bryan Family, Juanita Anthony and Zimmy Bryan.</t>
</section>
<section title="RELAX NG Compact Schema" anchor="schema">
<t>This appendix is informative.</t>
<t>The Relax NG schema explicitly excludes elements in
the Metalink namespace that are not defined in this
revision of the specification. Requirements for Metalink
Processors encountering such markup are given in Sections
<xref target="extensions.to.the.metalink.vocabulary" format="counter"/> and <xref target="processing.foreign.markup" format="counter"/>.
</t>
<figure>
<artwork type="rnc">
# -*- rnc -*-
# RELAX NG Compact Syntax Grammar for the
# Metalink Format Specification Version 2
namespace metalink = "urn:ietf:params:xml:ns:metalink"
namespace xsd = "http://www.w3.org/2001/XMLSchema"
# Common attributes
metalinkCommonAttributes =
attribute xml:base { metalinkUri }?,
attribute xml:lang { metalinkLanguageTag }?,
undefinedAttribute*
# Text Constructs
metalinkTextConstruct =
metalinkCommonAttributes,
text
# Date Construct
metalinkDateConstruct =
metalinkCommonAttributes,
xsd:dateTime
start =
element metalink:metalink {
element metalink:generator {
attribute uri { metalinkUri }?,
attribute version { text }?,
metalinkTextConstruct
}
element metalink:origin { metalinkUri }?,
element metalink:type { "static" | "dynamic" }?,
element metalink:published { metalinkDateConstruct }?,
element metalink:updated { metalinkDateConstruct }?,
element metalink:files {
element metalink:file {
attribute name { metalinkTextConstruct },
element metalink:identity { metalinkTextConstruct }?,
element metalink:version { metalinkTextConstruct }?,
element metalink:size { xsd:integer }?,
element metalink:description { metalinkTextConstruct }?,
element metalink:license {
attribute uri { metalinkUri }?,
attribute name { metalinkTextConstruct }?,
}?,
element metalink:logo { metalinkUri }?,
element metalink:publisher {
attribute uri { metalinkUri }?,
attribute name { metalinkTextConstruct }?,
}?,
element metalink:language { metalinkTextConstruct }?,
element metalink:copyright { metalinkTextConstruct }?,
element metalink:license { metalinkTextConstruct }?,
element metalink:os { metalinkTextConstruct }?,
element metalink:verification {
hash+,
element metalink:pieces {
attribute length { metalinkTextConstruct },
attribute type { metalinkTextConstruct },
hash+
}+,
element metalink:signature {
attribute type { "pgp" },
text
}+
}?,
element metalink:resources {
element metalink:metadata {
attribute preference { xsd:integer }?,
attribute type { metalinkTextConstruct },
metalinkUri
element metalink:url {
attribute location { xsd:string {
minLength = "2" maxLength="2"}
}?,
attribute preference { xsd:integer }?,
metalinkUri
}+
}
}+
}
}
hash =
element metalink:hash {
attribute piece { metalinkTextConstruct }?,
attribute type { metalinkTextConstruct },
text
}
# As defined in RFC 3066
metalinkLanguageTag = xsd:string {
pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*"
}
# Unconstrained; it's not entirely clear how IRI fit into
# xsd:anyURI so let's not try to constrain it here
metalinkUri = text
# Simple Extension
simpleExtensionElement =
element * - metalink:* {
text
}
# Structured Extension
structuredExtensionElement =
element * - metalink:* {
(attribute * { text }+,
(text|anyElement)*)
| (attribute * { text }*,
(text?, anyElement+, (text|anyElement)*))
}
# Other Extensibility
extensionElement =
simpleExtensionElement | structuredExtensionElement
undefinedAttribute =
attribute * - (xml:base | xml:lang | local:*) { text }
undefinedContent = (text|anyForeignElement)*
anyElement =
element * {
(attribute * { text }
| text
| anyElement)*
}
anyForeignElement =
element * - metalink:* {
(attribute * { text }
| text
| anyElement)*
}
# EOF</artwork>
</figure>
</section>
</back>
</rfc>| PAFTECH AB 2003-2026 | 2026-04-23 19:53:06 |