Skip to content
Permalink
Browse files
[a] (0) Define rel=alternate for feeds as something conforming.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=9051

git-svn-id: http://svn.whatwg.org/webapps@4964 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 4, 2010
1 parent 5d8140f commit 78fd82738f1e4103f3c7f6dad40ff28473b0966c
Showing with 248 additions and 205 deletions.
  1. +77 −65 complete.html
  2. +77 −65 index
  3. +94 −75 source

<p>The <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword may be
used with <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
elements. For <code><a href=#the-link-element>link</a></code> elements, if the <code title=attr-link-rel><a href=#attr-link-rel>rel</a></code> attribute does not also contain the
keyword <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code>, it creates a
<a href=#hyperlink-link title="hyperlink link">hyperlink</a>; but if it
<em>does</em> also contain the keyword <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code>, the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword instead modifies the
meaning of the <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code>
keyword in the way described for that keyword, and the rest of this
subsection doesn't apply.</p>

<p>The <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword
indicates that the referenced document is an alternate
representation of the current document.</p>

<p>The nature of the referenced document is given by the <code title=attr-hyperlink-media><a href=#attr-hyperlink-media>media</a></code>, <code title=attr-hyperlink-hreflang><a href=#attr-hyperlink-hreflang>hreflang</a></code>, and <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code> attributes.</p>

<p>If the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword is
used with the <code title=attr-hyperlink-media><a href=#attr-hyperlink-media>media</a></code>
attribute, it indicates that the referenced document is intended for
use with the media specified.</p>
elements.</p>

<p>If the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword is
used with the <code title=attr-hyperlink-hreflang><a href=#attr-hyperlink-hreflang>hreflang</a></code>
attribute, and that attribute's value differs from the <a href=#root-element>root
element</a>'s <a href=#language>language</a>, it indicates that the
referenced document is a translation.</p>
<p>The meaning of this keyword depends on the values of the other
attributes.</p>

<p>If the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword is
used with the <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code>
attribute, it indicates that the referenced document is a
reformulation of the current document in the specified format.</p>
<dl class=switch><dt>If the element is a <code><a href=#the-link-element>link</a></code> element and the <code title=attr-link-rel><a href=#attr-link-rel>rel</a></code> attribute also contains the
keyword <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code></dt>

<p>The <code title=attr-hyperlink-media><a href=#attr-hyperlink-media>media</a></code>, <code title=attr-hyperlink-hreflang><a href=#attr-hyperlink-hreflang>hreflang</a></code>, and <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code> attributes can be combined
when specified with the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code>
keyword.</p>
<dd>

<div class=example>
<p>The <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword
modifies the meaning of the <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code> keyword in the way
described for that keyword. The <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword does not create a
link of its own.</p>

<p>For example, the following link is a French translation that
uses the PDF format:</p>
</dd>

<pre>&lt;link rel=alternate type=application/pdf hreflang=fr href=manual-fr&gt;</pre>

</div>
<dt>The <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword is
used with the <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code>
attribute set to the value <code title="">application/rss+xml</code> or the value <code title="">application/atom+xml</code></dt>

<div class=impl>
<dd>

<p>If the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword is
used with the <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code>
attribute set to the value <code title="">application/rss+xml</code>
or the value <code title="">application/atom+xml</code>, then it
indicates that the referenced document is a syndication feed (though
not necessarily syndicating exactly the same content as the current
page).</p>
<p>The link is a <a href=#hyperlink-link title="hyperlink link">hyperlink</a>
referencing a syndication feed (though not necessarily syndicating
exactly the same content as the current page).</p>

<div class=impl>
<div class=impl>

<p>The first <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, or <code><a href=#the-area-element>area</a></code>
element in the document (in tree order) with the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword used with the <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code> attribute set to the value
<code title="">application/rss+xml</code> or the value <code title="">application/atom+xml</code> must be treated as the default
syndication feed for the purposes of feed autodiscovery.</p>
<p>The first <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, or <code><a href=#the-area-element>area</a></code>
element in the document (in tree order) with the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword used with the <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code> attribute set to the value
<code title="">application/rss+xml</code> or the value <code title="">application/atom+xml</code> must be treated as the default
syndication feed for the purposes of feed autodiscovery.</p>

