UserPreferences

LinkElement


<link> (deprecated)


<link> (new version)

Expresses a relationship between an Atom entity and another resource.

Structure

<!ELEMENT link EMPTY>
<!ATTLIST link
    rel (#PCDATA) #REQUIRED
    href (#PCDATA) #REQUIRED
    type (#PCDATA)
    title CDATA>

(eg <link rel="alternate" href="http://www.example.org/blog/entry1" [type="text/html"] [title="This entry's webpage"']>)

Summary

Description

The LinkElement is used to express a relationship between a resource identified in an Atom feed and another "external" resource. The Atom resource is normally that associated with the parent of the link element (the link element may also be used to associate a schema name with a namespace, see below). The other resource is identified in the href attribute of the link element. The rel attribute defines the relationship between the two resources.

Relationship Values

The meaning of the rel attribute is determined in one of two ways. For terms defined in the Atom specification, the term may be used directly in the attribute, e.g.

   <link rel="inResponseTo"       type="application/x.atom+xml"       href="http://example.org/post123" />

The core terms are described at LinkTagMeaning For terms defined outside Atom, additional namespace-based qualification must be used.

Explicit Namespace

This method of defining the relationship uses a technique derived from that described in RFC 2731 (Encoding Dublin Core Metadata in HTML) . First an external schema is identified and its namespace identified with a schema name. This only needs to be done once per feed:

<feed>

...

Subsequently the schema may be referred to in individual link entries:

<entry>

...

(The # suffixed to the image.jpg url prevents this wiki from automagically displaying the image inline)

Implicit Namespace (Atom Core)

Much of the time the relationship schema used will be that defined in the Atom specification. To simplify the use of this a shorthand can be used. If there is no schema explicitly associated with the content of a rel attribute (using the method described above) then the value of the rel attribute is taken to refer to a term in the Atom namespace.

So this:

<feed> ...

<entry>

...

is equivalent to, and will be used in preference to:

<feed>

...

<entry>

The core terms are described at LinkTagMeaning


LinkElementDiscussion

CategoryElementSpec