24. XHTML Metainformation Attributes Module

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.

24.1. Metadata Attribute Collection

about = URI
This attribute specifies which resource has a specified property.

If this attribute is not present then the resource being referred to by a property attribute on the same element is decided as follows:

  1. If the element on which the other metadata attributes are attached is a child of a link then the metadata inferred by the element concerns the URI referred to in the link.
  2. Otherwise, the metadata inferred by the element concerns the current document.

Example

<meta about="http://www.example.com/" property="dc:created">2004-03-20</meta>
content = CDATA
This attribute specifies the metadata associated with an element. If not specified, then the metadata for an element is its content.

Example

<meta about="http://www.example.com/" property="dc:created" content="2004-03-20"/>
datatype = QName
This attribute defines the datatype of the content metadata of the element. If the attribute is not specified, then the default value is string as defined by [XMLSCHEMA].

Example

<meta about="http://www.example.com/" property="dc:created" datatype="xsd:date">2004-03-20</meta>
property = QName
This attribute indicates which property is being defined by the element. If it is not specified, the property is 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.

The list of predefined values (in the XHTML2 namesapce) are given below. Users may extend this collection of relationships, however new values 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 somewhere suitable:

Example

<html ....  xmlns:dc="http://purl.org/dc/elements/1.1/">
description
Gives a description of the resource.
generator
Identifies the software used to generate the resource.
keywords
Gives a comma-separated list of keywords describing the resource.
reference
The default value, gives no explicit information about the relationship with the resource.
robots
Gives advisory information intended for automated web-crawling software. This specification does not define values for this property.
title
Specifies a title for the resource.

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.

rel = QName
This attribute describes the relationship between the resource specified by the about attribute (or its default value) and the resource referred to by the href attribute.

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 somewhere suitable:

Example

<html ....  xmlns:dc="http://purl.org/dc/elements/1.1/">
alternate
Designates alternate versions for the document. When used together with the hreflang attribute, it implies a translated version of the document. When used together with the hrefmedia attribute, it indicates a version intended for that type of device.
start
Refers to the first resource in a collection of resources. A typical use case might be a collection of chapters in a book.
next
Refers to the next resource (after the current one) in an ordered collection.
prev
Refers to the previous resource (before the current one) in an ordered collection.
up
Refers to the resource "above" in a hierarchically structured set.
contents
Refers to a resource serving as a table of contents.
index
Refers to a resource providing an index.
glossary
Refers to a resource providing a glossary of terms.
copyright
Refers to a copyright statement for the resource.
chapter
Refers to a resource serving as a chapter in a collection.
section
Refers to a resource serving as a section in a collection.
subsection
Refers to a resource serving as a subsection in a collection.
appendix
Refers to a resource serving as an appendix in a collection.
help
Refers to a resource offering help (more information, links to other sources of information, etc.)
bookmark
Refers to a bookmark. A bookmark is a link to a key entry point within an extended document. The title attribute may be used, for example, to label the bookmark. Note that several bookmarks may be defined for a document.
meta
Refers to a resource that provides metadata, for instance in RDF.
icon
Refers to a resource that represents an icon.
p3pv1
Refers to a P3P Policy Reference File. See [P3P].
profile

Refers to a resource that defines relationships or provides metadata, for instance in RDF. User agents may use this URI in two ways:

  • As a globally unique name. User agents may be able to recognize the name (without actually retrieving the profile) and perform some activity based on known conventions for that profile. For instance, search engines could provide an interface for searching through catalogs of XHTML documents, where these documents all use the same profile for representing catalog entries.
  • As a link. User agents may dereference the URI and perform some activity based on the actual definitions within the profile (e.g., authorize the usage of the profile within the current XHTML document). This specification does not define formats for profiles.

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>
...
role
Indicates the purpose of the resource. For some possible values, see the Role Attribute module.
cite
Refers to a resource that defines a citation (see cite) .

Relationship 'required'

Linktype 'required'
rev = QName
This attribute is the complement of the rel attribute and describes the reverse relationship between the resource specified by the about attribute (or its default value) and the resource referred to by the href attribute. For a list of relationship names, see the rel attribute.

Example

<link href="doc.html" rev="contents"/>

This example states that the current document is the table of contents for the referenced document.

Implementation: RELAX NG

24.2. Meta and RDF

The metadata attributes can be used to generate RDF statements, which consist of a subject, a predicate, and an object.

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: the subject is the href attribute, and the object is the value of the about property.

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.

The about property is obtained as follows:

24.3. Metadata as Content

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">2004-03-23</meta>
      <meta property="dc:title">
            High-tech rollers hit casino for &#163;1.3m
      </meta>
      <meta property="dc:creator">Steve Bird</meta>
    </head>
    <body>
      ...
      <span class="date">2004-03-23</span>
      <span class="headline">
            High-tech rollers hit casino for &#163;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">
          2004-03-23
      </span>
      <span property="dc:title" 
          class="headline">
          High-tech rollers hit casino for &#163;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.

24.4. Mapping Lexical Content

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 ...