<div class=example>
<p>The following <code><a href=#the-link-element>link</a></code> element gives the syndication
feed for the current page:</p>
<pre>&lt;link rel="alternate" type="application/atom+xml" href="data.xml"&gt;</pre>
<p>The following extract offers various different syndication
feeds:</p>
<pre>&lt;p&gt;You can access the planets database using Atom feeds:&lt;/p&gt;
<div class=example>
<p>The following <code><a href=#the-link-element>link</a></code> element gives the syndication
feed for the current page:</p>
<pre>&lt;link rel="alternate" type="application/atom+xml" href="data.xml"&gt;</pre>
<p>The following extract offers various different syndication
feeds:</p>
<pre>&lt;p&gt;You can access the planets database using Atom feeds:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="recently-visited-planets.xml" rel="alternate" type="application/atom+xml"&gt;Recently Visited Planets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="known-bad-planets.xml" rel="alternate" type="application/atom+xml"&gt;Known Bad Planets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="unexplored-planets.xml" rel="alternate" type="application/atom+xml"&gt;Unexplored Planets&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
</div>
</div>

</div>
</div>

</dd>


<dt>Otherwise</dt>

</div>
<dd>

<p>The link is a <a href=#hyperlink-link title="hyperlink link">hyperlink</a>
referencing an alternate representation of the current
document.</p>

<p>The nature of the referenced document is given by the <code title=attr-hyperlink-media><a href=#attr-hyperlink-media>media</a></code>, <code title=attr-hyperlink-hreflang><a href=#attr-hyperlink-hreflang>hreflang</a></code>, and <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code> attributes.</p>

<p>If the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword is
used with the <code title=attr-hyperlink-media><a href=#attr-hyperlink-media>media</a></code>
attribute, it indicates that the referenced document is intended for
use with the media specified.</p>

<p>The <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> link
relationship is transitive &mdash; that is, if a document links to
two other documents with the link type "<code title=rel-alternate><a href=#link-type-alternate>alternate</a></code>", then, in addition to
implying that those documents are alternative representations of the
first document, it is also implying that those two documents are
alternative representations of each other.</p>
<p>If the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword is
used with the <code title=attr-hyperlink-hreflang><a href=#attr-hyperlink-hreflang>hreflang</a></code>
attribute, and that attribute's value differs from the <a href=#root-element>root
element</a>'s <a href=#language>language</a>, it indicates that the
referenced document is a translation.</p>

<p>If the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword is
used with the <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code>
attribute, it indicates that the referenced document is a
reformulation of the current document in the specified format.</p>

<p>The <code title=attr-hyperlink-media><a href=#attr-hyperlink-media>media</a></code>, <code title=attr-hyperlink-hreflang><a href=#attr-hyperlink-hreflang>hreflang</a></code>, and <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>type</a></code> attributes can be combined
when specified with the <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code>
keyword.</p>

<div class=example>

<p>For example, the following link is a French translation that
uses the PDF format:</p>

<pre>&lt;link rel=alternate type=application/pdf hreflang=fr href=manual-fr&gt;</pre>

</div>

<p>This relationship is transitive &mdash; that is, if a document
links to two other documents with the link type "<code title=rel-alternate><a href=#link-type-alternate>alternate</a></code>", then, in addition to
implying that those documents are alternative representations of
the first document, it is also implying that those two documents
are alternative representations of each other.</p>

</dd>

<h5 id=link-type-archives><span class=secno>4.12.3.2 </span>Link type "<dfn title=rel-archives><code>archives</code></dfn>"</h5>
</dl><h5 id=link-type-archives><span class=secno>4.12.3.2 </span>Link type "<dfn title=rel-archives><code>archives</code></dfn>"</h5>

<p>The <code title=rel-archives><a href=#link-type-archives>archives</a></code> keyword may be
used with <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>

0 comments on commit 78fd827

Please sign in to comment.