Contents
This section is normative.
The Metainformation Module defines elements that allow the definition of relationships. These may relate to:
Note that this module is dependent upon the Metainformation Attributes module. The interpretation of those attributes in conjunction with any elements, including the ones defined in this module, are spelled out in [RDFASYNTAX].
Elements and attributes in this module are:
Elements | Attributes | Content Model |
---|---|---|
link | Common | ( link | meta )* |
meta | Common | ( PCDATA | Text )* |
Implementation: RELAX NG
Attributes
This element defines a link. Link conveys relationship information that may be rendered by user agents in a variety of ways (e.g., a tool-bar with a drop-down menu of links). User agents should enable activation of links and the retrieval of link targets. Since link elements may have no content, information from the rel and title attributes should be used when labelling links.
This example illustrates how several link definitions may appear in the head section of a document. The current document is "Chapter2.html". The rel attribute specifies the relationship of the linked document with the current document. The values "Index", "Next", and "Prev" are explained in the section on the attribute rel.
<head> <title>Chapter 2</title> <link rel="index" href="../index.html"/> <link rel="next" href="Chapter3.html"/> <link rel="prev" href="Chapter1.html"/> </head>
While the rel attribute specifies a relationship from this document to another resource, the rev attribute specifies the reverse relationship.
Consider two documents A and B.
Document A: <link href="docB" rel="index"/>
Has exactly the same meaning as:
Document B: <link href="docA" rev="index"/>
namely that document B is the index for document A.
Both the rel and rev attributes may be specified simultaneously.
Authors may use the link element to provide a variety of information to search engines, including:
The examples below illustrate how language information, media types, and link types may be combined to improve document handling by search engines.
The following example shows how to use the hreflang attribute to indicate to a search engine where to find other language versions of a document. Note that for the sake of the example the xml:lang attribute has been used to indicate that the value of the title attribute for the link element designating the French manual is in French.
<html ... xml:lang="en"> <head> <title>The manual in English</title> <link title="The manual in Dutch" rel="alternate" hreflang="nl" href="http://example.com/manual/dutch.html"/> <link title="La documentation en Français" rel="alternate" hreflang="fr" xml:lang="fr" href="http://example.com/manual/french.html"/> </head>
In the following example, we tell search engines where to find the printed version of a manual.
<head> <title>Reference manual</title> <link media="print" title="The manual in PostScript" hreftype="application/postscript" rel="alternate" href="http://example.com/manual/postscript.ps"/> </head>
In the following example, we tell search engines where to find the front page of a collection of documents.
<head> <title>Reference manual -- Chapter 5</title> <link rel="start" title="The first chapter of the manual" hreftype="application/xhtml+xml" href="http://example.com/manual/start.html"/> </head>
Attributes
The meta element can be used to identify properties of a document (e.g., author, expiration date, a list of key words, etc.) and assign values to those properties. This specification defines a small normative set of properties, but users may extend this set as described for the property attribute.
Each meta element specifies a property/value pair. The property attribute identifies the property and the content of the element or the value of the content attribute specifies the property's value.
For example, the following declaration sets a value for the Author
property:
Example
<meta property="dc:creator">Steven Pemberton</meta>
Note. The meta element is a generic mechanism for specifying metadata. However, some XHTML elements and attributes already handle certain pieces of metadata and may be used by authors instead of meta to specify those pieces: the title element, the address element, the edit and related attributes, the title attribute, and the cite attribute.
Note. When a property specified by a meta element takes a value that is a URI, some authors prefer to specify the metadata via the link element. Thus, the following metadata declaration:
Example
<meta property="dc:identifier"> http://www.rfc-editor.org/rfc/rfc3236.txt </meta>
might also be written:
Example
<link rel="dc:identifier" href="http://www.rfc-editor.org/rfc/rfc3236.txt" />
A common use for meta is to specify keywords that a search engine may use to improve the quality of search results. When several meta elements provide language-dependent information about a document, search engines may filter on the xml:lang attribute to display search results using the language preferences of the user. For example,
Example
<!-- For speakers of US English --> <meta property="keywords" xml:lang="en-us">vacation, Greece, sunshine</meta> <!-- For speakers of British English --> <meta property="keywords" xml:lang="en">holiday, Greece, sunshine</meta> <!-- For speakers of French --> <meta property="keywords" xml:lang="fr">vacances, Grèce, soleil</meta>
The effectiveness of search engines can also be increased by using the link element to specify links to translations of the document in other languages, links to versions of the document in other media (e.g., PDF), and, when the document is part of a collection, links to an appropriate starting point for browsing the collection.
rebuild link element: chapter, section / subsection
PR #7869
State: Open
Resolution: None
User: None
Notes: