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:
Example
<meta about="http://www.example.com/" property="dc:created">2004-03-20</meta>
Example
<meta about="http://www.example.com/" property="dc:created" content="2004-03-20"/>
Example
<meta about="http://www.example.com/" property="dc:created" datatype="xsd:date">2004-03-20</meta>
reference
.
Example
<meta about="http://www.example.com/" property="dc:creator">John Smith</meta>
Authors may use the following properties, listed here with their conventional interpretations.
User agents, search engines, etc. are free to interpret these properties as necessary.
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).
Note that in order to reference relationship definitions via QName, their namespace must be defined via an xmlns attribute on the root element of the document:
Example
<html .... xmlns:dc="http://purl.org/dc/elements/1.1/">
Note that previous versions of XHTML included an author
property; this has now been replaced with the Dublin Core creator
property.
Note that:
Example
<head> <title>My Life and Times</title>
is just a shorthand for:
Example
<head> <meta property="title">My Life and Times</meta>
Note that the title attribute which is available on all XHTML2 elements, is just a shorthand for a common case:
Example
<a href="Jakob.html" title="Author biography">Jakob Nielsen</a>'s Alertbox for January 11, 1998
is equivalent to:
Example
<meta about="#jakob" property="title">Author biography</meta> <a href="Jakob.html" id="jakob">Jakob Nielsen</a>'s Alertbox for January 11, 1998
Note that this allows you to specify richer, marked-up text for a title when needed.
Example
<link href="top.html" rel="contents"/>
This example defines a link to a table of contents for the current document.
Example
<link href="doc.ps" rel="alternate" media="print" hreftype="application/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).
Note that in order to reference relationship definitions via QName, their namespace must be defined via an xmlns attribute on the root element of the document:
Example
<html .... xmlns:dc="http://purl.org/dc/elements/1.1/">
Refers to a resource that defines relationships or provides metadata, for instance in RDF. 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.
Example
<html ... xmlns:mp="http://www.example.com/profiles/rels"> <head> <title>How to complete Memorandum cover sheets</title> <link rel="profile" href="http://www.example.com/profiles/slideshow" /> </head> <body> <div class="slide"> some slide content... </div> </body> ...
Relationship 'required'
Linktype 'required'Implementation: RELAX NG
The metadata attributes can be used to generate RDF statements. The attributes rel, rev and property represent predicates. The predicate is obtained by concatenating the namespace URI and the local part of the Qname of the attribute value. For attribute rel, the subject is the about property, and the object is the value of the href attribute; for attribute rev, the subject and object roles are reversed. For attribute property, the subject is the about property, and the object is the string literal in the content attribute, or otherwise the XML literal that is the content of the element, decorated as necessary with the value of the datatype attribute.
One use of the metadata attributes is with elements that represent document content, 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:
Example
<html xmlns="http://www.w3.org/2002/06/xhtml2/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <head> <title>... title ...</title> <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:
Example
<html xmlns="http://www.w3.org/2002/06/xhtml2/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <head> <title>... title ...</title> </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 normalized 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:
Example
Tomorrow the <span>Prime Minister</span> is expected to fly to ...
However, by using href and content we can indicate exactly which Prime Minister is being referred to, and when the journey is due to take place:
Example
<span content="2004-03-20">Tomorrow</span> the <span href="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:
Example
<span property="reference" content="2004-03-20"> Tomorrow </span> the <span property="reference" href="http://example.com/people/TonyBlair/1"> Prime Minister </span> is expected to fly to ...