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

19.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.
content = CDATA
This attribute specifies the metadata associated with an element. If not specified, then the metadata for an element is its content.
datatype = QName
This attribute defines the datatype of the content of the element. If the attribute is not specified, then the default value is string as defined by [XMLSCHEMA].
property = QName
This attribute indicates which property is being defined by the element. If it is not specified, the property is xhtml2:reference.
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 resource attribute.
Examples:
<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.
alternate
Designates substitute versions for the document. When used together with the 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).
start
Refers to the first document in a collection of documents. This relationship tells search engines which document is considered by the author to be the starting point of the collection.
next
Refers to the next document in an ordered collection of documents. User agents may choose to pre-load the "next" document, to reduce the perceived load time.
prev
Refers to the previous document in an ordered collection of documents.
up
Refers to the document "above" in a hierarchically structured set of documents.
contents
Refers to a document serving as a table of contents.
index
Refers to a document providing an index for the document.
glossary
Refers to a document providing a glossary of terms that pertain to the document.
copyright
Refers to a copyright statement for the document.
chapter
Refers to a document serving as a chapter in a collection of documents.
section
refers to a document serving as a section in a collection of documents.
subsection
Refers to a document serving as a subsection in a collection of documents.
appendix
Refers to a document serving as an appendix in a collection of documents.
help
Refers to a document 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 document that provides metadata, for instance in RDF, about the document.
icon
Refers to a resource that represents an icon for the document.
p3pv1
Refers to a P3P Policy Reference File. See [P3P]
profile

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:

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

 <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">&copy; 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>
...
resource = URI
This attribute indicates the URI of the resource that is being referred to by an element.
The <a href="ReadMoreOnPM.htm" resource="http://example.org/blair">Prime Minister</a> said ...
restype = ContentTypes

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" >
rev = QName
This attribute is used to describe the relationship of a reverse link from the anchor specified by the resource attribute to the current document. For a list of relationship names, see the rel attribute.

Implementation: RELAX NG

19.2. Properties

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
&#163;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
&#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:

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

19.3. Mapping Lexical Content

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