Contents
This section is normative.
The Metainformation Attributes Module defines the Metainformation attribute collection. This collection allows elements to be annotated with metadata throughout an XHTML-family document.
If this attribute is not present then the resource being referred to by a property attribute on the same element is decided as follows:
xhtml2:reference
.<link resource="top.html" rel="contents"/>This example defines a link to a table of contents for the current document.
<link resource="doc.ps" rel="alternate" media="print" restype="text/postscript">This example defines a link to an alternate version of the document especially suited to printing.
Authors may use the following relationship names, listed here with their conventional interpretations.
User agents, search engines, etc. may interpret these relationships in a variety of ways. For example, user agents may provide access to linked documents through a navigation bar.
Users may extend this collection of relationships. However, extensions must be defined in their own namespace, and the relationship names must be referenced in documents as qualified names (e.g., dc:creator for the Dublin Core "creator" relationship).
How are relationship namespaces identified?
We need to codify the mechanism for mapping prefixes to namespaces for meta data profiles.hreflang
attribute, it implies a translated version of the document. When used together with the
media
attribute, it implies a version designed for a different medium (or media).Refers to a document that defines relationships or provides metadata, for instance in RDF, about the document. User agents may use this URI in two ways:
This example refers to a hypothetical profile that defines useful properties for document indexing. The properties defined by this profile -- including "author", "copyright", "keywords", and "date" -- have their values set by subsequent meta declarations.
<html ... xmlns:mp="http://www.example.com/profiles/rels"> <head> <title>How to complete Memorandum cover sheets</title> <link rel="profile" resource="http://www.example.com/profiles/rels" /> <meta property="mp:author">John Doe</meta> <meta property="mp:copyright">© 2004 Example Corp.</meta> <meta property="mp:keywords">corporate,guidelines,cataloging</meta> <meta property="mp:date">1994-11-06T08:49:37+00:00</meta> </head> ...
The <a href="ReadMoreOnPM.htm" resource="http://example.org/blair">Prime Minister</a> said ...
This attribute specifies the allowable content types of the relevant resource URI. At its most general, it is a comma-separated list of media ranges with optional accept parameters, as defined in section 14.1 of [RFC2616] as the field value of the accept request header.
In its simplest case, this is just a media type, such as "image/png" or "application/xml", but it may also contain asterisks, such as "image/*" or "*/*", or lists of acceptable media types, such as "image/png, image/gif, image/jpeg".
The user agent must combine this list it with its own list of acceptable media types by taking the intersection, and then use the resulting list as the field value of the accept
request header when requesting the resource using HTTP.
For instance, if the attribute specifies the value "image/png, image/gif, image/jpeg", but the user agent does not accept images of type "image/gif" then the resultant accept header would contain "image/png, image/jpeg".
A user agent should imitate similar behavior when using other methods than HTTP. For instance, when accessing files in a local filestore, <p src="logo" type="image/png,
image/jpeg">
might cause the user agent first to look for a file logo.png
, and then for logo.jpg
.
If this attribute is not present, "*/*" is used for its value.
For the current list of registered content types, please consult [MIMETYPES].
<link resource="http://www.example.com/styles/mystyles.css" rel="stylesheet" restype="text/css" >
Implementation: RELAX NG
One use of the metadata attributes is with elements that play a presentational role, since the same string literal can be used to specify both document content, and metadata.
For example, articles often have the following repetitive structure, where the same values are used for metadata properties and actual content rendered to the reader:
<html xmlns:dc="http://purl.org/dc/elements/1.1/"> <head> <meta property="dc:date">March 23, 2004</meta> <meta property="dc:title">High-tech rollers hit casino for £1.3m</meta> <meta property="dc:creator">Steve Bird</meta> </head> <body> <span class="date">March 23, 2004</span> <span class="headline">High-tech rollers hit casino for £1.3m</span> <span class="byline">By Steve Bird</span> <span class="standfirst"> Word of a hand-held device which can beat the roulette wheel has gambling bosses quaking </span> <p>...</p> </body> </html>
By making use of the meta attributes this can be shortened to the following:
<html xmlns:dc="http://purl.org/dc/elements/1.1/"> <head /> <body> <span property="dc:date" class="date">March 23, 2004</span> <span property="dc:title" class="headline">High-tech rollers hit casino for £1.3m</span> By <span property="dc:creator" class="byline">Steve Bird</span> <span class="standfirst"> Word of a hand-held device which can beat the roulette wheel has gambling bosses quaking </span> <p>...</p> </body> </html>
This is often easier to maintain since an author editing their document is at the same time editing the metadata.
Another use for the meta attributes on other mark-up elements is to provide a normalised value for some text. This is especially important to certain types of consumers of metadata, such as search engines.
For example, the following article would be difficult to locate:
Tomorrow the <span>Prime Minister</span> is expected to fly to ...
However, by using resource and content we can indicate exactly which Prime Minister is being referred to, and when the journey is due to take place:
<span content="2004-03-20">Tomorrow<span> the <span resource="http://example.com/people/TonyBlair/1">Prime Minister</span> is expected to fly to ...
Note that if no property is present then the example just given is equivalent to:
<span property="xhtml2:reference" content="2004-03-20">Tomorrow<span> the <span property="xhtml2:reference" resource="http://example.com/people/TonyBlair/1">Prime Minister</span> is expected to fly to ...