hcard-th: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
<h1>hCard</h1>
<h1>hCard</h1>
{{TOC-right}}
{{TOC-right}}
hCard เป็นรูปแบบไมโครฟอร์แมตที่เรียบง่ายที่ใช้เป็นสัญลักษณ์ของผู้คน บริษัท องค์กร และสถานที่   hCardใช้คุณสมบัติต่างๆจากมาตรฐาน vCard ([[rfc-2426|ใน RFC2426]]) และแทนค่าผ่าน [[semantic-xhtml|semantic HTML หรือ XHTML]]
hCard เป็นรูปแบบไมโครฟอร์แมตที่เรียบง่ายที่ใช้เป็นสัญลักษณ์ของผู้คน บริษัท องค์กร และสถานที่ hCardใช้คุณสมบัติต่างๆจากมาตรฐาน vCard ([[rfc-2426|ใน RFC2426]]) และใช้งานผ่าน [[semantic-xhtml|HTML หรือ XHTML]]


hCard เป็นหนึ่งในไม่กี่มาตรฐานเปิดใน [[microformats|ไมโครฟอร์แมต]] ที่เหมาะสำหรับการนำไป embed ใน HTML, XHTML, Atom, RSS, และ XML
hCard เป็นหนึ่งในไม่กี่มาตรฐานเปิดใน [[microformats|ไมโครฟอร์แมต]] ที่เหมาะสำหรับการนำไป embed ใน HTML, XHTML, Atom, RSS, และ XML
Line 7: Line 7:
อยากจะเริ่มเขียน [[hcard|hCard]] แล้วหรือยัง?  ลองดูที่ [http://microformats.org/code/hcard/creator เครื่องมือสร้าง hCard] เพื่อสร้างที่อยู่ติดต่อ  หรือจะลองอ่าน [[hcard-authoring|เกร็ดในการสร้าง hCard]] เพื่อ mark up หน้าเว็บติดต่อของคุณดูก็ได้
อยากจะเริ่มเขียน [[hcard|hCard]] แล้วหรือยัง?  ลองดูที่ [http://microformats.org/code/hcard/creator เครื่องมือสร้าง hCard] เพื่อสร้างที่อยู่ติดต่อ  หรือจะลองอ่าน [[hcard-authoring|เกร็ดในการสร้าง hCard]] เพื่อ mark up หน้าเว็บติดต่อของคุณดูก็ได้


== Specification ==
== ข้อกำหนด ==


<div class="vcard">
<div class="vcard">
; <span class="role">บรรณาธิการ</span>  
; <span class="role">บรรณาธิการ</span>  
: <span class="fn">[[User:Tantek|Tantek Çelik (แทนเทค เซลิค)]]</span> (<span class="url">http://tantek.com/</span>, และก่อนหน้านี้ที่ [http://technorati.com Technorati, Inc.], และที่ [http://microsoft.com/ Microsoft Corporation])
: <span class="fn">[[User:Tantek|Tantek Çelik (แทนเทค เซลิค)]]</span> (<span class="url">http://tantek.com/</span>, [http://technorati.com Technorati, Inc.], และ [http://microsoft.com/ Microsoft Corporation])
</div>
</div>
; ผู้แต่ง: [http://tantek.com/ Tantek Çelik] (รายชื่อผู้มีส่วนร่วมอยู่ด้านบน)
; ผู้แต่ง: [http://tantek.com/ Tantek Çelik] (รายชื่อผู้มีส่วนร่วมอยู่ด้านบน)
: <span class="vcard"><span class="fn">[[User:Brian|Brian Suda (ไบรอัน ซูดา)]]</span> (<span class="url">http://suda.co.uk/</span>)</span>
: <span class="vcard"><span class="fn">[[User:Brian|Brian Suda (ไบรอัน ซูดา)]]</span> (<span class="url">http://suda.co.uk/</span>)</span>


; Acknowledgments: ดู [[hcard#Inspiration_and_Acknowledgements|acknowledgments]].
; กิตติกรรมประกาศ: ดู [[hcard#Inspiration_and_Acknowledgements|กิตติกรรมประกาศ]].


[[hcard#Copyright|copyright]] และ [[hcard#Patents|patents]] มีผลบังคับใช้ตามที่ระบุ
[[hcard#Copyright|ลิขสิทธิ์]] และ [[hcard#Patents|สิทธิบัตร]]มีผลบังคับใช้ตามที่ระบุ


== แนะนำ ==
== แนะนำ ==
Line 31: Line 31:
{{rfc-2119-intro-th}}
{{rfc-2119-intro-th}}


== รูปแบบ ==
== รายละเอียด ==
=== โดยทั่วไป ===
=== ข้อมูลเบื้องต้น ===
มาตรฐาน vCard ([[rfc-2426|RFC2426]]) เป็นพื้นฐานสำหรับ hCard
มาตรฐาน vCard ([[rfc-2426|RFC2426]]) เป็นรากฐานสำหรับ hCard


รูปแบบเบื้องต้นของ hCard คือการใช้ชื่อ object/property ของ vCard แบบตัวอักษรตัวเล็กหมดสำหรับแทนชื่อคลาส (class) และแทน vCard ที่ซ้อนๆกันด้วยอีลีเมนต์ HTML ที่ซ้อนๆกัน
รูปแบบของ hCard คือการใช้ class เพื่อแทน object/property ของ vCard โดยชื่อของ object/property นั้นจะถูกเขียนด้วยตัวอักษรตัวเล็ก ส่วน vCard ที่ซ้อนกันหลายชั้นจะแทนที่ด้วย HTML element ที่ซ้อนๆกัน


=== ชื่อคลาสราก (Root Class Name) ===
=== ชื่อคลาสราก (Root Class Name) ===
ชื่อคลาสรากสำหรับ hCard คือ "vcard"  อีลีเมนต์ที่มีคลาส "vcard" ก็เป็น ''hCard'' ด้วยเช่นกัน
ชื่อคลาสรากสำหรับ hCard คือ "vcard"  element ที่มี class "vcard" ก็เป็น ''hCard'' ด้วยเช่นกัน


=== คุณสมบัติและคุณสมบัติย่อย (Properties and Sub-properties) ===
=== คุณสมบัติและคุณสมบัติย่อย (Properties and Sub-properties) ===
The properties of an hCard are represented by elements inside the hCard. Elements with class names of the listed properties represent the values of those properties. Some properties have sub-properties, and those are represented by elements inside the elements for properties.
ข้อมูลของคุณสมบัติต่างๆ (properties) ใน hCard อยู่ใน element ที่เป็นตัวแทนของคุณสมบัติเหล่านั้น โดยที่ class ของแต่ละ element เป็นตัวบ่งบอกคุณสมบัติที่ element นั้นเป็นตัวแทน ส่วนค่าของ element ก็คือค่าของคุณสมบัตินั้นๆ
 
บางคุณสมบัติสามารถมีคุณสมบัติย่อย (sub-properties) ได้ ซึ่งคุณสมบัติย่อยเหล่านั้นจะถูกแทนค่า่ด้วย element ย่อยภายใน element ของคุณสมบัติแม่


=== รายชื่อคุณสมบัติ ===
=== รายชื่อคุณสมบัติ ===
รายชื่อคุณสมบัติ (properties) ของ hCard (คุณสมบัติย่อยหรือ sub-properties จะอยู่ในเครื่องหมายวงเล็บแบบนี้)
รายชื่อคุณสมบัติต่างๆของ hCard อยู่ในรายการด้านล่าง (คุณสมบัติย่อยจะอยู่ในเครื่องหมายวงเล็บแบบนี้)


เพื่อความกระชับ คำอธิบายภาษาไทยของแต่ละคุณสมบัติหรือคุณสมบัติย่อยจะต่อท้ายชื่อคุณสมบัติที่เป็นภาษาอังกฤษ เวลาใช้งานไมโครฟอร์แมตในเนื้อหาของคุณ กรุณาใช้ชื่อภาษาอังกฤษ
เพื่อความกระชับและความเข้าใจ คำอธิบายภาษาไทยของแต่ละคุณสมบัติหรือคุณสมบัติย่อยได้ถูกเขียนต่อท้ายชื่อคุณสมบัติที่เป็นภาษาอังกฤษ เวลาใช้งานไมโครฟอร์แมตในเนื้อหาของคุณ อย่าลืมใช้ชื่อคุณสมบัติภาษาอังกฤษนะครับ


'''จะต้องมีใน hCard:'''
'''คุณสมบัติที่จะต้องมีใน hCard:'''
* '''fn'''
* '''fn'''
* <span id="property-list-n">'''n'''<sup style="font-size:smaller">[[#note1|1]]</sup> (family-name เพื่อระบุนามสุกล, given-name ชื่อ, additional-name ชื่ออื่นๆ เช่นชื่อกลางถ้ามี, honorific-prefix คำนำหน้าชื่อ, honorific-suffix คำต่อท้ายชื่อ)</span>
* <span id="property-list-n">'''n'''<sup style="font-size:smaller">[[#note1|1]]</sup> (family-name นามสุกล, given-name ชื่อ, additional-name ชื่ออื่นๆ เช่นชื่อกลางถ้ามี, honorific-prefix คำนำหน้าชื่อ, honorific-suffix คำต่อท้ายชื่อ)</span>
มีหรือไม่มีก็ได้:
คุณสมบัติที่อาจมีหรือไม่มีก็ได้:
* nickname ชื่อเล่น, sort-string
* nickname ชื่อเล่น, sort-string วิธีการเรียงลำดับชื่อ
* url, email (type, value สำหรับชนิดของอีเมล์), <span id="property-list-n">tel เบอร์โทรศัพท์<sup style="font-size:smaller">[[#note2|2]]</sup> (type, value ชนิดของเบอร์โทรศัพท์)</span>
* url ลิงก์ในอินเตอร์เน็ต, email อีเมล์ (type ชนิดของอีเมล์, value อีเมล์สำหรับชนิดนี้), <span id="property-list-n">tel เบอร์โทรศัพท์<sup style="font-size:smaller">[[#note2|2]]</sup> (type ชนิดของเบอร์โทรศัพท์, value เบอร์โทรศัพท์สำหรับชนิดนี้)</span>
* adr ที่อยู่ (post-office-box บ้านเลขที่, extended-address ที่อยู่เพิ่มเติม เช่นซอย หมู่บ้าน ฯลฯ, street-address ถนน , locality ตำบลและอำเภย, region จังหวัด, postal-code รหัสไปรษณีย์, country-name ประเทศ, type, value), label
* adr ที่อยู่ (post-office-box บ้านเลขที่, extended-address ที่อยู่เพิ่มเติม เช่นซอย หมู่บ้าน ฯลฯ, street-address ถนน , locality ตำบลและอำเภย, region จังหวัด, postal-code รหัสไปรษณีย์, country-name ประเทศ, type, value), label
* geo พิกัดบนโลก (latitude เส้นรุ้ง, longitude เส้นแวง), tz โซนเวลา
* geo พิกัดบนโลก (latitude เส้นรุ้ง, longitude เส้นแวง), tz โซนเวลา
* photo รูปภาพ, logo โลโก้, sound, bday วันเกิด
* photo รูปภาพ, logo โลโก้, sound เสียง, bday วันเกิด
* title ชื่อตำแหน่ง, role อาชีพหรือหน้าที่การงาน, org องค์กร (organization-name ชื่อองค์กร, organization-unit หน่วยงาน)
* title ชื่อตำแหน่ง, role อาชีพหรือหน้าที่การงาน, org องค์กร (organization-name ชื่อองค์กร, organization-unit หน่วยงาน)
* category, note หมายเหตุ
* category กลุ่ม, note หมายเหตุ
* class, key, mailer, uid, rev
* class, key, mailer, uid, rev


=== หมายเหตุเกี่ยวกับคุณสมบัติ ===
=== หมายเหตุเกี่ยวกับคุณสมบัติ ===
<span id="note1">[[#property-list-n|1. ^]]</span>: คุณสมบัติชื่อ 'n' เป็นคุณสมบัติที่ {{optional-th}} ถ้า [[hcard#Implied_.22n.22_Optimization|implied 'n' optimization rules]] มีผลบังคับใช้<br />
<span id="note1">[[#property-list-n|1. ^]]</span>: คุณสมบัติ 'n' เป็นคุณสมบัติที่ {{optional-th}} ถ้า[[hcard#Implied_.22n.22_Optimization|การแทนค่าคุณสมบัติ "n" แบบเป็นนัย]]มีผลบังคับใช้<br />
<span id="note2">[[#property-list-tel|2. ^]]</span>: tel - สำหรับคุณสมบัติ tel ผู้ใช้ {{may-th}} ให้ใช้รูปแบบเบอร์โทรศัพท์ตามมาตรฐาน [http://en.wikipedia.org/wiki/E.123 E.123] ได้ ตัวอักษรที่อยู่ในรูปแบบ (เช่น +1-555-FORMATS) {{must-th}} ถูกแทนที่ด้วยตัวเลข  คุณสามารถใช้ <code>abbr</code> เพื่อแสดงตัวอักษรและให้ค่าตัวเลขไปพร้อมๆกัน เช่น <code><nowiki><abbr title="+15553676287">+1-555-FORMATS</abbr></nowiki></code>.
<span id="note2">[[#property-list-tel|2. ^]]</span>: tel - สำหรับคุณสมบัติ tel ผู้ใช้ {{may-th}} ให้ใช้รูปแบบเบอร์โทรศัพท์ตามมาตรฐาน [http://en.wikipedia.org/wiki/E.123 E.123] ได้ โดยที่ตัวอักษรที่อยู่ในรูปแบบ (เช่น +1-555-FORMATS) {{must-th}} ถูกแทนที่ด้วยตัวเลข  นอกจากนั้นคุณยังสามารถใช้ <code>abbr</code> เพื่อแสดงตัวอักษรและระบุึ้ค่าตัวเลขไปพร้อมๆกัน เช่น <code><nowiki><abbr title="+15553676287">+1-555-FORMATS</abbr></nowiki></code>.
 
=== คุณสมบัติที่เป็นเอกพจน์และพหูพจน์ ===
คุณสมบัติที่เป็นเอกพจน์มีดังนี้: 'fn', 'n', 'bday', 'tz', 'geo', 'sort-string', 'uid', 'class'
 
สำหรับคุณสมบัติเหล่านี้ กรณีที่มี element มากกว่าหนึ่งตัวที่เป็นตัวแทนของคุณสมบัติเดียวกัน ให้ถือว่า element ตัวแรกเท่านั้นที่มีความหมาย


=== คุณสมบัติที่เป็นเอกพจน์ vs. พหูพจน์ ===
คุณสมบัติอื่นๆ {{may-th}} เป็นพหูพจน์ได้  และการใช้คุณสมบัติเหล่านี้แต่ละครั้งเป็นการสร้างค่าใหม่ขึ้นมา
คุณสมบัติที่เป็นเอกพจน์: 'fn', 'n', 'bday', 'tz', 'geo', 'sort-string', 'uid', 'class'  สำหรับคุณสมบัติที่เป็นเอกพจน์ element ลูกตัวแรกที่มี class ของคุณสมบัติเท่านั้นที่ {{should-th}} มีความหมาย ตัวอื่นๆที่มี class เดียวกันจะไม่ถูกนำมาใช้เพราะถือว่าไม่มีความหมาย


คุณสมบัติอื่นๆ {{may-th}} เป็นพหูพจน์ได้  และแต่ละการใช้งานของ class ที่เป็นคุณสมบัติเหล่านี้จะถือว่าเป็นการสร้างคุณสมบัติใหม่ขึ้นมา
=== เนื้อหาสำหรับคนและเครื่อง ===
ค่าต่างๆของคุณสมบัติ ใน hCard ปกติจะมาจากเนื้อหาที่คนอ่านได้บนหน้าเว็บ โดยมีข้อยกเว้นบางประการ:


=== Human vs. Machine readable ===
ถ้ามีการใช้ <code>&lt;abbr&gt;</code> ให้ใส่ค่าของคุณสมบัตินั้น (ซึ่งก็คือชื่อเต็ม) ใน attribute '<code>title</code>' (ของ &lt;abbr&gt;)  ส่วนเนื้อหาของ <code>&lt;abbr&gt;</code> จะใช้เพื่อแสดงคำย่อแทนเพื่อให้อ่านง่ายขึ้น
The human visible text contents of an element for a property represents the value of that property, with a few exceptions:


If an <code>&lt;abbr&gt;</code> element is used for a property, then the '<code>title</code>' attribute (if present) of the <code>&lt;abbr></code> element is the value of the property, instead of the contents of the element, which instead provide a more human presentable version of the value.
ถ้ามีการใช้ <code>&lt;a&gt;</code> {{must-th}} ทำตามกฏเหล่านี้:
# สำหรับคุณสมบัติ 'photo' และคุณสมบัติอื่นๆที่มีค่าเป็น URL ให้ใส่ค่าของคุณสมบัตินั้นใน attribute <code>href="..."</code>
# สำหรับคุณสมบัติอื่นๆที่ค่าไม่ใช่ URL ให้ใส่ค่าของคุณสมบัติในเนื้อหาของ <code>&lt;a&gt;</code>


If an <code>&lt;a&gt;</code> element is used for one or more properties, it {{must}} be treated as follows:
ถ้ามีการใช้ <code>&lt;img&gt;</code> {{must-th}} ทำตามกฏเหล่านี้:
# For the 'photo' property and any other property that takes a URL as its value, the <code>href="..."</code> attribute provides the property value.
# สำหรับคุณสมบัติ 'photo' และคุณสมบัติอื่นๆที่มีค่าเป็น URL ให้ใส่ค่าของคุณสมบัตินั้นใน attribute <code>src="..."</code>
# For other properties, the element's content is the value of the property.
# สำหรับคุณสมบัติอื่นๆที่ค่าไม่ใช่ URL ให้ใส่ค่าของคุณสมบัตินั้นใน attribute '<code>alt</code>'


If an <code>&lt;img&gt;</code> element is used for one or more properties, it {{must}} be treated as follows:
ถ้ามีการใช้ <code>&lt;object&gt;</code> {{must-th}} ทำตามกฏเหล่านี้:
# For the 'photo' property and any other property that takes a URL as its value, the <code>src="..."</code> attribute provides the property value.
# สำหรับคุณสมบัติ 'photo' และคุณสมบัติอื่นๆที่มีค่าเป็น URL ให้ใส่ค่าของคุณสมบัตินั้นใน attribute <code>data="..."</code>
# For other properties, the <code>&lt;img></code> element's '<code>alt</code>' attribute is the value of the property.
# สำหรับคุณสมบัติอื่นๆที่ค่าไม่ใช่ URL ให้ใส่ค่าของคุณสมบัตินั้นในเนื้อหาของ <code>&lt;object&gt;</code>


If an <code>&lt;object&gt;</code> element is used for one or more properties, it {{must}} be treated as follows:
=== การตัดตอนเนื้อหาเพื่อแทนค่าของคุณสมบัติ ===
# For the 'photo' property and any other property that takes a URL as its value, the <code>data="..."</code> attribute provides the property value.
ในบางครั้งแค่ส่วนใดส่วนหนึ่งของ element ถูกใช้แทนค่าของคุณสมบัติ เช่นในคุณสมบัติย่อยของ 'tel' ที่ใช้แทนชนิดของบอร์โทรศัพท์  สำหรับกรณีนี้ให้ใช้ชื่อ class "<code>value</code>" เพื่อตัดตอนเนื้อหาส่วนที่แทนค่าของคุณสมบัติใน markup
# For other properties, the element's content is the value of the property.


=== Value excerpting ===
ด้านล่างเป็นตัวอย่างของการใช้ class นี้สำหรับแทนค่าเบอร์โทรศัพท์บ้าน:<br/>
Sometimes only part of an element which is the equivalent for a property is used for the value of the property.  This typically occurs when a property has a subtype, like 'tel'. For this purpose, the special class name "<code>value</code>" is used to excerpt out the subset of the element that is the value of the property. E.g. here is an hCard fragment for marking up a home phone number:<br />


vCard:
vCard:
Line 103: Line 109:
</nowiki></pre>
</nowiki></pre>


This hCard fragment could be displayed as:
hCard นี้สามารถแสดงผลเป็น:


<div style="border: thin dashed black; width: 95%; padding: .5em 1em;">
<div style="border: thin dashed black; width: 95%; padding: .5em 1em;">
Line 114: Line 120:
<!-- note for Tantek: review/edit property casing from here on -->
<!-- note for Tantek: review/edit property casing from here on -->


=== Property Exceptions ===
=== คุณสมบัติที่ไม่ใช้ ===
vCard has several properties which either do not make sense on, or are already implied within the context of a web page. This section explains what to (not) do with them.
vCard มีคุณสมบัติบางอันที่ไม่มีความหมายสำหรับเนื้อหาในหน้าเว็บ  เนื้อหาส่วนนี้อธิบายว่าทำไมคุณไม่ควรใช้คุณสมบัติเหล่านั้น
 
# คุณสมบัติ '''NAME''', '''PROFILE''', '''SOURCE''', '''PRODID''', และ '''VERSION''' ของ vCard ถูกอธิบายในหัวข้อ 2.1.2, 2.1.3, 2.1.4, 3.6.3, และ 3.6.9 ของ [[rfc-2426|RFC2426]]  ผู้เผยแพร่เนื้อหา{{must-not-th}}ใช้คุณสมบัติเหล่านี้ใน hCard และผู้ใช้เนื้อหานี้{{must-th}}ไม่นำคุณสมบัติเหล่านี้มาใช้ถ้ามีอยู่ใน hCard
# เมื่อมีการแปลงจาก vCard เป็น hCard คุณ {{should-th}} ใช้ชื่อของหน้าเว็บที่มี hCard (จาก <code>&lt;title&gt;</code> ของเอกสาร HTML) เพื่อสร้างคุณสมบัติ NAME
# {{may}} output a PROFILE value of "<code>VCARD</code>" per [[rfc-2426|RFC2426]], {{should}} use the URL of the page where the hCard is found to construct the SOURCE property (e.g. perhaps as a parameter to a URL/service that converts hCards to vCards), for an output vCard stream (e.g. a .vcf file). Only services/applications that output actual vCards should write the PRODID property, with the product identifier for said service/application. Similarly, only such services/applications should write the VERSION property, with the value "3.0" (without quotes) per [[rfc-2426|RFC2426]] Section 3.6.9.


# vCard's '''NAME''', '''PROFILE''', '''SOURCE''', '''PRODID''', '''VERSION''' properties are defined in Sections 2.1.2, 2.1.3, 2.1.4, 3.6.3, 3.6.9 of [[rfc-2426|RFC2426]].  Content publishers {{must-not}} use these properties in their hCards, and as such, hCard consumers/parsers {{must}} IGNORE these properties if they are found within an hCard. Instead. hCard to vCard converters {{should}} use the title of the page where the hCard is found (e.g. the <code><title></code> element in HTML documents) to construct the NAME property, {{may}} output a PROFILE value of "<code>VCARD</code>" per [[rfc-2426|RFC2426]], {{should}} use the URL of the page where the hCard is found to construct the SOURCE property (e.g. perhaps as a parameter to a URL/service that converts hCards to vCards), for an output vCard stream (e.g. a .vcf file). Only services/applications that output actual vCards should write the PRODID property, with the product identifier for said service/application. Similarly, only such services/applications should write the VERSION property, with the value "3.0" (without quotes) per [[rfc-2426|RFC2426]] Section 3.6.9.
=== ที่อยู่ติดต่อสำหรับองค์กร ===
ถ้าคุณสมบัติ "FN" และ "ORG" มีค่าเดียวกัน (ซึ่งอาจเกิดได้เพราะคุณสมบัติทั้งสองถูกใช้พร้อมกันในหนึ่ง element เช่น class="fn org") ให้ถือว่า hCard นั้นเป็น hCard สำหรับบริษัท องค์กร หรือสถานที่และ {{should-th}} ถูกใช้ในความหมายนี้  ในกรณีนี้ผู้สร้าง hCard {{must-not-th}} ใส่ค่า หรือใส่เป็นค่าว่างๆ (empty string) สำหรับคุณสมบัติ "N" และคุณสมบัติย่อยของมัน  นอกจากนั้น parser {{should-th}} รองรับกรณีที่ไม่มีคุณสมบัติ "N" ใน hCard ด้วย


=== Organization Contact Info ===
=== การแทนค่าคุณสมบัติ "n" แบบเป็นนัย ===
If the "FN" and "ORG" properties have the exact same value (typically because they are set on the same element, e.g. class="fn org"), then the hCard represents contact information for a company, organization or place and {{should}} be treated as such. In this case the author also {{must-not}} set the "N" property, or set it (and any sub-properties) explicitly to the empty string "". Thus parsers {{should}} handle the missing "N" property, in this case by implying empty values for all the "N" sub-properties.
ถึงแม้ว่ามาตรฐาน vCard บังคับให้คุณต้องใส่ค่าสำหรับคุณสมบัติ "N" แต่ในตัวอย่างท้ายมาตรฐาน vCard ([[rfc-2426|RFC2426]]) (หน้า 38) เองก็ไม่ได้ใส่คุณสมบัตินี้  ทำให้เกิดความขัดแย้งกับมาตรฐานขึ้น  เราสามารถแก้ไขความขัดแย้งนี้โดยการใช้ "FN" แทนที่ "N" ในการใช้งานทั่วๆไป


=== Implied "n" Optimization ===
ถ้าค่าของ "FN" และ "ORG" แตกต่างกัน (ลองดูในหมวดก่อนหน้า) และค่าของ "FN" มีความยาวเท่ากับสองคำ (คั่นด้วยเว้นวรรค) และก็ไม่มีการระบุคุณสมบัติ "N" ในที่ใดๆอีก ให้ถือว่าค่าของ "N" นั้นคือค่าของ คุณสมบัติ "FN"
Although vCard requires that the "N" property be present, the authors of the vCard specification ([[rfc-2426|RFC2426]]) themselves do not include "N" properties in their vCards near the end of the spec (p.38).  This apparent contradiction can be resolved by simply allowing the "FN" property to imply "N" property values in typical cases provided in the spec. We do so explicitly in hCard.


If "FN" and "ORG" are not the same (see previous section), and the value of the "FN" property is exactly two words (separated by whitespace), and there is no explicit "N" property, then the "N" property is inferred from the "FN" property. For "FN"s with either one word see below, and for three or more, the author {{must}} explicitly markup the "N", except for the organization contact info case, [http://microformats.org/wiki/hcard#Organization_Contact_Info see above] for that.
สำหรับ "FN" ที่มีคำแค่คำเดียวให้ดูด้านล่าง และสำหรับ "FN" ทีมีสามคำขึ้นไป ผู้แต่ง {{must-th}} ระบุ markup "N" ยกเว้นในกรณีของที่อยู่ติดต่อขององค์กร [http://microformats.org/wiki/hcard#Organization_Contact_Info ดูด้านบน]


# The content of "FN" is broken into two "words" separated by whitespace.
# เนื้อหาของ "FN" แบ่งออกเป็นสอง "คำ" คั่นด้วยเว้นวรรค
# The ''first'' word of the "FN" is interpreted as the "given-name" for the "N" property.
# ''คำแรก'' ของ "FN" แทนความหมายของ "ชื่อ" ในคุณสมบัติ "N"
# The ''second/last'' word of the "FN" is interpreted as the "family-name" for the "N" property.
# ''คำที่สอง'' ของ "FN" แทนความหมายของ "นามสกุล" ในคุณสมบัติ "N"
# Exception: If the first word ends in a "," comma OR if the second word is a single character (optionally followed by a period "."), then the first word (minus the comma at the end if any) is interpreted as the "family-name" and the second word is interpreted as the "given-name".
# ข้อยกเว้น: ถ้าคำแรกลงท้ายด้วยคอมม่า หรือถ้าคำที่สองมีตัวอักษรเดียว (โดยมีหรือไม่มีจุดต่อท้าย) ให้ถือว่าคำแรก (ไม่รวมคอมม่า ถ้ามี) เป็น "นามสกุล" และคำที่สองคือ "ชื่อ"


This allows simplification in the typical case of people stating:
กฏนี้จะทำให้การใช้งานโดยทั่วๆเหล่านี้ทำได้ง่ายขึ้น:
* given-name (space) family-name
* ชื่อ (เว้นวรรค) ​นามสกุล
* family-name (comma) given-name
* นามสกุล (คอมม่า) ชื่อ
* family-name (comma) given-name-first-initial
* นามสกุล (คอมม่า) ตัวอักษรแรกของชื่อ
* family-name (space) given-name-first-initial (optional period)
* นามสกุล (เว้นวรรค) ตัวอักษรแรกของชื่อ (จุด ถ้ามี)


=== Implied "nickname" Optimization ===
หมายเหตุจากผู้แปล: สองกรณีหลังเป็นกรณีที่ใช้บ่อยในชื่อภาษาอังกฤษ ซึ่งอาจไม่ได้ใช้สำหรับภาษาไทย ในภาษาอังกฤษนาย John Smith อาจะจะเขียนชื่อเป็น Smith, John หรือ Smith, J. หรือ Smith J ก็ได้ ในขณะที่ชื่อภาษาไทยไม่มีการใช้รูปแบบอย่างนี้
Due to the prevalence of the use of nicknames/handles/usernames in actual content published on the Web (e.g. authors of [[hReview|reviews]]), hCard also has an implied "nickname" optimization to handle this.


Similar to the implied "n" optimization, if "FN" and "ORG" are not the same, and the value of the "FN" property is exactly one word, and there is no explicit "N" property, then:
=== การแทนค่าคุณสมบัติ "nickname" แบบเป็นนัย ===
เนื่องจากมีการใช้ชื่อเล่น/นามแฝง/ชื่อผู้ใช้อย่างแพร่หลายในเนื้อหาต่างๆในอินเตอร์เน็ต (เช่นโดยผู้เขียน [[hReview|reviews]]) hCard เองก็มีวิธีการระบุชื่อเล่นเช่นกัน


# The content of the "FN" {{must}} be treated as a "nickname" property value.
คล้ายๆกับการแทนค่า "N" แบบเป็นนัย  ถ้า "FN" และ "ORG" มีค่าต่างกันและค่าของ "FN" เป็นคำที่มีความยาวหนึ่งคำ และไม่มีการระบุคุณสมบัติ "N" อื่นๆ:
# Parsers {{should}} handle the missing "N" property by implying empty values for all the "N" sub-properties.


Though parsers {{must}} follow the implied nickname optimization, publishers {{should}} explicitly indicate the "nickname" even in this case, e.g.:
# เนื้อหาของ "FN" {{must-th}} มีค่าเป็น "ชื่อเล่น"
# Parser {{should-th}} รองรับกรณีที่ไม่มีคุณสมบัติ "N" โดยสันนิษฐานว่าค่าของคุณสมบัตินี้และคุณสมบัติย่อยของมันเป็นค่าว่าง (empty value)
 
ถึงแม้ว่า parser {{must-th}} ทำตามกฏที่กล่าวไว้ข้างต้น ผู้เขียนข้อมูลเองก็ {{should-th}} ระบุ "ชื่อเล่น" ให้ชัดเจนเช่นกัน ยกตัวอย่างเช่น:


<pre><nowiki>
<pre><nowiki>
Line 154: Line 166:
</nowiki></pre>
</nowiki></pre>


The hCard {{may}} have additional explicit "nickname" property values in addition to the implied nickname.
นอกเหนือจากค่า "nickname" ที่ได้มาแบบเป็นนัยจากการใช้ "FN" แล้ว ผู้ใช้ {{may-th}} ระบุค่า "nickname" อื่นๆใน hCard ได้เพิ่มเติมเช่นกัน


=== Implied "organization-name" Optimization ===
=== การแทนค่าคุณสมบัติ "organization-name" แบบเป็นนัย ===
The "ORG" property has two subproperties, organization-name and organization-unit. Very often authors only publish the organization-name. Thus if an "ORG" property has no "organization-name" inside it, then its entire contents {{must}} be treated as the "organization-name".
คุณสมบัติ "ORG" มีสองคุณสมบัติย่อยคือ organization-name (ชื่อ) และ organization-unit (หน่วยงาน) บ่อยครั้งที่ผู้เขียนต้องการเผยแพร่แค่ชื่อองค์กรอย่างเดียว ซึ่งในกรณีนี้ผู้เขียนไม่ต้องใส่คุณสมบัติย่อย "organization-name" แต่ {{must-th}} ใส่ชื่อองค์กรในเนื้อหาของ element แทน


=== Tags as Categories ===
=== การใช้ Tag เพื่อจัดกลุ่ม ===
Categories in hCard {{may}} be represented by tags with [[rel-tag]]. When a category property is a rel-tag, the tag (as defined by rel-tag) is used for that category.
คุณ {{may-th}} แทนคุณสมบัติกลุ่มใน hCard ได้โดยการใช้ tag ผ่าน [[rel-tag]] เมื่อคุณสมบัติ category เป็น rel-tag ค่าของ tag นั้นถือเป็นชื่อของกลุ่ม


=== type subproperty values ===
=== ค่าของคุณสมบัติย่อย type ===
The 'type' subproperty in particular takes different values depending on which property it is a subproperty of. These 'type' subproperty values are case-INSENSITIVE, meaning "Home" is the same as "home", as well as multivalued, e.g. a tel can be home and preferred:
ค่าของคุณสมบัติย่อย 'type' (ชนิด) ขึ้นอยู่กับคุณสมบัติหลักที่ใช้มัน ค่าของ 'type' ไม่มีความแตกต่างระหว่างตัวอักษรเล็กหรือใหญ่ หมายความว่าค่า "Home" มีค่าเท่ากับ "home" นอกจากนั้นค่าของ 'type' ก็สามารถมีได้หลายค่า เช่น. เบอร์โทรศัทพ์ (คุณสมบัติ tel) สามารถเป็นได้ทั้งเบอร์บ้าน (home) และเบอร์ติดต่อหลัก (preferred):


vCard:
vCard:
Line 177: Line 189:
</nowiki></pre>
</nowiki></pre>


This could be displayed as:
ซึ่งสามารถแสดงผลได้เป็น:


<div style="border: thin dashed black; width: 95%; padding: .5em 1em; ">
<div style="border: thin dashed black; width: 95%; padding: .5em 1em; ">
Line 185: Line 197:
</div>
</div>


==== type with unspecified value ====
==== คุณสมบัติที่ไม่ระบุค่า ====
When the type of a property is specified, and there is no explicit value specified, then everything in the property except for the type is considered the value of the property. E.g.
เมื่อมีการระบุคุึณสมบัติย่อย 'type' แต่ไม่มีการระบุค่าขอบคุณสมบัติย่อยนี้ผ่าน 'value' ให้ถือว่าอะไรก็ตามที่อยู่ในคุณสมบัติหลักเป็น 'value'  ยกตัวอย่างเช่น


<pre><nowiki>
<pre><nowiki>
Line 192: Line 204:
</nowiki></pre>
</nowiki></pre>


is equivalent to:
มีค่าเท่ากับ:


<pre><nowiki>
<pre><nowiki>
Line 198: Line 210:
</nowiki></pre>
</nowiki></pre>


And thus the type is "home" and the value is "+1.415.555.1212".
ซึ่งหมายความว่าชนิดของเบอร์โทรศัพท์นี้เป็นโทรศัพท์บ้าน ("home") และค่าของมัน ("value") ก็คือ "+1.415.555.1212".
 
==== type สำหรับคุณสมบัติ adr tel และ email ====
รายละเอียดด้านล่างมีไว้เพื่อ ''ให้ข้อมูลอ้างอิง''  กรุณาดู [[rfc-2426|RFC2426]] บทที่ 3.2.1 ADR, 3.3.1 TEL, และ 3.3.2 EMAIL เพื่อดูรายละเอียดเพิ่มเติม  ข้อมูลในที่นี้ได้ถูกคัดลอกมาเพื่อความสะดวกในการอ่าน


==== adr tel email types ====
ค่าที่เลือกโดยอัตโนมัติหรือค่า default คือค่าแรกที่อยู่ในแต่ละรายการด้านล่างและเขียนด้วยตัวอักษรใหญ่ทั้งหมด  คุณสมบัติย่อย 'type' สำหรับคุณสมบัติเหล่านี้สามารถมีได้มากกว่าหนึ่งค่า
The following lists are ''informative''. See [[rfc-2426|RFC2426]] sections 3.2.1 ADR, 3.3.1 TEL, and 3.3.2 EMAIL respectively for normative type values.  They are repeated here for convenience. Default type subproperty value(s) is(are) first in each list and indicated in ALL CAPS.  types may be multivalued.


* adr type: INTL, POSTAL, PARCEL, WORK, dom, home, pref
* ค่าของ 'type' เมื่อใช้กับคุณสมบัติ adr: INTL, POSTAL, PARCEL, WORK, dom, home, pref
* tel type: VOICE, home, msg, work, pref, fax, cell, video, pager, bbs, modem, [http://flickr.com/photos/tags/carcellphone/ car], isdn, pcs
* ค่าของ 'type' เมื่อใช้กับคุณสมบัติ tel: VOICE, home, msg, work, pref, fax, cell, video, pager, bbs, modem, [http://flickr.com/photos/tags/carcellphone/ car], isdn, pcs
* email type: INTERNET, x400, pref, "other IANA registered address types"
* ค่าของ 'type' เมื่อใช้กับคุณสมบัติ email: INTERNET, x400, pref, "other IANA registered address types"


=== XMDP Profile ===
=== XMDP Profile ===
Line 300: Line 314:
* ปุ่มที่สร้างด้วย CSS จากที่เห็นที่ [http://re-run.com/about/microformat-badges microformat badges @ re-run]
* ปุ่มที่สร้างด้วย CSS จากที่เห็นที่ [http://re-run.com/about/microformat-badges microformat badges @ re-run]


== Examples in the wild ==
== ตัวอย่างในอินเตอร์เน็ต ==
This section is '''informative'''. The number of hCard examples in the wild has expanded far beyond the capacity of being kept inline in this specification. They have been moved to a [[hcard-examples-in-wild|separate page]].
ส่วนนี้มีไว้เพื่ออ้างอิง  จำนวนตัวอย่างของการใช้ hCard ในอินเตอร์เน็ตได้ขยายมากเกินกว่าที่จะนำมาใส่ในหน้านี้ได้ ทำให้ตัวอย่างได้ถูกย้ายไปที่[[hcard-examples-in-wild|อีกหน้าหนึ่ง]]


See [[hcard-examples-in-wild|hCard Examples in the wild]].
ดู [[hcard-examples-in-wild|ตัวอย่างของ hCard ในอินเตอร์เน็ต]]


== Implementations ==
== Implementations ==
Line 310: Line 324:
See [[hcard-implementations|hCard Implementations]].
See [[hcard-implementations|hCard Implementations]].


== Copyright ==
== ลิขสิทธิ์ ==
Per the public domain release on the authors' user pages ([[User:Tantek|Tantek Çelik]], [[User:Brian|Brian Suda]]) this specification is released into the public domain.
ตามที่ผู้แต่ง ([[User:Tantek|Tantek Çelik]], [[User:Brian|Brian Suda]]) ได้ระบุไว้ เอกสารฉบับนี้ได้รับอนุญาติให้เผยแพร่กับสาธารณะได้


{{MicroFormatPublicDomainContributionStatement}}
{{MicroFormatPublicDomainContributionStatement}}
Line 318: Line 332:
{{MicroFormatPatentStatement}}
{{MicroFormatPatentStatement}}


== References ==
== ข้อมูลอ้างอิง ==
=== Normative References ===
=== ข้อมูลอ้างอิงเกี่ยวกับมาตรฐาน ===
* [http://www.w3.org/TR/2002/REC-xhtml1-20020801/ XHTML 1.0 SE]
* [http://www.w3.org/TR/2002/REC-xhtml1-20020801/ XHTML 1.0 SE]
* [http://www.ietf.org/rfc/rfc2426.txt vCard RFC2426]
* [http://www.ietf.org/rfc/rfc2426.txt vCard RFC2426]
* [http://www.itu.int/rec/T-REC-E.123-200102-I/en ITU recommendation E.123] format of telephone numbers (chargeable document)
* [http://www.itu.int/rec/T-REC-E.123-200102-I/en ITU recommendation E.123] รูปแบบของเบอร์โทรศัพท์ (เอกสารที่อาจจะต้องจ่ายเงินเพื่อดู)
* [[rfc-2119|RFC 2119]]
* [[rfc-2119|RFC 2119]]


=== Informative References ===
=== ข้อมูลอ้างอิงทั่วไป ===
* [[hcard-history|hCard history]]
* [[hcard-history|ประวัติของ hCard]]
** [http://wiki.oreillynet.com/foocamp04/index.cgi?SimpleSemanticFormats FOO Camp 2004 Simple Semantic Formats presentation, 2004-09-10]
** [http://wiki.oreillynet.com/foocamp04/index.cgi?SimpleSemanticFormats FOO Camp 2004 การนำเสนอเรื่อง Simple Semantic Formats, 2004-09-10]
** [http://tantek.com/log/2004/09.html#hcard hCard term introduced and defined on the Web, 2004-09-30]
** [http://tantek.com/log/2004/09.html#hcard แนะนำความหมายของ hCard, 2004-09-30]
** Contributed from http://developers.technorati.com/wiki/hCard 2005-06-20
** ข้อมูลจาก http://developers.technorati.com/wiki/hCard 2005-06-20
* [http://www.dante.net/np/ds/osi/9594-6-X.520.A4.ps X.520 in Postscript] ([http://72.14.253.104/search?q=cache:FjqzsFu4h20J:www.dante.net/np/ds/osi/9594-6-X.520.A4.ps HTMLization courtesy of Google Cache]) - vCard refers to ROLE as being "based on the X.520 Business Category explanatory attribute".
* [http://www.dante.net/np/ds/osi/9594-6-X.520.A4.ps X.520 ใน Postscript] ([http://72.14.253.104/search?q=cache:FjqzsFu4h20J:www.dante.net/np/ds/osi/9594-6-X.520.A4.ps HTMLization courtesy of Google Cache]) - vCard refers to ROLE as being "based on the X.520 Business Category explanatory attribute".
* [http://www.w3.org/2002/12/cal/rfc2426 HTML reformatted version of RFC2426]
* [http://www.w3.org/2002/12/cal/rfc2426 RFC2426 ในรูปแบบ HTML]
* [http://w3.org/TR/REC-CSS1 CSS1]
* [http://w3.org/TR/REC-CSS1 CSS1]
* [http://www.w3.org/TR/xhtml11 XHTML 1.1]
* [http://www.w3.org/TR/xhtml11 XHTML 1.1]
* [http://en.wikipedia.org/wiki/E.123 Wikipedia summary of ITU-T Recommendation E.123] - for "TEL" values.
* [http://en.wikipedia.org/wiki/E.123 สรุปมาตรฐาน ITU-T Recommendation E.123 จากวิกิพีเดีย] - สำหรับค่า "TEL" (เบอร์โทรศัพท์)
* [http://www.imc.org/pdi/ Internet Mail Consortium Personal Data Interchange vCard and vCalendar]
* [http://www.imc.org/pdi/ Internet Mail Consortium Personal Data Interchange vCard and vCalendar]
* [[iso-8601|ISO8601]]
* [[iso-8601|ISO8601]]


==== Specifications That Use hCard ====
==== Specifications อื่นๆที่ใช้ hCard ====
* [[adr]]
* [[adr]]
* [[geo]]
* [[geo]]
Line 344: Line 358:
* [[hreview|hReview]]
* [[hreview|hReview]]


==== Similar Work ====
==== งานที่คล้ายกัน ====
* [http://www.intertwingly.net/wiki/pie/PaceBetterPersonElement Atom PaceBetterPersonElement]
* [http://www.intertwingly.net/wiki/pie/PaceBetterPersonElement Atom PaceBetterPersonElement]
* [http://www.jabber.org/jeps/jep-0054.html JEP-0054: vcard-temp]
* [http://www.jabber.org/jeps/jep-0054.html JEP-0054: vcard-temp]


== Inspiration and Acknowledgments ==
== แรงบันดาลใจและกิตติกรรมประกาศ ==
Thanks to: my good friend [http://vadim.com/ Vadim] who introduced me to vCard ''many'' years ago, and if I'd only paid more attention then, perhaps I could have helped a lot of people avoid wasting a lot of time reinventing various standards wheels.
ขอบคุณ: เพื่อนที่ดีของผม [http://vadim.com/ Vadim] ซึ่งทำให้ผมได้รู้จักกับ vCard ''หลาย'' ปีที่แล้ว  ถ้าผมใ่ส่ใจในเรื่องนี้มากกว่านี้สักหน่อยในตอนนั้น ผมคงจะช่วยให้หลายๆคนไม่ต้องเสียเวลาสร้างมาตรฐานใหม่เพื่อที่ทำสิ่งเดียวกับมาตรฐานที่มีอยู่แล้ว


== Notes on derivation from vCard ==
== บันทึกเกี่ยวกับส่วนดัดแปลงจาก vCard ==
This section is ''informative''.
ส่วนนี้มีไว้เพื่อ ''อ้างอิง''


<div id="Semantic_XHTML_Design_Principles">See: [[hcard-design-methodology]].</div>
<div id="Semantic_XHTML_Design_Principles">ดู: [[hcard-design-methodology]].</div>


=== More Semantic Equivalents ===
=== More Semantic Equivalents ===
Line 363: Line 377:
* <code>UID</code> in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.
* <code>UID</code> in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.


=== Singular and Plural derivations ===
=== ส่วนดัดแปลงเกี่ยวกับการใช้เอกพจน์และพหูพจน์ ===
The [[hcard#Singular_vs._Plural_Properties|lists of singular and plural properties]] have been derived by analyzing the semantics of the individual properties in vCard RFC2426 and determining logically that they MUST be singular per their semantics.  See [[hcard-singular-properties]] for explanations.
[[hcard#Singular_vs._Plural_Properties|รายชื่อคุณสมบัติที่เป็นเอกพจน์และพหูพจน์]] ได้มาจากการวิเคราะห์ความหมายของแต่ละคุณสมบัติใน vCard RFC2426 และตัดสินใจว่าคุณสมบัติไหน{{must-th}}เป็นเอกพจน์โดยดูตามความหมายของคุณสมบัตินั้นๆ ดูคำอธิบายเพิ่มเติมที่ [[hcard-singular-properties]]


==== Plural Properties Singularized ====
==== Plural Properties Singularized ====
Since plural property names become their singular equivalents, even if the original plural property permitted only a single value with multiple components, those multiple components are represented each with their own singularly named property and the the property is effectively multivalued and subject to the above treatment of multivalued properties.
Since plural property names become their singular equivalents, even if the original plural property permitted only a single value with multiple components, those multiple components are represented each with their own singularly named property and the the property is effectively multivalued and subject to the above treatment of multivalued properties.


== Further Reading ==
== เอกสารสำหรับอ่านเพิ่มเติม ==
* [http://www.digital-web.com/articles/microformats_primer/ Digital Web Magazine: Microformats Primer] by Garrett Dimon has a good intro to hCard
* [http://www.digital-web.com/articles/microformats_primer/ Digital Web Magazine: Microformats Primer] โดยการ์เร็ท ไดมอน มีการแนะนำ hCard ที่ดี
* [http://24ways.org/advent/practical-microformats-with-hcard Practical Microformats with hCard] by Drew McLellan
* [http://24ways.org/advent/practical-microformats-with-hcard Practical Microformats with hCard] โดยดรูว์ แม็คเลลแลน
* [http://www.naturalsearchblog.com/archives/2006/09/28/tips-for-local-search-engine-optimization-for-your-site/ Local Search Engine Optimization using Microformats] by Chris Silver Smith
* [http://www.naturalsearchblog.com/archives/2006/09/28/tips-for-local-search-engine-optimization-for-your-site/ Local Search Engine Optimization using Microformats] โดยคริส ซิลเวอร์ สมิธ
* [http://thedredge.org/ Andrew D. Hume] has written a blog post on [http://usabletype.com/articles/2005/usable-microformats/ usable microformats] which discusses hCard
* [http://thedredge.org/ Andrew D. Hume] ได้เขียนบล๊อกเกี่ยวกับ [http://usabletype.com/articles/2005/usable-microformats/ usable microformats] ซึ่งพูดถึง hCard
* [http://www.thefutureoftheweb.com/blog/2006/1/hcard Jesse Skinner's introduction to hCard]
* [http://www.thefutureoftheweb.com/blog/2006/1/hcard Jesse Skinner's introduction to hCard]
* [http://blog.usweb.com/ Shaun Shull's] great post on [http://blog.usweb.com/archives/how-microformats-affect-search-engine-optimization-seo How Microformats Affect SEO], including his [[hcard|hCard]] as an example.
* [http://blog.usweb.com/ Shaun Shull's] great post on [http://blog.usweb.com/archives/how-microformats-affect-search-engine-optimization-seo How Microformats Affect SEO], including his [[hcard|hCard]] as an example.
* [http://24ways.org/2006/styling-hcards-with-css 24 Ways: Styling hCards with CSS] A 24 Ways article - John Allsopp on styling hCard using CSS  
* [http://24ways.org/2006/styling-hcards-with-css 24 Ways: Styling hCards with CSS] A 24 Ways article - John Allsopp on styling hCard using CSS  
* See also [http://www.technorati.com/cosmos/referer.html blogs discussing this page] and the [http://technorati.com/tags/hcard hCard tag]
* See also [http://www.technorati.com/cosmos/referer.html blogs discussing this page] and the [http://technorati.com/tags/hcard hCard tag]
* [http://www.rfc-editor.org/rfc/rfc4770.txt RFC 4770 - Extensions for Instant Messaging]
* [http://www.rfc-editor.org/rfc/rfc4770.txt RFC 4770 - ส่วนต่อขยายของ Instant Messaging]


== Related Pages ==
== Related Pages ==
{{hcard-related-pages}}
{{hcard-related-pages}}

Latest revision as of 13:29, 6 August 2008

hCard

hCard เป็นรูปแบบไมโครฟอร์แมตที่เรียบง่ายที่ใช้เป็นสัญลักษณ์ของผู้คน บริษัท องค์กร และสถานที่ hCardใช้คุณสมบัติต่างๆจากมาตรฐาน vCard (ใน RFC2426) และใช้งานผ่าน HTML หรือ XHTML

hCard เป็นหนึ่งในไม่กี่มาตรฐานเปิดใน ไมโครฟอร์แมต ที่เหมาะสำหรับการนำไป embed ใน HTML, XHTML, Atom, RSS, และ XML

อยากจะเริ่มเขียน hCard แล้วหรือยัง? ลองดูที่ เครื่องมือสร้าง hCard เพื่อสร้างที่อยู่ติดต่อ หรือจะลองอ่าน เกร็ดในการสร้าง hCard เพื่อ mark up หน้าเว็บติดต่อของคุณดูก็ได้

ข้อกำหนด

ผู้แต่ง
Tantek Çelik (รายชื่อผู้มีส่วนร่วมอยู่ด้านบน)
Brian Suda (ไบรอัน ซูดา) (http://suda.co.uk/)
กิตติกรรมประกาศ
ดู กิตติกรรมประกาศ.

ลิขสิทธิ์ และ สิทธิบัตรมีผลบังคับใช้ตามที่ระบุ

แนะนำ

มาตรฐาน vCard (RFC2426) ได้ถูกนำมาใช้อย่างแพร่หลาย (เช่นในโปรแกรม "Address Book" ของบริษัทแอปเปิลที่พ่วงมากับระบบปฏิบัติการ MacOSX).

นอกจากนั้น เจ้าของบล๊อกหลายๆคนก็ระบุชื่อตัวเองเวลาบล๊อก และบางคนก็พูดถึงเพื่อนๆหรือครอบครัวตัวเอง ถ้าเราเพิ่มโคงสร้างอีกเล็กน้อยให้เนื้อหา เจ้าของบล๊อกก็สามารถพูดถึงบุคคลต่างๆเหล่านี้โดยที่ spider และ aggregator ต่างๆสามารถดึงเอาข้อมูลเกี่ยวกับบุคคลเหล่านี้ได้จากเนื้อหาหน้าเว็บและแปลงมันมาเป็น vCard เพื่อใช้ในแอพพลิเคชั่นต่างๆได้อย่างง่ายดาย

Specification นี้แนะนำฟอร์แมต hCard ซึ่งใช้คุณสมบัติและค่าต่างๆจากมาตรฐาน vCard ในเนื้อหา HTML ตามที่ได้กล่าวไว้ก่อนหน้านี้ เจ้าของบล๊อกสามารถฝัง hCard เข้าไปในหน้าเว็บได้เลย และตกแต่ง hCard ด้วย CSS ตามที่ต้องการ นอกจากนั้น แอพพลิเคชั่นต่างๆก็สามารถดึงข้อมูล hCard จากหน้าเว็บได้โดยตรงโดยที่ไม่ต้องใช้ไฟล์อื่นเพิ่มเติมแม้แต่น้อย

คุณสามารถใช้เครื่องมือ ตัวสร้าง hCard และก็คัดลอก HTML ที่เครื่องมือนี้สร้้างให้ไปใส่ในบล๊อกหรือหน้าเว็บคุณเพื่อเผยแพร่ข้อมูลติดต่อของคุณได้

คำพิเศษเหล่านี้ "จะต้อง ", "จะต้องไม่", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "ไม่ควรจะ", "RECOMMENDED", "สามารถ ", และ "มีหรือไม่มีก็ได้ " ให้ตีความหมายตามคำอธิบายใน RFC 2119.

รายละเอียด

ข้อมูลเบื้องต้น

มาตรฐาน vCard (RFC2426) เป็นรากฐานสำหรับ hCard

รูปแบบของ hCard คือการใช้ class เพื่อแทน object/property ของ vCard โดยชื่อของ object/property นั้นจะถูกเขียนด้วยตัวอักษรตัวเล็ก ส่วน vCard ที่ซ้อนกันหลายชั้นจะแทนที่ด้วย HTML element ที่ซ้อนๆกัน

ชื่อคลาสราก (Root Class Name)

ชื่อคลาสรากสำหรับ hCard คือ "vcard" element ที่มี class "vcard" ก็เป็น hCard ด้วยเช่นกัน

คุณสมบัติและคุณสมบัติย่อย (Properties and Sub-properties)

ข้อมูลของคุณสมบัติต่างๆ (properties) ใน hCard อยู่ใน element ที่เป็นตัวแทนของคุณสมบัติเหล่านั้น โดยที่ class ของแต่ละ element เป็นตัวบ่งบอกคุณสมบัติที่ element นั้นเป็นตัวแทน ส่วนค่าของ element ก็คือค่าของคุณสมบัตินั้นๆ

บางคุณสมบัติสามารถมีคุณสมบัติย่อย (sub-properties) ได้ ซึ่งคุณสมบัติย่อยเหล่านั้นจะถูกแทนค่า่ด้วย element ย่อยภายใน element ของคุณสมบัติแม่

รายชื่อคุณสมบัติ

รายชื่อคุณสมบัติต่างๆของ hCard อยู่ในรายการด้านล่าง (คุณสมบัติย่อยจะอยู่ในเครื่องหมายวงเล็บแบบนี้)

เพื่อความกระชับและความเข้าใจ คำอธิบายภาษาไทยของแต่ละคุณสมบัติหรือคุณสมบัติย่อยได้ถูกเขียนต่อท้ายชื่อคุณสมบัติที่เป็นภาษาอังกฤษ เวลาใช้งานไมโครฟอร์แมตในเนื้อหาของคุณ อย่าลืมใช้ชื่อคุณสมบัติภาษาอังกฤษนะครับ

คุณสมบัติที่จะต้องมีใน hCard:

  • fn
  • n1 (family-name นามสุกล, given-name ชื่อ, additional-name ชื่ออื่นๆ เช่นชื่อกลางถ้ามี, honorific-prefix คำนำหน้าชื่อ, honorific-suffix คำต่อท้ายชื่อ)

คุณสมบัติที่อาจมีหรือไม่มีก็ได้:

  • nickname ชื่อเล่น, sort-string วิธีการเรียงลำดับชื่อ
  • url ลิงก์ในอินเตอร์เน็ต, email อีเมล์ (type ชนิดของอีเมล์, value อีเมล์สำหรับชนิดนี้), tel เบอร์โทรศัพท์2 (type ชนิดของเบอร์โทรศัพท์, value เบอร์โทรศัพท์สำหรับชนิดนี้)
  • adr ที่อยู่ (post-office-box บ้านเลขที่, extended-address ที่อยู่เพิ่มเติม เช่นซอย หมู่บ้าน ฯลฯ, street-address ถนน , locality ตำบลและอำเภย, region จังหวัด, postal-code รหัสไปรษณีย์, country-name ประเทศ, type, value), label
  • geo พิกัดบนโลก (latitude เส้นรุ้ง, longitude เส้นแวง), tz โซนเวลา
  • photo รูปภาพ, logo โลโก้, sound เสียง, bday วันเกิด
  • title ชื่อตำแหน่ง, role อาชีพหรือหน้าที่การงาน, org องค์กร (organization-name ชื่อองค์กร, organization-unit หน่วยงาน)
  • category กลุ่ม, note หมายเหตุ
  • class, key, mailer, uid, rev

หมายเหตุเกี่ยวกับคุณสมบัติ

1. ^: คุณสมบัติ 'n' เป็นคุณสมบัติที่ มีหรือไม่มีก็ได้ ถ้าการแทนค่าคุณสมบัติ "n" แบบเป็นนัยมีผลบังคับใช้
2. ^: tel - สำหรับคุณสมบัติ tel ผู้ใช้ สามารถ ให้ใช้รูปแบบเบอร์โทรศัพท์ตามมาตรฐาน E.123 ได้ โดยที่ตัวอักษรที่อยู่ในรูปแบบ (เช่น +1-555-FORMATS) จะต้อง ถูกแทนที่ด้วยตัวเลข นอกจากนั้นคุณยังสามารถใช้ abbr เพื่อแสดงตัวอักษรและระบุึ้ค่าตัวเลขไปพร้อมๆกัน เช่น <abbr title="+15553676287">+1-555-FORMATS</abbr>.

คุณสมบัติที่เป็นเอกพจน์และพหูพจน์

คุณสมบัติที่เป็นเอกพจน์มีดังนี้: 'fn', 'n', 'bday', 'tz', 'geo', 'sort-string', 'uid', 'class'

สำหรับคุณสมบัติเหล่านี้ กรณีที่มี element มากกว่าหนึ่งตัวที่เป็นตัวแทนของคุณสมบัติเดียวกัน ให้ถือว่า element ตัวแรกเท่านั้นที่มีความหมาย

คุณสมบัติอื่นๆ สามารถ เป็นพหูพจน์ได้ และการใช้คุณสมบัติเหล่านี้แต่ละครั้งเป็นการสร้างค่าใหม่ขึ้นมา

เนื้อหาสำหรับคนและเครื่อง

ค่าต่างๆของคุณสมบัติ ใน hCard ปกติจะมาจากเนื้อหาที่คนอ่านได้บนหน้าเว็บ โดยมีข้อยกเว้นบางประการ:

ถ้ามีการใช้ <abbr> ให้ใส่ค่าของคุณสมบัตินั้น (ซึ่งก็คือชื่อเต็ม) ใน attribute 'title' (ของ <abbr>) ส่วนเนื้อหาของ <abbr> จะใช้เพื่อแสดงคำย่อแทนเพื่อให้อ่านง่ายขึ้น

ถ้ามีการใช้ <a> จะต้อง ทำตามกฏเหล่านี้:

  1. สำหรับคุณสมบัติ 'photo' และคุณสมบัติอื่นๆที่มีค่าเป็น URL ให้ใส่ค่าของคุณสมบัตินั้นใน attribute href="..."
  2. สำหรับคุณสมบัติอื่นๆที่ค่าไม่ใช่ URL ให้ใส่ค่าของคุณสมบัติในเนื้อหาของ <a>

ถ้ามีการใช้ <img> จะต้อง ทำตามกฏเหล่านี้:

  1. สำหรับคุณสมบัติ 'photo' และคุณสมบัติอื่นๆที่มีค่าเป็น URL ให้ใส่ค่าของคุณสมบัตินั้นใน attribute src="..."
  2. สำหรับคุณสมบัติอื่นๆที่ค่าไม่ใช่ URL ให้ใส่ค่าของคุณสมบัตินั้นใน attribute 'alt'

ถ้ามีการใช้ <object> จะต้อง ทำตามกฏเหล่านี้:

  1. สำหรับคุณสมบัติ 'photo' และคุณสมบัติอื่นๆที่มีค่าเป็น URL ให้ใส่ค่าของคุณสมบัตินั้นใน attribute data="..."
  2. สำหรับคุณสมบัติอื่นๆที่ค่าไม่ใช่ URL ให้ใส่ค่าของคุณสมบัตินั้นในเนื้อหาของ <object>

การตัดตอนเนื้อหาเพื่อแทนค่าของคุณสมบัติ

ในบางครั้งแค่ส่วนใดส่วนหนึ่งของ element ถูกใช้แทนค่าของคุณสมบัติ เช่นในคุณสมบัติย่อยของ 'tel' ที่ใช้แทนชนิดของบอร์โทรศัพท์ สำหรับกรณีนี้ให้ใช้ชื่อ class "value" เพื่อตัดตอนเนื้อหาส่วนที่แทนค่าของคุณสมบัติใน markup

ด้านล่างเป็นตัวอย่างของการใช้ class นี้สำหรับแทนค่าเบอร์โทรศัพท์บ้าน:

vCard:

TEL;TYPE=HOME:+1.415.555.1212

hCard:

<span class="tel">
 <span class="type">home</span>:
 <span class="value">+1.415.555.1212</span>
</span>

hCard นี้สามารถแสดงผลเป็น:

home: +1.415.555.1212


คุณสมบัติที่ไม่ใช้

vCard มีคุณสมบัติบางอันที่ไม่มีความหมายสำหรับเนื้อหาในหน้าเว็บ เนื้อหาส่วนนี้อธิบายว่าทำไมคุณไม่ควรใช้คุณสมบัติเหล่านั้น

  1. คุณสมบัติ NAME, PROFILE, SOURCE, PRODID, และ VERSION ของ vCard ถูกอธิบายในหัวข้อ 2.1.2, 2.1.3, 2.1.4, 3.6.3, และ 3.6.9 ของ RFC2426 ผู้เผยแพร่เนื้อหาจะต้องไม่ใช้คุณสมบัติเหล่านี้ใน hCard และผู้ใช้เนื้อหานี้จะต้องไม่นำคุณสมบัติเหล่านี้มาใช้ถ้ามีอยู่ใน hCard
  2. เมื่อมีการแปลงจาก vCard เป็น hCard คุณ ควรจะ ใช้ชื่อของหน้าเว็บที่มี hCard (จาก <title> ของเอกสาร HTML) เพื่อสร้างคุณสมบัติ NAME
  3. MAY output a PROFILE value of "VCARD" per RFC2426, SHOULD use the URL of the page where the hCard is found to construct the SOURCE property (e.g. perhaps as a parameter to a URL/service that converts hCards to vCards), for an output vCard stream (e.g. a .vcf file). Only services/applications that output actual vCards should write the PRODID property, with the product identifier for said service/application. Similarly, only such services/applications should write the VERSION property, with the value "3.0" (without quotes) per RFC2426 Section 3.6.9.

ที่อยู่ติดต่อสำหรับองค์กร

ถ้าคุณสมบัติ "FN" และ "ORG" มีค่าเดียวกัน (ซึ่งอาจเกิดได้เพราะคุณสมบัติทั้งสองถูกใช้พร้อมกันในหนึ่ง element เช่น class="fn org") ให้ถือว่า hCard นั้นเป็น hCard สำหรับบริษัท องค์กร หรือสถานที่และ ควรจะ ถูกใช้ในความหมายนี้ ในกรณีนี้ผู้สร้าง hCard จะต้องไม่ ใส่ค่า หรือใส่เป็นค่าว่างๆ (empty string) สำหรับคุณสมบัติ "N" และคุณสมบัติย่อยของมัน นอกจากนั้น parser ควรจะ รองรับกรณีที่ไม่มีคุณสมบัติ "N" ใน hCard ด้วย

การแทนค่าคุณสมบัติ "n" แบบเป็นนัย

ถึงแม้ว่ามาตรฐาน vCard บังคับให้คุณต้องใส่ค่าสำหรับคุณสมบัติ "N" แต่ในตัวอย่างท้ายมาตรฐาน vCard (RFC2426) (หน้า 38) เองก็ไม่ได้ใส่คุณสมบัตินี้ ทำให้เกิดความขัดแย้งกับมาตรฐานขึ้น เราสามารถแก้ไขความขัดแย้งนี้โดยการใช้ "FN" แทนที่ "N" ในการใช้งานทั่วๆไป

ถ้าค่าของ "FN" และ "ORG" แตกต่างกัน (ลองดูในหมวดก่อนหน้า) และค่าของ "FN" มีความยาวเท่ากับสองคำ (คั่นด้วยเว้นวรรค) และก็ไม่มีการระบุคุณสมบัติ "N" ในที่ใดๆอีก ให้ถือว่าค่าของ "N" นั้นคือค่าของ คุณสมบัติ "FN"

สำหรับ "FN" ที่มีคำแค่คำเดียวให้ดูด้านล่าง และสำหรับ "FN" ทีมีสามคำขึ้นไป ผู้แต่ง จะต้อง ระบุ markup "N" ยกเว้นในกรณีของที่อยู่ติดต่อขององค์กร ดูด้านบน

  1. เนื้อหาของ "FN" แบ่งออกเป็นสอง "คำ" คั่นด้วยเว้นวรรค
  2. คำแรก ของ "FN" แทนความหมายของ "ชื่อ" ในคุณสมบัติ "N"
  3. คำที่สอง ของ "FN" แทนความหมายของ "นามสกุล" ในคุณสมบัติ "N"
  4. ข้อยกเว้น: ถ้าคำแรกลงท้ายด้วยคอมม่า หรือถ้าคำที่สองมีตัวอักษรเดียว (โดยมีหรือไม่มีจุดต่อท้าย) ให้ถือว่าคำแรก (ไม่รวมคอมม่า ถ้ามี) เป็น "นามสกุล" และคำที่สองคือ "ชื่อ"

กฏนี้จะทำให้การใช้งานโดยทั่วๆเหล่านี้ทำได้ง่ายขึ้น:

  • ชื่อ (เว้นวรรค) ​นามสกุล
  • นามสกุล (คอมม่า) ชื่อ
  • นามสกุล (คอมม่า) ตัวอักษรแรกของชื่อ
  • นามสกุล (เว้นวรรค) ตัวอักษรแรกของชื่อ (จุด ถ้ามี)

หมายเหตุจากผู้แปล: สองกรณีหลังเป็นกรณีที่ใช้บ่อยในชื่อภาษาอังกฤษ ซึ่งอาจไม่ได้ใช้สำหรับภาษาไทย ในภาษาอังกฤษนาย John Smith อาจะจะเขียนชื่อเป็น Smith, John หรือ Smith, J. หรือ Smith J ก็ได้ ในขณะที่ชื่อภาษาไทยไม่มีการใช้รูปแบบอย่างนี้

การแทนค่าคุณสมบัติ "nickname" แบบเป็นนัย

เนื่องจากมีการใช้ชื่อเล่น/นามแฝง/ชื่อผู้ใช้อย่างแพร่หลายในเนื้อหาต่างๆในอินเตอร์เน็ต (เช่นโดยผู้เขียน reviews) hCard เองก็มีวิธีการระบุชื่อเล่นเช่นกัน

คล้ายๆกับการแทนค่า "N" แบบเป็นนัย ถ้า "FN" และ "ORG" มีค่าต่างกันและค่าของ "FN" เป็นคำที่มีความยาวหนึ่งคำ และไม่มีการระบุคุณสมบัติ "N" อื่นๆ:

  1. เนื้อหาของ "FN" จะต้อง มีค่าเป็น "ชื่อเล่น"
  2. Parser ควรจะ รองรับกรณีที่ไม่มีคุณสมบัติ "N" โดยสันนิษฐานว่าค่าของคุณสมบัตินี้และคุณสมบัติย่อยของมันเป็นค่าว่าง (empty value)

ถึงแม้ว่า parser จะต้อง ทำตามกฏที่กล่าวไว้ข้างต้น ผู้เขียนข้อมูลเองก็ ควรจะ ระบุ "ชื่อเล่น" ให้ชัดเจนเช่นกัน ยกตัวอย่างเช่น:

<span class="vcard">
 <span class="fn nickname">daveman692</span>
</span>

นอกเหนือจากค่า "nickname" ที่ได้มาแบบเป็นนัยจากการใช้ "FN" แล้ว ผู้ใช้ สามารถ ระบุค่า "nickname" อื่นๆใน hCard ได้เพิ่มเติมเช่นกัน

การแทนค่าคุณสมบัติ "organization-name" แบบเป็นนัย

คุณสมบัติ "ORG" มีสองคุณสมบัติย่อยคือ organization-name (ชื่อ) และ organization-unit (หน่วยงาน) บ่อยครั้งที่ผู้เขียนต้องการเผยแพร่แค่ชื่อองค์กรอย่างเดียว ซึ่งในกรณีนี้ผู้เขียนไม่ต้องใส่คุณสมบัติย่อย "organization-name" แต่ จะต้อง ใส่ชื่อองค์กรในเนื้อหาของ element แทน

การใช้ Tag เพื่อจัดกลุ่ม

คุณ สามารถ แทนคุณสมบัติกลุ่มใน hCard ได้โดยการใช้ tag ผ่าน rel-tag เมื่อคุณสมบัติ category เป็น rel-tag ค่าของ tag นั้นถือเป็นชื่อของกลุ่ม

ค่าของคุณสมบัติย่อย type

ค่าของคุณสมบัติย่อย 'type' (ชนิด) ขึ้นอยู่กับคุณสมบัติหลักที่ใช้มัน ค่าของ 'type' ไม่มีความแตกต่างระหว่างตัวอักษรเล็กหรือใหญ่ หมายความว่าค่า "Home" มีค่าเท่ากับ "home" นอกจากนั้นค่าของ 'type' ก็สามารถมีได้หลายค่า เช่น. เบอร์โทรศัทพ์ (คุณสมบัติ tel) สามารถเป็นได้ทั้งเบอร์บ้าน (home) และเบอร์ติดต่อหลัก (preferred):

vCard:

TEL;TYPE=HOME,PREF:+1.415.555.1212

hCard:

<span class="tel"><span class="type">Home</span> (<span class="type">pref</span>erred):
 <span class="value">+1.415.555.1212</span>
</span>

ซึ่งสามารถแสดงผลได้เป็น:

Home (preferred): +1.415.555.1212

คุณสมบัติที่ไม่ระบุค่า

เมื่อมีการระบุคุึณสมบัติย่อย 'type' แต่ไม่มีการระบุค่าขอบคุณสมบัติย่อยนี้ผ่าน 'value' ให้ถือว่าอะไรก็ตามที่อยู่ในคุณสมบัติหลักเป็น 'value' ยกตัวอย่างเช่น

<span class="tel"><span class="type">Home</span> +1.415.555.1212</span>

มีค่าเท่ากับ:

<span class="tel"><span class="type">Home</span><span class="value"> +1.415.555.1212</span></span>

ซึ่งหมายความว่าชนิดของเบอร์โทรศัพท์นี้เป็นโทรศัพท์บ้าน ("home") และค่าของมัน ("value") ก็คือ "+1.415.555.1212".

type สำหรับคุณสมบัติ adr tel และ email

รายละเอียดด้านล่างมีไว้เพื่อ ให้ข้อมูลอ้างอิง กรุณาดู RFC2426 บทที่ 3.2.1 ADR, 3.3.1 TEL, และ 3.3.2 EMAIL เพื่อดูรายละเอียดเพิ่มเติม ข้อมูลในที่นี้ได้ถูกคัดลอกมาเพื่อความสะดวกในการอ่าน

ค่าที่เลือกโดยอัตโนมัติหรือค่า default คือค่าแรกที่อยู่ในแต่ละรายการด้านล่างและเขียนด้วยตัวอักษรใหญ่ทั้งหมด คุณสมบัติย่อย 'type' สำหรับคุณสมบัติเหล่านี้สามารถมีได้มากกว่าหนึ่งค่า

  • ค่าของ 'type' เมื่อใช้กับคุณสมบัติ adr: INTL, POSTAL, PARCEL, WORK, dom, home, pref
  • ค่าของ 'type' เมื่อใช้กับคุณสมบัติ tel: VOICE, home, msg, work, pref, fax, cell, video, pager, bbs, modem, car, isdn, pcs
  • ค่าของ 'type' เมื่อใช้กับคุณสมบัติ email: INTERNET, x400, pref, "other IANA registered address types"

XMDP Profile

See hcard-profile for the XMDP profile of hCard which contains the above complete list of properties, with references to their RFC2426 definitions.

การวิเคราะห์คำในประโยค (ทางไวยากรณ์) (Parsing)

ดู การวิเคราะห์คำทางไวยากรณ์สำหรับ hCard

ตัวอย่าง

ตัวอย่างของ vCard

ด้านล่างนี้เป็นตัวอย่างของ vCard:

BEGIN:VCARD
VERSION:3.0
N:Çelik;Tantek
FN:Tantek Çelik
URL:http://tantek.com/
END:VCARD

และเมื่อแปลงมาเป็น hCard โดยแปลง element ต่างๆตามความเหมาะสมแล้ว ลองดู hCard Example 1 สำหรับรูปแบบพลิกแพลงอื่น

<div class="vcard">
 <a class="url fn" href="http://tantek.com/">Tantek Çelik</a>
</div>

hCard นี้สามารถถุูกแสดงผลแบบนี้:

Tantek Çelik

หมายเหตุ: ข้อมูลเวอร์ชั่นนั้นไม่จำเป็นสำหรับ hCard เนื่องจากเลขเวอร์ชั่นจะถูกตั้งโดยโปรไฟล์ (profile) ของ hCard ที่ถูกใช้ / อ้างอิงถึงในแอททริบิวท์ 'profile' ของ <head> อยู่แล้ว

Live example

นี่คือตัวอย่างรายละเอียดติดต่อจากเว็บ Commercenet ที่ได้มาจากการใช้เครื่องมือ parse ไมโครฟอร์แมตในการค้นหา:

CommerceNet
http://www.commerce.net/
Work:
169 University Avenue

Palo Alto, CA  94301

USA
Work +1-650-289-4040
Fax +1-650-289-4041
Email

ด้านล่างคือ mark-up จากเว็บที่เอาตัวอักษรตัวหนาออกเพื่อให้อ่านง่าย โดยมีการปรับปรุงเนื้อหาคือ:

  • abbr เพื่อขยายคำย่อ
  • เพิ่มความหมายใน hyperlink เพื่อระบุ url สำหรับองค์กร โดยการใส่ url ต่อจาก fn org
<div class="vcard">
  <a class="fn org url" href="http://www.commerce.net/">CommerceNet</a>
  <div class="adr">
    <span class="type">Work</span>:
    <div class="street-address">169 University Avenue</div>
    <span class="locality">Palo Alto</span>,  
    <abbr class="region" title="California">CA</abbr>  
    <span class="postal-code">94301</span>
    <div class="country-name">USA</div>
  </div>
  <div class="tel">
   <span class="type">Work</span> +1-650-289-4040
  </div>
  <div class="tel">
    <span class="type">Fax</span> +1-650-289-4041
  </div>
  <div>Email: 
   <span class="email">info@commerce.net</span>
  </div>
</div>

ตัวอย่างอื่นๆ

ลองดู ตัวอย่าง hCard เพื่อดูตัวอย่างเพิ่มเติม รวมทั้งตัวอย่างจากการแปลง vCard RFC2426 มาเป็น hCard

ปุ่มต่างๆ

คุณสามารถใช้ปุ่มเหล่านี้ในหน้าเว็บของคุณทีมีการใช้ hCard ลองดู buttons#hCard เพื่อดูปุ่มใหม่ๆ

ตัวอย่างในอินเตอร์เน็ต

ส่วนนี้มีไว้เพื่ออ้างอิง จำนวนตัวอย่างของการใช้ hCard ในอินเตอร์เน็ตได้ขยายมากเกินกว่าที่จะนำมาใส่ในหน้านี้ได้ ทำให้ตัวอย่างได้ถูกย้ายไปที่อีกหน้าหนึ่ง

ดู ตัวอย่างของ hCard ในอินเตอร์เน็ต

Implementations

This section is informative. The number of hCard implementations has also expanded beyond the capacity of keeping them inline. They have been moved to a separate page.

See hCard Implementations.

ลิขสิทธิ์

ตามที่ผู้แต่ง (Tantek Çelik, Brian Suda) ได้ระบุไว้ เอกสารฉบับนี้ได้รับอนุญาติให้เผยแพร่กับสาธารณะได้

Public Domain Contribution Requirement. Since the author(s) released this work into the public domain, in order to maintain this work's public domain status, all contributors to this page agree to release their contributions to this page to the public domain as well. Contributors may indicate their agreement by adding the public domain release template to their user page per the Voluntary Public Domain Declarations instructions. Unreleased contributions may be reverted/removed.

สิทธิบัตร

This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.

ข้อมูลอ้างอิง

ข้อมูลอ้างอิงเกี่ยวกับมาตรฐาน

ข้อมูลอ้างอิงทั่วไป

Specifications อื่นๆที่ใช้ hCard

งานที่คล้ายกัน

แรงบันดาลใจและกิตติกรรมประกาศ

ขอบคุณ: เพื่อนที่ดีของผม Vadim ซึ่งทำให้ผมได้รู้จักกับ vCard หลาย ปีที่แล้ว ถ้าผมใ่ส่ใจในเรื่องนี้มากกว่านี้สักหน่อยในตอนนั้น ผมคงจะช่วยให้หลายๆคนไม่ต้องเสียเวลาสร้างมาตรฐานใหม่เพื่อที่ทำสิ่งเดียวกับมาตรฐานที่มีอยู่แล้ว

บันทึกเกี่ยวกับส่วนดัดแปลงจาก vCard

ส่วนนี้มีไว้เพื่อ อ้างอิง

More Semantic Equivalents

For some properties there are HTML elements which better match and convey their semantics. The following properties SHOULD be encoded with the following HTML:

  • URL in vCard becomes <a class="url" href="...">...</a> inside the element with class="vcard" in hCard.
  • Similarly, EMAIL in vCard becomes <a class="email" href="mailto:...">...</a>
  • PHOTO in vCard becomes <img class="photo" src="..." alt="Photo of ..." /> or <object class="photo" data="..." type="...">Photo of ...</object>
  • UID in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.

ส่วนดัดแปลงเกี่ยวกับการใช้เอกพจน์และพหูพจน์

รายชื่อคุณสมบัติที่เป็นเอกพจน์และพหูพจน์ ได้มาจากการวิเคราะห์ความหมายของแต่ละคุณสมบัติใน vCard RFC2426 และตัดสินใจว่าคุณสมบัติไหนจะต้องเป็นเอกพจน์โดยดูตามความหมายของคุณสมบัตินั้นๆ ดูคำอธิบายเพิ่มเติมที่ hcard-singular-properties

Plural Properties Singularized

Since plural property names become their singular equivalents, even if the original plural property permitted only a single value with multiple components, those multiple components are represented each with their own singularly named property and the the property is effectively multivalued and subject to the above treatment of multivalued properties.

เอกสารสำหรับอ่านเพิ่มเติม

Related Pages

The hCard specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added. These thoughts, issues, and questions are kept in separate pages.