?? rfc2731.txt
字號:
<meta name = "DC.Date.Valid"
content = "1998-05-28">
<meta name = "DC.Date.Created"
content = "triassic">
<meta name = "DC.Date.Acquired"
content = "1957">
<meta name = "DC.Date.Accepted"
scheme = "WTN8601"
content = "1998-12-02T16:59">
<meta name = "DC.Date.DataGathered"
scheme = "ISO8601"
content = "98-W49-3T1659">
<meta name = "DC.Date.Issued"
scheme = "ANSI.X3.X30-1985"
content = "19980514">
Type (性質(zhì)、流派、類別; 建議用[DCT1])
----
<meta name = "DC.Type"
content = "poem">
<meta name = "DC.Type"
scheme = "DCT1"
content = "software">
<meta name = "DC.Type"
content = "software program source code">
<meta name = "DC.Type"
content = "interactive video game">
<meta name = "DC.Type"
scheme = "DCT1"
content = "dataset">
<meta name = "DC.Type"
content = "web home page">
<meta name = "DC.Type"
content = "web bibliography">
<meta name = "DC.Type"
content = "painting">
<meta name = "DC.Type"
content = "image; woodblock">
<meta name = "DC.Type"
scheme = "AAT"
content = "clipeus (portrait)">
<meta name = "DC.Type"
lang = "en-US"
content = "image; advertizement">
<meta name = "DC.Type"
scheme = "DCT1"
content = "event">
<meta name = "DC.Type"
content = "event; periodic">
Format (物理或邏輯格式以及可選的資源大小)
------
<meta name = "DC.Format"
content = "text/xml">
<meta name = "DC.Format"
scheme = "IMT"
content = "text/xml">
<meta name = "DC.Format"
scheme = "IMT"
content = "image/jpeg">
<meta name = "DC.Format"
content = "A text file with mono-spaced tables and diagrams.">
<meta name = "DC.Format"
content = "video/mpeg; 14 minutes">
<meta name = "DC.Format"
content = "unix tar archive, gzip compressed; 1.5 Mbytes">
<meta name = "DC.Format"
content = "watercolor; 23 cm x 31 cm">
Identifier (資源標(biāo)識符)
----------
<meta name = "DC.Identifier"
content = "http://foo.bar.org/zaf/">
<meta name = "DC.Identifier"
content = "urn:ietf:rfc:1766">
<meta name = "DC.Identifier"
scheme = "ISBN"
content = "1-56592-149-6">
<meta name = "DC.Identifier"
scheme = "LCCN"
content = "67-26020">
<meta name = "DC.Identifier"
scheme = "DOI"
content = "10.12345/33-824688ab">
Source (來源)
------
<meta name = "DC.Source"
content = "Shakespeare's Romeo and Juliet">
<meta name = "DC.Source"
content = "http://a.b.org/manon/">
Language (內(nèi)容所使用的語言;建議使用[RFC1766])
--------
<meta name = "DC.Language"
content = "en">
<meta name = "DC.Language"
scheme = "rfc1766"
content = "en">
<meta name = "DC.Language"
scheme = "ISO639-2"
content = "eng">
<meta name = "DC.Language"
scheme = "rfc1766"
content = "en-US">
<meta name = "DC.Language"
content = "zh">
<meta name = "DC.Language"
content = "ja">
<meta name = "DC.Language"
content = "es">
<meta name = "DC.Language"
content = "de">
<meta name = "DC.Language"
content = "german">
<meta name = "DC.Language"
lang = "fr"
content = "allemand">
Relation (相關(guān)資源)
--------
<meta name = "DC.Relation.IsPartOf"
content = "http://foo.bar.org/abc/proceedings/1998/">
<meta name = "DC.Relation.IsFormatOf"
content = "http://foo.bar.org/cd145.sgml">
<meta name = "DC.Relation.IsVersionOf"
content = "http://foo.bar.org/draft9.4.4.2">
<meta name = "DC.Relation.References"
content = "urn:isbn:1-56592-149-6">
<meta name = "DC.Relation.IsBasedOn"
content = "Shakespeare's Romeo and Juliet">
<meta name = "DC.Relation.Requires"
content = "LWP::UserAgent; HTML::Parse; URI::URL;
Net::DNS; Tk::Pixmap; Tk::Bitmap; Tk::Photo">
Coverage (內(nèi)容所涉及的范圍)
--------
<meta name = "DC.Coverage"
content = "US civil war era; 1861-1865">
<meta name = "DC.Coverage"
content = "Columbus, Ohio, USA; Lat: 39 57 N Long: 082 59 W">
<meta name = "DC.Coverage"
scheme = "TGN"
content = "Columbus (C,V)">
<meta name = "DC.Coverage.Jurisdiction"
content = "Commonwealth of Australia">
Rights (版權(quán)管理聲明)
------
<meta name = "DC.Rights"
lang = "en"
content = "Copyright Acme 1999 - All rights reserved.">
<meta name = "DC.Rights"
content = "http://foo.bar.org/cgi-bin/terms">
8、安全性問題
本文所討論的在HTML中應(yīng)用DC元數(shù)據(jù)的語法規(guī)則不會給計算機和網(wǎng)絡(luò)帶來直接的危險。這些規(guī)則可能被用于編制不準(zhǔn)確甚至有意誤導(dǎo)(造成“垃圾檢索信息”)的元數(shù)據(jù)信息,這反映了對HTML META標(biāo)簽的濫用,而且也不僅限于對DC元數(shù)據(jù)的編碼。即使傳統(tǒng)的元數(shù)據(jù)編碼方案(比如[MARC])也不能免于錯誤,雖然錯誤通常發(fā)生在數(shù)據(jù)量遠遠超出普通網(wǎng)站水平的情況下。
對使用META標(biāo)簽進行編碼的元數(shù)據(jù)進行處理的系統(tǒng),應(yīng)該作為設(shè)計與實現(xiàn)的一部分考慮與元數(shù)據(jù)的正確性和有效性有關(guān)的問題,使用這些系統(tǒng)的用戶也要考慮系統(tǒng)設(shè)計和實現(xiàn)中的要求。不同的應(yīng)用程序可能采用不同的方法,比方說增加元數(shù)據(jù)來源的聲明、對元數(shù)據(jù)是用數(shù)字簽名以及元數(shù)據(jù)創(chuàng)建過程中某些方面的自動化,但是這些都超出了本文以及META標(biāo)簽語法的范疇。
9、附錄——處理用META標(biāo)簽編碼的元數(shù)據(jù)的Perl腳本程序
這一節(jié)包括兩個程序,適用于4和5版本的PERL腳本語言解釋器。這兩個程序可以自由地用于本單位的需要、研究目的或者風(fēng)險資本的召喚。根據(jù)這些程序,程序員可以很容易把它們改造成其它的應(yīng)用。
腳本一:源數(shù)據(jù)格式轉(zhuǎn)換
這是一個簡單的Perl腳本程序,能夠正確識別本文所有例子中的元數(shù)據(jù)編碼。這個例子說明如何用普通的腳本開發(fā)把元數(shù)據(jù)從一種格式轉(zhuǎn)到另一種格式的實用程序,只要稍作改變就可以支持多種輸出格式。
#!/depot/bin/perl
#
# This simple perl script extracts metadata embedded in an HTML file
# and outputs it in an alternate format. Issues warning about missing
# element name or value.
#
# Handles mixed case tags and attribute values, one per line or spanning
# several lines. Also handles a quoted string spanning multiple lines.
# No error checking. Does not tolerate more than one "<meta" per line.
print "@(urc;\n";
while (<>) {
next if (! /<meta/i);
($meta) = /(<meta.*$)/i;
if (! /<meta.*>/i) {
while (<>) {
$meta .= $_;
last if (/>/);
}
}
$name = $meta =~ /name\s*=\s*"([^"]*)"/i
? $1 : "MISSING ELEMENT NAME";
$content = $meta =~ /content\s*=\s*"([^"]*)"/i
? $1 : "MISSING ELEMENT VALUE";
($scheme) = $meta =~ /scheme\s*=\s*"([^"]*)"/i;
($lang) = $meta =~ /lang\s*=\s*"([^"]*)"/i;
if ($lang || $scheme) {
$mod = " ($lang";
if (! $scheme)
{ $mod .= ")"; }
elsif (! $lang)
{ $mod .= "$scheme)" }
else
{ $mod .= ", $scheme)"; }
}
else
{ $mod = ""; }
print " @|$name$mod; $content\n";
}
print "@)urc;\n";
# ---- end of Perl script ----
如果該程序用于第四節(jié)中的元數(shù)據(jù)例子,則輸出結(jié)果如下:
@(urc;
@|DC.Title; A Dirge
@|DC.Creator; Shelley, Percy Bysshe
@|DC.Type; poem
@|DC.Date; 1820
@|DC.Format; text/html
@|DC.Language; en
@)urc;
腳本二——元數(shù)據(jù)創(chuàng)建自動化
如果沒有一些自動化的幫助——預(yù)先設(shè)定缺省值、語法檢查、數(shù)據(jù)范圍驗證以及拼寫檢查等——創(chuàng)建和維護高質(zhì)量的元數(shù)據(jù)可能非常困難。如果有某個腳本程序能夠僅僅通過文檔標(biāo)題來加入相應(yīng)的元數(shù)據(jù)內(nèi)容,就可以極大減輕用戶的工作量。下面的程序就可完成這項工作。HTML作者可以把整個內(nèi)嵌資源描述縮寫放在HTML注釋聲明中:
<!--metablock Little Red Riding Hood -->
我們的腳本程序把該聲明看作是一種專門的帶有文檔標(biāo)題的“元數(shù)據(jù)塊聲明”。一般形式為:
<!--metablock TITLE_OF_DOCUMENT -->
該聲明的工作方式非常類似于“服務(wù)器端引入”,腳本程序用完整的元數(shù)據(jù)塊代替該聲明并機或其他的替換。裝上后,該腳本就會生成與用戶產(chǎn)品Web服務(wù)器程序兼容的HTML文件。
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -