mod-metaAttributes.html
22.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>XHTML 2.0 - XHTML Metainformation Attributes Module</title>
<link rel="start" type="text/html" href="Overview.html" />
<link rel="contents" type="text/html" href="Overview.html#toc" />
<link rel="prev" type="text/html" href="mod-meta.html" />
<link rel="next" type="text/html" href="mod-object.html" />
<link rel="stylesheet" type="text/css" href="xhtml.css" />
<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-WD.css" />
</head>
<body>
<div class="navbar">[<a accesskey="P" href="mod-meta.html">previous</a>]   [<a accesskey="N" href="mod-object.html">next</a>]  [<a accesskey="T" href="Overview.html#toc">table of
contents</a>]  [<a accesskey="E" href="elements.html">elements</a>]  [<a accesskey="A" href="attributes.html">attributes</a>]
<hr />
</div>
<h1><a id="s_metaAttributesmodule" name="s_metaAttributesmodule">24.</a> XHTML Metainformation Attributes Module</h1>
<div class='subtoc'>
<p><strong>Contents</strong></p>
<ul class='toc'>
<li class='tocline'>24.1. <a href="#col_Metainformation" class="tocxref">Metadata Attribute Collection</a></li>
<li class='tocline'>24.2. <a href="#sec_24.2." class="tocxref">Meta and RDF</a></li>
<li class='tocline'>24.3. <a href="#sec_24.3." class="tocxref">Metadata as Content</a></li>
<li class='tocline'>24.4. <a href="#sec_24.4." class="tocxref">Mapping Lexical Content</a></li>
</ul>
</div>
<p>This section is <em>normative</em>.</p>
<p>The Metainformation Attributes Module defines the <a class="csref" href="mod-metaAttributes.html#col_Metainformation">Metainformation</a> attribute collection. This collection allows elements to
be annotated with metadata throughout an XHTML-family document.</p>
<h2><a id="col_Metainformation" name="col_Metainformation">24.1.</a> Metadata Attribute Collection</h2>
<!-- INCLUDING ATTRIBUTE modules/attributes/about.mhtml -->
<dl class='attrDef'>
<dt><a class="adef" id="adef_metaAttributes_about"><span class="adef">about</span></a> = <span class="datatype"><a href="abstraction.html#dt_URI">URI</a></span></dt>
<dd>This attribute specifies which resource has a specified property.
<p>If this attribute is not present then the resource being referred to by a <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_property">property</a> attribute on the same element is
decided as follows:</p>
<ol>
<li>If the element on which the other metadata attributes are attached is a child of a <a class="eref" href="mod-meta.html#edef_meta_link">link</a> then the metadata inferred by the element concerns
the URI referred to in the <a class="eref" href="mod-meta.html#edef_meta_link">link</a>.</li>
<li>Otherwise, the metadata inferred by the element concerns the current document.</li>
</ol>
<div class="example">
<p>Example</p>
<pre>
<meta about="http://www.example.com/" property="dc:created">2004-03-20</meta>
</pre>
</div>
</dd>
</dl>
<!-- END OF ATTRIBUTE FILE modules/attributes/about.mhtml --><!-- INCLUDING ATTRIBUTE modules/attributes/content.mhtml -->
<dl class='attrDef'>
<dt><a class="adef" id="adef_metaAttributes_content"><span class="adef">content</span></a> = <span class="datatype"><a href="abstraction.html#dt_CDATA">CDATA</a></span></dt>
<dd>This attribute specifies the metadata associated with an element. If not specified, then the metadata for an element is its content.
<div class="example">
<p>Example</p>
<pre>
<meta about="http://www.example.com/" property="dc:created" content="2004-03-20"/>
</pre>
</div>
</dd>
</dl>
<!-- END OF ATTRIBUTE FILE modules/attributes/content.mhtml --><!-- INCLUDING ATTRIBUTE modules/attributes/datatype.mhtml -->
<dl class='attrDef'>
<dt><a class="adef" id="adef_metaAttributes_datatype"><span class="adef">datatype</span></a> = <span class="datatype"><a href="abstraction.html#dt_QName">QName</a></span></dt>
<dd>This attribute defines the datatype of the content metadata of the element. If the attribute is not specified, then the default value is <a class="xsdref" href=
"http://www.w3.org/TR/xmlschema-2/#string">string</a> as defined by [<a class="nref" href="references.html#ref_XMLSCHEMA">XMLSCHEMA</a>].
<div class="example">
<p>Example</p>
<pre>
<meta about="http://www.example.com/" property="dc:created" datatype="xsd:date">2004-03-20</meta>
</pre>
</div>
</dd>
</dl>
<!-- END OF ATTRIBUTE FILE modules/attributes/datatype.mhtml --><!-- INCLUDING ATTRIBUTE modules/attributes/property.mhtml -->
<dl class='attrDef'>
<dt><a class="adef" id="adef_metaAttributes_property"><span class="adef">property</span></a> = <span class="datatype"><a href="abstraction.html#dt_QName">QName</a></span></dt>
<dd>This attribute indicates which property is being defined by the element. If it is not specified, the property is <code>reference</code>.
<div class="example">
<p>Example</p>
<pre>
<meta about="http://www.example.com/" property="dc:creator">John Smith</meta>
</pre>
</div>
<p>Authors may use the following properties, listed here with their conventional interpretations.</p>
<p>User agents, search engines, etc. are free to interpret these properties as necessary.</p>
<p>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., <code>dc:creator</code> for the Dublin Core "creator" relationship).</p>
<p>Note that in order to reference relationship definitions via QName, their namespace must be defined via an xmlns attribute somewhere suitable:</p>
<div class="example">
<p>Example</p>
<pre>
<html .... xmlns:dc="http://purl.org/dc/elements/1.1/">
</pre>
</div>
<dl>
<dt>description</dt>
<dd>Gives a description of the resource.</dd>
<dt>generator</dt>
<dd>Identifies the software used to generate the resource.</dd>
<dt>keywords</dt>
<dd>Gives a comma-separated list of keywords describing the resource.</dd>
<dt>reference</dt>
<dd>The default value, gives no explicit information about the relationship with the resource.</dd>
<dt>robots</dt>
<dd>Gives advisory information intended for automated web-crawling software. This specification does not define values for this property.</dd>
<dt>title</dt>
<dd>Specifies a title for the resource.</dd>
</dl>
<p>Note that previous versions of XHTML included an <code>author</code> property; this has now been replaced with the Dublin Core <code>creator</code> property.</p>
<p>Note that:</p>
<div class="example">
<p>Example</p>
<pre>
<head>
<title>My Life and Times</title>
</pre>
</div>
<p>is just a shorthand for:</p>
<div class="example">
<p>Example</p>
<pre>
<head>
<meta property="title">My Life and Times</meta>
</pre>
</div>
<p>Note that the <a class="aref" href="mod-core.html#adef_core_title">title</a> attribute which is available on all XHTML2 elements, is just a shorthand for a common case:</p>
<div class="example">
<p>Example</p>
<pre>
<a href="Jakob.html" title="Author biography">Jakob Nielsen</a>'s Alertbox for January 11, 1998
</pre>
</div>
<p>is equivalent to:</p>
<div class="example">
<p>Example</p>
<pre>
<meta about="#jakob" property="title">Author biography</meta>
<a href="Jakob.html" id="jakob">Jakob Nielsen</a>'s Alertbox for January 11, 1998
</pre>
</div>
<p>Note that this allows you to specify richer, marked-up text for a title when needed.</p>
</dd>
</dl>
<!-- END OF ATTRIBUTE FILE modules/attributes/property.mhtml --><!-- INCLUDING ATTRIBUTE modules/attributes/rel.mhtml -->
<dl class='attrDef'>
<dt><a class="adef" id="adef_metaAttributes_rel"><span class="adef">rel</span></a> = <span class="datatype"><a href="abstraction.html#dt_QName">QName</a></span></dt>
<dd>This attribute describes the relationship between the resource specified by the <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_about">about</a> attribute (or its default value)
and the resource referred to by the <a class="aref" href="mod-hyperAttributes.html#adef_hyperAttributes_href">href</a> attribute.
<div class="example">
<p>Example</p>
<pre>
<link href="top.html" rel="contents"/>
</pre>
</div>
<p>This example defines a link to a table of contents for the current document.</p>
<div class="example">
<p>Example</p>
<pre>
<link href="doc.ps"
rel="alternate"
media="print"
hreftype="application/postscript" />
</pre>
</div>
<p>This example defines a link to an alternate version of the document especially suited to printing.</p>
<p>Authors may use the following relationship names, listed here with their conventional interpretations.</p>
<p>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.</p>
<p>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).</p>
<p>Note that in order to reference relationship definitions via QName, their namespace must be defined via an xmlns attribute somewhere suitable:</p>
<div class="example">
<p>Example</p>
<pre>
<html .... xmlns:dc="http://purl.org/dc/elements/1.1/">
</pre>
</div>
<dl>
<dt>alternate</dt>
<dd>Designates alternate versions for the document. When used together with the <a class="aref" href="mod-hyperAttributes.html#adef_hyperAttributes_hreflang">hreflang</a> attribute, it implies a
translated version of the document. When used together with the <a class="aref" href="mod-hyperAttributes.html#adef_hyperAttributes_hrefmedia">hrefmedia</a> attribute, it indicates a version intended
for that type of device.</dd>
<dt>start</dt>
<dd>Refers to the first resource in a collection of resources. A typical use case might be a collection of chapters in a book.</dd>
<dt>next</dt>
<dd>Refers to the next resource (after the current one) in an ordered collection.</dd>
<dt>prev</dt>
<dd>Refers to the previous resource (before the current one) in an ordered collection.</dd>
<dt>up</dt>
<dd>Refers to the resource "above" in a hierarchically structured set.</dd>
<dt>contents</dt>
<dd>Refers to a resource serving as a table of contents.</dd>
<dt>index</dt>
<dd>Refers to a resource providing an index.</dd>
<dt>glossary</dt>
<dd>Refers to a resource providing a glossary of terms.</dd>
<dt>copyright</dt>
<dd>Refers to a copyright statement for the resource.</dd>
<dt>chapter</dt>
<dd>Refers to a resource serving as a chapter in a collection.</dd>
<dt>section</dt>
<dd>Refers to a resource serving as a section in a collection.</dd>
<dt>subsection</dt>
<dd>Refers to a resource serving as a subsection in a collection.</dd>
<dt>appendix</dt>
<dd>Refers to a resource serving as an appendix in a collection.</dd>
<dt>help</dt>
<dd>Refers to a resource offering help (more information, links to other sources of information, etc.)</dd>
<dt>bookmark</dt>
<dd>Refers to a bookmark. A bookmark is a link to a key entry point within an extended document. The <a class="aref" href="mod-core.html#adef_core_title">title</a> attribute may be used, for example,
to label the bookmark. Note that several bookmarks may be defined for a document.</dd>
<dt>meta</dt>
<dd>Refers to a resource that provides metadata, for instance in RDF.</dd>
<dt>icon</dt>
<dd>Refers to a resource that represents an icon.</dd>
<dt>p3pv1</dt>
<dd>Refers to a P3P Policy Reference File. See [<a class="nref" href="references.html#ref_P3P">P3P</a>].</dd>
<dt>profile</dt>
<dd>
<p>Refers to a resource that defines relationships or provides metadata, for instance in RDF. User agents may use this URI in two ways:</p>
<ul>
<li>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.</li>
<li>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.</li>
</ul>
<p>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 <a class="eref" href="mod-meta.html#edef_meta_meta">meta</a> declarations.</p>
<div class="example">
<p>Example</p>
<pre>
<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>
...
</pre>
</div>
</dd>
<dt>role</dt>
<dd>Indicates the purpose of the resource. For some possible values, see <a href="mod-roleAttribute.html#s_roleAttributemodule">the Role Attribute</a> module.</dd>
<dt>cite</dt>
<dd>Refers to a resource that defines a citation (see <a class="eref" href="mod-text.html#edef_text_cite">cite</a>) .</dd>
</dl>
<div class="issue">
<p id="s_metaAttributesmodule_issue_0" class="issueTitle">Relationship 'required'</p>
Linktype 'required'</div>
</dd>
</dl>
<!-- END OF ATTRIBUTE FILE modules/attributes/rel.mhtml --><!-- INCLUDING ATTRIBUTE modules/attributes/rev.mhtml -->
<dl class='attrDef'>
<dt><a class="adef" id="adef_metaAttributes_rev"><span class="adef">rev</span></a> = <span class="datatype"><a href="abstraction.html#dt_QName">QName</a></span></dt>
<dd>This attribute is the complement of the <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_rel">rel</a> attribute and describes the reverse relationship between the resource
specified by the <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_about">about</a> attribute (or its default value) and the resource referred to by the <a class="aref" href=
"mod-hyperAttributes.html#adef_hyperAttributes_href">href</a> attribute. For a list of relationship names, see the <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_rel">rel</a>
attribute.
<div class="example">
<p>Example</p>
<pre>
<link href="doc.html" rev="contents"/>
</pre>
</div>
<p>This example states that the current document is the table of contents for the referenced document.</p>
</dd>
</dl>
<!-- END OF ATTRIBUTE FILE modules/attributes/rev.mhtml -->
<p>Implementation: <a href="relax_module_defs.html#a_rmodule_Metainformation_Attributes">RELAX NG</a></p>
<h2><a id="sec_24.2." name="sec_24.2.">24.2.</a> Meta and RDF</h2>
<p>The metadata attributes can be used to generate RDF statements, which consist of a subject, a predicate, and an object.</p>
<p>The attributes <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_rel">rel</a>, <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_rev">rev</a> and <a class="aref"
href="mod-metaAttributes.html#adef_metaAttributes_property">property</a> represent predicates. The predicate is obtained by concatenating the namespace URI and the local part of the QName of the
attribute value.</p>
<p>For attribute <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_rel">rel</a>, the subject is the <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_about">about</a>
property, and the object is the value of the <a class="aref" href="mod-hyperAttributes.html#adef_hyperAttributes_href">href</a> attribute; for attribute <a class="aref" href=
"mod-metaAttributes.html#adef_metaAttributes_rev">rev</a>, the subject and object roles are reversed: the subject is the <a class="aref" href="mod-hyperAttributes.html#adef_hyperAttributes_href">
href</a> attribute, and the object is the value of the <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_about">about</a> property.</p>
<p>For attribute <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_property">property</a>, the subject is the <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_about">
about</a> property, and the object is the string literal in the <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_content">content</a> attribute, or otherwise the XML literal that is
the content of the element, decorated as necessary with the value of the <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_datatype">datatype</a> attribute.</p>
<p>The about property is obtained as follows:</p>
<ul>
<li>If the element that the attributes are on has an <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_about">about</a> attribute, then that is used.</li>
<li>Otherwise for <a class="eref" href="mod-meta.html#edef_meta_meta">meta</a> and <a class="eref" href="mod-meta.html#edef_meta_link">link</a> elements:
<ul>
<li>If the parent element has an explicit <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_about">about</a> attribute, then that is the about property.</li>
<li>Otherwise, if the parent element has an <a class="aref" href="mod-core.html#adef_core_id">id</a> attribute, then that is the about property.</li>
<li>Otherwise, the about property is a 'blank node' representing the parent element (which is like an invisible automatically generated <a class="aref" href="mod-core.html#adef_core_id">id</a> on the
element).</li>
</ul>
</li>
<li>For all other elements, the about property is the closest <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_about">about</a> attribute on an ancestor of the current element. If
there is no such attribute, it is the [<a class="nref" href="references.html#ref_URI">URI</a>] of the containing document.</li>
</ul>
<h2><a id="sec_24.3." name="sec_24.3.">24.3.</a> Metadata as Content</h2>
<p>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.</p>
<p>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:</p>
<div class="example">
<p>Example</p>
<pre>
<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>
</pre>
</div>
<p>By making use of the meta attributes this can be shortened to the following:</p>
<div class="example">
<p>Example</p>
<pre>
<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>
</pre>
</div>
<p>This is often easier to maintain since an author editing their document is at the same time editing the metadata.</p>
<h2><a id="sec_24.4." name="sec_24.4.">24.4.</a> Mapping Lexical Content</h2>
<p>Another use for the meta attributes on other mark-up elements is to provide a <em>normalized</em> value for some text. This is especially important to certain types of consumers of metadata, such
as search engines.</p>
<p>For example, the following article would be difficult to locate:</p>
<div class="example">
<p>Example</p>
<pre>
Tomorrow the <span>Prime Minister</span> is expected to fly to ...
</pre>
</div>
<p>However, by using <a class="aref" href="mod-hyperAttributes.html#adef_hyperAttributes_href">href</a> and <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_content">content</a> we
can indicate exactly which Prime Minister is being referred to, and when the journey is due to take place:</p>
<div class="example">
<p>Example</p>
<pre>
<span content="2004-03-20">Tomorrow</span> the
<span href="http://example.com/people/TonyBlair/1">Prime Minister</span>
is expected to fly to ...
</pre>
</div>
<p>Note that if no <a class="aref" href="mod-metaAttributes.html#adef_metaAttributes_property">property</a> is present then the example just given is equivalent to:</p>
<div class="example">
<p>Example</p>
<pre>
<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 ...
</pre>
</div>
<hr />
<div class="navbar">[<a href="mod-meta.html">previous</a>]   [<a href="mod-object.html">next</a>]   [<a href="Overview.html#toc">table of contents</a>]  [<a href=
"elements.html">elements</a>]  [<a href="attributes.html">attributes</a>]</div>
</body>
</html>