XHTML Meta Data Profiles

Drafts

Author(s)

Introduction

HTML4 has several mechanisms for describing meta data, the most well known being the <meta> element. <meta> is often used to denote the author of a document:


 <meta name="author" lang="tr" content="Tantek &Ccedil;elik" />

Briefly explained:

Each META element specifies a property/value pair. The name attribute identifies the property and the content attribute specifies the property's value.

A half dozen or so example properties which are fairly self explanatory: author, keywords, copyright, date, identifier. But in the definition of the 'name' attribute of the <meta> element, the HTML4 specification takes great care to state that This specification does not list legal values for this attribute.

Instead, HTML4 provides a mechanism (the 'profile' attribute of the <head> element) to point to a meta data profile that defines properties and values. And again, the specification states explicitly that it does not define formats for profiles.

This proposal seeks to define a meta data profile format using principles of simplicity, reuse, and minimalism. The constraints, direction and hints for the format are derived from the HTML4 specification, and the building blocks of the format are taken from XHTML 1.0.

Principles

Hints from HTML4

Strong emphasis added for clarity.

Deductions

Format Description

The XHTML profile format consists of a definition list of properties as definition terms, and as their definitions, an optional brief description, and then, if applicable, one or more definition list(s) of values.

First the profile definition list, recognizable by its class:


<dl class="profile">

Note that the HTML4 'class' attribute is a space separated set of values. All that is required is for the value "profile" to be in that set.

Next a definition term and definition for a property:


 <dt>property1</dt> 
 <dd>

Any amount of valid optional markup (except for definition lists of course) may be used to provide a prose description and/or references for the property.


  <p>Authors may use property1 to describe 
   some particular details.
  </p>

One or more nested definition list(s) for the values and their definitions. If the values do not form a discrete set, or if that set should be too large to practically enumerate, a simple prose description of the set of legal values and any type constraints will suffice.


  <dl>
   <dt>value1</dt>
    <dd>definition of value1</dd>
   <dt>value2</dt>
    <dd>definition of value2</dd>
   ...
  </dl>
  ...
 </dd>

Perhaps another property:


 <dt>property2</dt>

And its values description instead:


 <dd>
  Property2 contains a space separated set of values, 
  each of which is a date in the ISO8601 date format.
 </dd>

Etc., and finally closure of the outer definition list:


 ...
</dl>

Format Embedding and Profile Documents

The format may be embedded anywhere an HTML4 definition list may be embedded. Being well formed XML, the profile format may also be embedded in any XML document that permits embedding of XHTML.

A self-standing profile document can be simply constructed by wrapping the profile format with the minimal XHTML necessary for a valid XHTML document.

Sample Profile Document

The various meta properties used informatively in HTML4 could be defined by the following profile document (also available online):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>sample HTML profile</title></head>
<body>
 <dl class="profile">
  <dt>author</dt>
   <dd>A person who wrote (at least part of) the document.</dd>
  <dt>keywords</dt>
   <dd>A comma and/or space separated list of the 
    keywords or keyphrases of the document.</dd>
  <dt>copyright</dt>
   <dd>The name (or names) of the copyright holder(s) 
    for this document, and/or a complete statement of copyright.</dd>
  <dt>date</dt>
   <dd>The last updated date of the document, in ISO8601 date format.</dd>
  <dt>identifier</dt>
   <dd>The normative URI for the document.</dd>
  <dt>rel</dt>
   <dd>
    <dl>
     <dt>script</dt>
     <dd>A reference to a client-side script. When used with the 
      LINK element, the script is evaluated as the document loads and 
      may modify the contents of the document dynamically.</dd> 
    </dl>
   </dd>
  </dl>
</body>
</html>

References

HTML4
Raggett, D.; Le Hors, A.; Jacobs, I.. HTML 4.01 Specification. Dec 1999. W3C Recommendation. URL: http://www.w3.org/TR/1999/REC-html401-19991224
ISO8601
"Data elements and interchange formats -- Information interchange -- Representation of dates and times", ISO 8601:1988.
URI
"Uniform Resource Identifiers (URI): Generic Syntax", T. Berners-Lee, R. Fielding, L. Masinter, August 1998.