ltStimetohave time to doclass怎么读

This is revision 1.2852.
5 MicrodataStatus: First draft.
(Microdata/RDFa) blocks progress to Last Call5.1 Introduction5.1.1 OverviewThis section is non-normative.Sometimes, it is desirable to annotate content with specific
machine-readable labels, e.g. to allow generic scripts to provide
services that are customised to the page, or to enable content from
a variety of cooperating authors to be processed by a single script
in a consistent manner.For this purpose, authors can use the microdata features
described in this section. Microdata allows nested groups of
name-value pairs to be added to documents, in parallel with the
existing content.5.1.2 The basic syntaxThis section is non-normative.At a high level, microdata consists of a group of name-value
pairs. The groups are called , and each name-value pair is a
property. Items and properties are represented by regular
elements.To create an item, the
attribute is used.To add a property to an item, the
attribute is used on one of
descendants.
Here there are two items, each of which have the property "name":
&div item&
&p&My name is &span itemprop="name"&Elizabeth&/span&.&/p&
&div item&
&p&My name is &span itemprop="name"&Daniel&/span&.&/p&
Properties generally have values that are strings.
Here the item has three properties:
&div item&
&p&My name is &span itemprop="name"&Neil&/span&.&/p&
&p&My band is called &span itemprop="band"&Four Parts Water&/span&.&/p&
&p&I am &span itemprop="nationality"&British&/span&.&/p&
Properties can also have values that are . This is achieved using the
element and its
attribute, the
element and its
attribute, or other elements that
link to or embed external resources.
In this example, the item has one property, "image", whose value is a URL:
&div item&
&img itemprop="image" src="google-logo.png" alt="Google"&
Properties can also have values that are dates, times, or dates
and times. This is achieved using the
element and
attribute.
In this example, the item has one property,
"birthday", whose value is a date:
&div item&
I was born on &time itemprop="birthday" datetime=""&May 10th 2009&/time&.
Properties can also themselves be groups of name-value pairs, by
putting the
attribute on the
element that declares the property.Items that are not part of others are called .
In this example, the outer item represents a person, and the
inner one represents a band:
&div item&
&p&Name: &span itemprop="name"&Amanda&/span&&/p&
&p&Band: &span itemprop="band" item& &span itemprop="name"&Jazz Band&/span& (&span itemprop="size"&12&/span& players)&/span&&/p&
The outer item here has two properties, "name" and
"band". The "name" is "Amanda", and the
"band" is an item in its own right, with two
properties, "name" and "size". The
"name" of the band is "Jazz Band", and the
"size" is "12".
The outer item in this example is a top-level microdata
Properties don't have to be given as descendants of the element
attribute. They can be
associated with a specific
attribute, which
takes the ID of the element with the
attribute.
This example is the same as the previous one, but all the
properties are separated from their :
&div item id="amanda"&&/div&
&p&Name: &span subject="amanda" itemprop="name"&Amanda&/span&&/p&
&div subject="amanda" itemprop="band" item id="jazzband"&&/div&
&p&Band: &span subject="jazzband" itemprop="name"&Jazz Band&/span&&/p&
&p&Size: &span subject="jazzband" itemprop="size"&12&/span& players&/p&
This gives the same result as the previous example. The first
item has two properties, "name", set to "Amanda", and "band", set
to another item. That second item has two further properties,
"name", set to "Jazz Band", and "size", set to "12".
can have multiple
properties with the same name and different values.
This example describes an ice cream, with two flavors:
&div item&
&p&Flavors in my favorite ice cream:&/p&
&li itemprop="flavor"&Lemon sorbet&/li&
&li itemprop="flavor"&Apricot sorbet&/li&
This thus results in an item with two properties, both
"flavor", having the values "Lemon sorbet" and "Apricot
An element introducing a property can also introduce multiple
properties at once, to avoid duplication when some of the properties
have the same value.
Here we see an item with two properties,
"favorite-color" and "favorite-fruit", both
set to the value "orange":
&div item&
&span itemprop="favorite-color favorite-fruit"&orange&/span&
It's important to note that there is no relationship between the
microdata and the content of the document where the microdata is
marked up.
There is no semantic difference, for instance, between the
following two examples:
&img src="castle.jpeg"&
&legend&&span item&&span itemprop="name"&The Castle&/span&&/span& (1986)&/legend&
&span item&&meta itemprop="name" content="The Castle"&&/span&
&img src="castle.jpeg"&
&legend&The Castle (1986)&/legend&
Both have a figure with a caption, and both, completely
unrelated to the figure, have an item with a name-value pair with
the name "name" and the value "The Castle". The only
difference is that if the user drags the caption out of the
document, in the former case, the item will be included in the
drag-and-drop data. In neither case is the image in any way
associated with the item.
5.1.3 Typed itemsThis section is non-normative.The examples in the previous section show how information could
be marked up on a page that doesn't expect its microdata to be
re-used. Microdata is most useful, though, when it is used in
contexts where other authors and readers are able to cooperate to
make new uses of the markup.For this purpose, it is necessary to give each
a type, such as
"com.example.person", or "org.example.cat", or
"net.example.band". Types are identified in three ways:As .
Using the names of , which are described below.
are self-explanatory.
strings such as "org.example.animals.cat" or "com.example.band".The type for an
as the value of the
attribute.
Here, the item is "org.example.animals.cat":
&section item="org.example.animal.cat"&
&h1 itemprop="name"&Hedral&/h1&
&p itemprop="desc"&Hedral is a male american domestic
shorthair, with a fluffy black fur with white paws and belly.&/p&
&img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months"&
&/section&
In this example the "org.example.animals.cat" item has three
properties, a "name" ("Hedral"), a "desc" ("Hedral is..."), and an
"img" ("hedral.jpeg").
An item can only have one type. The type gives the context for
the properties: a property named "class" given for an item with the
type "com.example.census.person" might refer to the class of an
individual, while a property named "class" given for an item with
the type "com.example.school.teacher" might refer to the classroom a
teacher has been assigned.5.1.4 Selecting names when defining vocabulariesThis section is non-normative.Using microdata means using a vocabulary. For some purposes, an
ad-hoc vocabulary is adequate. For others, a vocabulary will need to
be designed. Where possible, authors are encouraged to re-use
existing vocabularies, as this makes content re-use easier.When designing new vocabularies, identifiers can be created
either using , , or, for
properties, as plain words (with no dots or colons). For URLs
conflicts with other vocabularies can be avoided by only using
identifiers that correspond to pages that the author has control
over. Similarly, for reversed DNS labels conflicts can be avoided by
using a domain name that the author has control over, or by using
suffixes that correspond to the path components of pages that the
author has control over.
For instance, if Jon and Adam both write content at , at /jon/... and /adam/... respectively, then they
could select identifiers of the form "com.example.jon.name" and
"com.example.adam.name" respectively.
Properties whose names are just plain words can only be used
within the context of the types for whi
properties named using URLs or reversed DNS labels can be reused in
items of any type. If an item has no type, and is not part of
another item, then if its properties have names that are just plain
words, they are not intended to be globally unique, and are instead
only intended for limited use. Generally speaking, authors are
encouraged to use either properties with globally unique names
(URLs, reversed DNS labels) or ensure that their items are
Here, an item is an "org.example.animals.cat", and most of the
properties have names that are words defined in the context of that
type. There are also a few additional properties whose names come
from other vocabularies.
&section item="org.example.animal.cat"&
&h1 itemprop="name com.example.fn"&Hedral&/h1&
&p itemprop="desc"&Hedral is a male american domestic
shorthair, with a fluffy &span
itemprop="com.example.color"&black&/span& fur with &span
itemprop="com.example.color"&white&/span& paws and belly.&/p&
&img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months"&
&/section&
This example has one item with two types and the following
properties:
com.example.fn
Hedral is a male american domestic shorthair, with a fluffy black fur with white paws and belly.
com.example.color
com.example.color
.../hedral.jpeg
5.1.5 Predefined vocabularies (predefined-voc) blocks progress to Last CallThis section is non-normative.To make the most common tasks simpler, certain vocabularies have
been predefined. These use short names for types and properties.
For example, the
vocabulary
can be used to mark up people's names:
&span item=vcard&&span itemprop=fn&George Washington&/span&&/span&
This creates a single item with a single name-value pair, with
the name "fn" and the value "George Washington". This is defined to
map to the following vCard:
BEGIN:VCARD
PROFILE:VCARD
VERSION:3.0
SOURCE:document's address
FN:George Washington
5.1.6 Using the microdata DOM APIThis section is non-normative.The microdata becomes even more useful when scripts can use it to
expose information to the user, for example offering it in a form
that can be used by other applications.The
method provides access to the
. It returns a
NodeList containing the items with the specified types,
or all types if no argument is specified.Each
is represented in the
DOM by the element on which the relevant
attribute is found. The type of that
element can be obtained using the
DOM attribute.
This sample shows how the
method can be used
to obtain a list of all the top-level microdata items of one type
given in the document:
var cats = document.getItems("com.example.feline");
Once an element representing an
has been obtained, its properties
can be extracted using the
DOM attribute. This
attribute returns an , which can
be enumerated to go through each element that adds one or more
properties to the item. It can also be indexed by name, which will
return an object with a list of the elements that add properties
with that name.Each element that adds a property also has a
DOM attribute that returns its
This sample gets the first item of type "net.example.user" and
then pops up an alert using the "name" property from
that item.
var user = document.getItems('net.example.user')[0];
alert('Hello ' + user.properties['name'][0].content + '!');
object, when indexed by
name in this way, actually returns a
object with all the matching properties. The
object can be used to obtained all the
values at once using its
attribute,
which returns an array of all the values.
In an earlier example, a "org.example.animals.cat" item had two
"com.example.color" values. This script looks up the first such
item and then lists all its values.
var cat = document.getItems('org.example.animals.cat')[0];
var colors = cat.properties['com.example.color'].
if (colors.length == 0) {
result = 'Color unknown.';
} else if (colors.length == 1) {
result = 'Color: ' + colors[0];
result = 'Colors:';
for (var i = 0; i & colors. i += 1)
result += ' ' + colors[i];
It's also possible to get a list of all the
using the object's
attribute.
This example creates a big list with a nested list for each item
on the page, each with of all the property names used in that
var outer = document.createElement('ul');
for (var item = 0; item & document.items. item += 1) {
var itemLi = document.createElement('li');
var inner = document.createElement('ul');
for (var name = 0; name & document.items[item].names. name += 1) {
var propLi = document.createElement('li');
propLi.appendChild(document.createTextNode(document.items[item].names[name]));
inner.appendChild(propLi);
itemLi.appendChild(inner);
outer.appendChild(itemLi);
document.body.appendChild(outer);
If faced with the following from an earlier example:
&section item="org.example.animal.cat"&
&h1 itemprop="name com.example.fn"&Hedral&/h1&
&p itemprop="desc"&Hedral is a male american domestic
shorthair, with a fluffy &span
itemprop="com.example.color"&black&/span& fur with &span
itemprop="com.example.color"&white&/span& paws and belly.&/p&
&img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months"&
&/section&
...it would result in the following output:
com.example.fn
com.example.color
(The duplicate occurrence of "com.example.color" is not included
in the list.)
5.2 Encoding microdata5.2.1 The microdata modelThe microdata model consists of groups of name-value pairs known
as items.Each group has zero or more types, each name has one or more
values, and each value is either a string or another group of
name-value pairs.5.2.2 Items: the item attributeEvery
may have an
attribute specified.An element with the
specified creates a new , a
group of name-value pairs.The attribute, if specified, must have a value that is either:The empty string, or
that is an
for which the string "http://www.w3.org/1999/xhtml/custom#" is not a
The item type of an element with an
attribute is the value of the
attribute. If the
attribute's value is the empty string, the element is said to have
no .5.2.3 Associating names with itemsThe subject
attribute may be specified on any
to associate the element with an element with an
attribute. If the
attribute is specified, the
attribute's value must be the ID of an element with an
attribute, in the same
Document as the element with the
attribute.An element's corresponding item is
determined by its position in the DOM and by any
attributes on the element, and
is defined as follows:If the element has a
If there is an element in the document with an ID equal to
the value of the
attribute, and if the first such element has an
attribute specified, then that
element is the . Otherwise, there is no .
If the element has no
attribute but does have an ancestor with an
attribute specified
The nearest ancestor element with the
attribute specified is the element's
If the element has neither
attribute nor an ancestor with
attribute specified
The element has no .
The list of elements that create
but do not themselves have a
the list of top-level microdata items.5.2.4 Names: the itemprop attributeEvery
that has a
may have an
specified.An element with the
attribute specified adds one or more name-value pairs to its
attribute, if
specified, must have a value that is an
representing the names of the
name-value pairs that it adds. The attribute's value must have at
least one token.Each token must be either:A
that is an
for which the string "http://www.w3.org/1999/xhtml/custom#" is not a
allowed in this
situation, or
If the item's
allowed in
this situation, or
If the item has no
but it is itself the
value of a property whose property name is a : a
allowed in this situation, or
If the item's
and the item is not the value of a property whose
property name is a : a string
that contains no U+002E FULL STOP (.) or U+003A COLON (:)
characters, and that is not a .
The property names of an element are the tokens that
the element's
is found to contain when its value is , with the order preserved but with
duplicates removed (leaving only the first occurrence of each
name).With an , the properties
are unordered with respect to each other, except for properties with
the same name, which are ordered in .
In the following example, the "a" property has the values "1"
and "2", in that order, but whether the "a" property comes
before the "b" property or not is not important:
&div item&
&p itemprop="a"&1&/p&
&p itemprop="a"&2&/p&
&p itemprop="b"&test&/p&
Thus, the following is equivalent:
&div item&
&p itemprop="b"&test&/p&
&p itemprop="a"&1&/p&
&p itemprop="a"&2&/p&
As is the following:
&div item&
&p itemprop="a"&1&/p&
&p itemprop="b"&test&/p&
&p itemprop="a"&2&/p&
5.2.5 ValuesThe property value of a
name-value pair added by an element with an
attribute depends on the
element, as follows:If the element also has an
The value is the
created by the element.
If the element is a
The value is the value of the element's content attribute, if any, or the empty
string if there is no such attribute.
If the element is an , ,
The value is the
that results from
the value of the
element's src attribute relative to the
element at the time the attribute is set, or the empty string if
there is no such attribute or if
it results in an error.
If the element is an , , or
The value is the
that results from
the value of the
element's href attribute relative to the
element at the time the attribute is set, or the empty string if
there is no such attribute or if
it results in an error.
If the element is an
The value is the
that results from
the value of the
element's data attribute relative to the
element at the time the attribute is set, or the empty string if
there is no such attribute or if
it results in an error.
If the element is a
element with a datetime attribute
The value is the value of the element's datetime attribute.
The value is the element's
textContent.
The URL property elements are the ,
elements.If a property's
is an , the property must be specified
using an .5.3 Microdata DOM APIdocument . getItems( [ types ] )
Returns a NodeList of the elements in the Document that create , that are not part of other , and that are of one of the types given in the argument, if any are listed.
The types argument is interpreted as a space-separated list of types.
If the element has an
attribute, returns an
with all the element's properties. Otherwise, an empty
[ = value ]
Returns the element's .
Can be set, to change the element's .
The document.getItems(typeNames) method takes an optional
string that contains an
representing types. When called, the
method must return a live NodeList object containing
all the elements in the document, in , that
equal to one of the types specified in
that argument, having obtained the types by . If there
are no tokens specified in the argument, or if the argument is
missing, then the method must return a NodeList
containing all the
The item DOM attribute
on elements must
the element's
content attribute.
The itemprop DOM
attribute on elements must
the element's
content attribute.
The properties DOM
attribute on elements must return an
rooted at the
Document node, whose filter matches only elements that
and have a
equal to the element on which the attribute was invoked.
The content DOM
attribute's behavior depends on the element, as follows:
If the element is a
The attribute must act as it would if it was
the element's
attribute.
If the element is an , ,
The attribute must act as it would if it was
the element's src content attribute.
If the element is an , , or
The attribute must act as it would if it was
the element's href content attribute.
If the element is an
The attribute must act as it would if it was
the element's data content attribute.
If the element is a
element with a datetime attribute
The attribute must act as it would if it was
the element's datetime content attribute.
The attribute must act the same as the element's
textContent attribute.
The subject DOM
attribute on elements must
the element's
content attribute.
5.4 Predefined vocabularies (predefined-voc) blocks progress to Last CallA number of predefined types
exist, for describing common structures. Each such type has a set of
predefined property
names that are used to describe data of that type. In
addition, there are some predefined global property names that can be used for
any item.5.4.1 GeneralThe
about can be used to name an
for the purposes of
identifying or refering to the data defined in that item.A single property with the name
may be present within each . Its
must be an
.5.4.2 vCardAn item with the
vcard represents a person's or
organization's contact information.The following are the type's . They are based on the
vocabulary defined in the vCard specification and its extensions,
where more information on how to interpret the values can be
Gives the formatted text corresponding to the name of the
person or organization.
Exactly one property with the name
must be present within each
with the type .
Gives the structured name of the person or organization.
with zero or more of
each of the , , , , and
properties.
Unless one of the conditions given below applies, exactly one
property with the name
present within each
the type .
If one of the following conditions does apply, then the
may be omitted:
with the type
vcard has both an
property and an
property, and they both have
strings and those strings are identical when compared in a
The contact information must be for an organization.
with the type
vcard has an
property whose
consists of a string
with zero .
property must be a
with the type
vcard has an
property whose
consists of a string
with exactly one sequence of , which occurs neither at the immediate start
nor the immediate end of the string.
property must be a name in
one of the following forms:
Last, First
First Last
family-name (inside )
Gives the family name of the person, or the full name of the
organization.
Any number of properties with the name
may be present
within the
that forms the
property of an
with the type .
given-name (inside )
Gives the given-name of the person.
Any number of properties with the name
may be present
within the
that forms the
property of an
with the type .
additional-name (inside )
Gives the any additional names of the person.
Any number of properties with the name
present within the
property of an
with the type .
honorific-prefix (inside )
Gives the honorific prefix of the person.
Any number of properties with the name
present within the
property of an
with the type .
honorific-suffix (inside )
Gives the honorific suffix of the person.
Any number of properties with the name
present within the
property of an
with the type .
Gives the nickname of the person or organization.
The nickname is the descriptive name given instead
of or in addition to the one belonging to a person, place, or
thing. It can also be used to specify a familiar form of a proper
name specified by the
properties.
Any number of properties with the name
may be present within
with the type .
Gives a photograph of the person or organization.
Any number of properties with the name
may be present within each
with the type .
Gives the birth date of the person or organization.
A single property with the name
may be present within each
with the type .
Gives the delivery address of the person or organization.
with zero or more , , , and
properties, and optionally a
property, optionally
optionally a
property, and
optionally a
properties
are present within an
property of an
with the type , then the
postal, parcel, and work are implied.
Any number of properties with the name
may be present within each
with the type .
type (inside )
Gives the type of delivery address.
text that, when compared in a
is equal to one of the .
Within each
type , there must be no more
property whose value is
Any number of properties with the name
may be present within the
that forms the
property of an
with the type , but within each such
there must only be one
property per distinct
post-office-box (inside )
Gives the post office box component of the delivery address of
the person or organization.
Any number of properties with the name
present within the
property of an
with the type .
extended-address (inside )
Gives an additional component of the delivery address of the
person or organization.
Any number of properties with the name
be present within the
property of an
with the type .
street-address (inside )
Gives the street address component of the delivery address of
the person or organization.
Any number of properties with the name
present within the
property of an
with the type .
locality (inside )
Gives the locality component (e.g. city) of the delivery
address of the person or organization.
A single property with the name
may be present
within the
that forms the
property of an
with the type .
region (inside )
Gives the region component (e.g. state or province) of the
delivery address of the person or organization.
A single property with the name
may be present within
that forms the
property of an
with the type .
postal-code (inside )
Gives the postal code component of the delivery address of the
person or organization.
A single property with the name
may be present
within the
that forms the
property of an
with the type .
country-name (inside )
Gives the country name component of the delivery address of the
person or organization.
A single property with the name
present within the
property of an
with the type .
Gives the formatted text corresponding to the delivery address
of the person or organization.
either text or an
properties
and exactly one
properties
are present within an
property of an
with the type , or if the
property is text, then the
intl, postal, parcel, and work are implied.
Any number of properties with the name
may be present within each
with the type .
type (inside )
Gives the type of delivery address.
text that, when compared in a
is equal to one of the .
Within each
type , there must be no more
property whose value is
Any number of properties with the name
may be present within the
that forms the
property of an
with the type , but within each such
there must only be one
property per distinct
value (inside )
Gives the actual formatted text corresponding to the delivery
address of the person or organization.
Exactly one property with the name
must be present within
that forms the
property of an
with the type .
Gives the telephone number of the person or organization.
either text that can be interpreted as a telephone number as
defined in the CCITT specifications E.163 and X.121, or an
with zero or more
properties and exactly one
properties
are present within an
property of an
with the type , or if the
property is text, then the
voice is implied.
Any number of properties with the name
may be present within each
with the type .
type (inside )
Gives the type of telephone number.
text that, when compared in a
is equal to one of the .
Within each
type , there must be no more
property whose value is
Any number of properties with the name
may be present within the
that forms the
property of an
with the type , but within each such
there must only be one
property per distinct
value (inside )
Gives the actual telephone number of the person or
organization.
text that can be interpreted as a telephone number as defined in
the CCITT specifications E.163 and X.121.
Exactly one property with the name
must be present within the
that forms the
property of an
with the type .
Gives the e-mail address of the person or organization.
either text or an
properties
and exactly one
properties
are present within an
property of an
with the type , or if the
of such an
property is text, then the
internet is
Any number of properties with the name
may be present within each
with the type .
type (inside )
Gives the type of e-mail address.
text that, when compared in a
is equal to one of the .
Within each
type , there must be no more
property whose value is
Any number of properties with the name
may be present within the
that forms the
property of an
with the type , but within each such
there must only be one
property per distinct
value (inside )
Gives the actual e-mail address of the person or
organization.
Exactly one property with the name
must be present within
that forms the
property of an
with the type .
Gives the name of the e-mail software used by the person or
organization.
Any number of properties with the name
may be present within each
with the type .
Gives the time zone of the person or organization.
text and must match the following syntax:
Either a U+002B PLUS SIGN character (+) or a U+002D
HYPHEN-MINUS character (-).
that is exactly two
digits long and that represents a number in the range
A U+003A COLON character (:).
that is exactly two
digits long and that represents a number in the range
Any number of properties with the name
may be present within each
with the type .
Gives the geographical position of the person or
organization.
text and must match the following syntax:
Optionally, either a U+002B PLUS SIGN character (+) or a
U+002D HYPHEN-MINUS character (-).
One or more digits in the range U+0030 DIGIT ZERO .. U+0039
DIGIT NINE.
Optionally*, a U+002E FULL STOP character (.) followed by one
or more digits in the range U+0030 DIGIT ZERO .. U+0039 DIGIT
A U+003B SEMICOLON character (;).
Optionally, either a U+002B PLUS SIGN character (+) or a
U+002D HYPHEN-MINUS character (-).
One or more digits in the range U+0030 DIGIT ZERO .. U+0039
DIGIT NINE.
Optionally*, a U+002E FULL STOP character (.) followed by one
or more digits in the range U+0030 DIGIT ZERO .. U+0039 DIGIT
The optional components marked with an asterisk (*) should be
included, and should have dix digits each.
The value specifies latitude and longitude, in
that order (i.e., "LAT LON" ordering), in decimal degress. The
longitude represents the location east and west of the prime
meridian as a positive or negative real number, respectively.
latitude represents the location north and south of the equator as
a positive or negative real number, respectively.
Any number of properties with the name
may be present within each
with the type .
Gives the job title, functional position or function of the
person or organization.
Any number of properties with the name
may be present within each
with the type .
Gives the role, occupation, or business category of the person
or organization.
Any number of properties with the name
may be present within each
with the type .
Gives the logo of the person or organization.
Any number of properties with the name
may be present within each
with the type .
Gives the contact information of another person who will act on
behalf of the person or organization.
with the type
, or an , or text.
Any number of properties with the name
may be present within each
with the type .
Gives the name and units of the organization.
either text or an
property and zero or more organization-unit
properties.
Any number of properties with the name
may be present within each
with the type .
organization-name (inside )
Gives the name of the organization.
Exactly one property with the name
must be present within the
that forms the
property of an
with the type .
organization-unit (inside )
Gives the name of the organization unit.
Any number of properties with the name
may be present within the
that forms the
property of an
with the type .
categories
Gives the name of a category or tag that the person or
organization could be classified as.
Any number of properties with the name
may be present
within each
with the type
Gives supplemental information or a comment about the person or
organization.
Any number of properties with the name
may be present
within each
with the type
Gives the revision date and time of the contact
information.
text that is a .
The value distinguishes the current revision of
the information for other renditions of the information.
Any number of properties with the name
may be present within each
with the type .
sort-string
Gives the string to be used for sorting the person or
organization.
Any number of properties with the name
may be present
within each
with the type
Gives a sound file relating to the person or organization.
Any number of properties with the name
may be present within each
with the type .
relating to the person or
organization.
Any number of properties with the name
may be present within each
with the type .
Gives the access classification of the information regarding
the person or organization.
text with one of the following values:
confidential
This is merely advisory and cannot be
considered a confidentiality measure.
Any number of properties with the name
may be present
within each
with the type
for instant messaging and presence
protocol communications with the person or organization.
with zero or more
properties and exactly one
properties
are present within an
property of an
with the type , or if the
of such an
property is an , then no
Any number of properties with the name
may be present within each
with the type .
type (inside )
Gives the intended use of the IMPP .
text that, when compared in a
is equal to one of the .
Within each
type , there must be no more
property whose value is
Any number of properties with the name
may be present within the
that forms the
property of an
with the type , but within each such
there must only be one
property per distinct
value (inside )
Gives the actual
for instant messaging and
presence protocol communications with the person or
organization.
Exactly one property with the name
must be present within
that forms the
property of an
with the type .
The address type strings are:dom
Indicates a domestic delivery address.
Indicates an international delivery address.
Indicates a postal delivery address.
Indicates a parcel delivery address.
Indicates a residential delivery address.
Indicates a delivery address for a place of work.
Indicates the preferred delivery address when multiple
addresses are specified.
The telephone type strings are:home
Indicates a residential number.
Indicates a telephone number with voice messaging support.
Indicates a telephone number for a place of work.
Indicates a voice telephone number.
Indicates a facsimile telephone number.
Indicates a cellular telephone number.
Indicates a video conferencing telephone number.
Indicates a paging device telephone number.
Indicates a bulletin board system telephone number.
Indicates a MODEM-connected telephone number.
Indicates a car-phone telephone number.
Indicates an ISDN service telephone number.
Indicates a personal communication services telephone number.
Indicates the preferred telephone number when multiple
telephone numbers are specified.
The e-mail type strings are:internet
Indicates an Internet e-mail address.
Indicates a X.400 addressing type.
Indicates the preferred e-mail address when multiple e-mail
addresses are specified.
The IMPP type strings are:personal
Indicates the type of communication for which this IMPP
is appropriate.
Indicates the location of a device associated with this IMPP
Indicates the preferred address when multiple IMPP
s are specified.
5.4.2.1 Examples
Here is a long example
fictional character called "Jack Bauer":
&section id="jack" item="vcard"&
&h1 itemprop="fn"&Jack Bauer&/h1&
&img itemprop="photo" alt="" src="jack-bauer.jpg"&
&p itemprop="org" item&
&span itemprop="organization-name"&Counter-Terrorist Unit&/span&
(&span itemprop="organization-unit"&Los Angeles Division&/span&)
&span itemprop="adr" item&
&span itemprop="street-address"&10201 W. Pico Blvd.&/span&&br&
&span itemprop="locality"&Los Angeles&/span&,
&span itemprop="region"&CA&/span&
&span itemprop="postal-code"&90064&/span&&br&
&span itemprop="country-name"&United States&/span&&br&
&span itemprop="geo"&34.8.410623&/span&
&h2&Assorted Contact Methods&/h2&
&li itemprop="tel" item&&span itemprop="value"&+1 (310) 597
3781&/span& &span itemprop="type"&work&/span&
&meta itemprop="type" content="pref"&&/li&
&li&&a itemprop="url"
href="http://en.wikipedia.org/wiki/Jack_Bauer"&I'm on
Wikipedia&/a& so you can leave a message on my user talk
page.&/li&
&li&&a itemprop="url"
href="/"&Jack Bauer Facts&/a&&/li&
&li itemprop="email"&&a
href="mailto:j.bauer@la.ctu.gov.invalid"&j.bauer@la.ctu.gov.invalid&/a&&/li&
&li itemprop="tel" item&&span itemprop="value"&+1 (310) 555
3781&/span& &span&&meta itemprop="type" content="cell"&mobile
phone&/span&&/li&
&p itemprop="note"&If I'm out in the field, you may be better
off contacting &span itemprop="agent" item="vcard"&&a
itemprop="email" href="mailto:c.obrian@la.ctu.gov.invalid"&&span
itemprop="fn"&Chloe O'Brian&/span&&/a&&/span& if it's about
work, or ask &span itemprop="agent"&Tony Almeida&/span& if
you're interested in the CTU five-a-side football team we're
trying to get going.&/p&
&ins datetime="T21:00:00+0100"&
&span itemprop="rev" item&
&meta itemprop="type" content="date-time"&
&meta itemprop="value" content="T21:00:00+0100"&
&p itemprop="tel" item&&strong&Update!&/strong&
My new &span itemprop="type"&home&/span& phone number is
&span itemprop="value"&3&/span&.
&/section&
This example shows a site's contact details (using the
element) containing an address with two street
components:
&address item=vcard&
&strong title="fn"&Alfred Person&/strong& &br&
&span itemprop="adr" item&
&span itemprop="street-address"&1600 Amphitheatre Parkway&/span& &br&
&span itemprop="street-address"&Building 43, Second Floor&/span& &br&
&span itemprop="locality"&Mountain View&/span&,
&span itemprop="region"&CA&/span& &span itemprop="postal-code"&94043&/span&
&/address&
5.4.3 vEventAn item with the
vevent represents an event.The following are the type's . They are based on the
vocabulary defined in the iCalendar specification, where more
information on how to interpret the values can be found. Only the parts of the iCalendar vocabulary relating
this vocabulary cannot express a complete
iCalendar instance.attach
Gives the address of an associated document for the event.
Any number of properties with the name
may be present within each
with the type .
categories
Gives the name of a category or tag that the event could be
classified as.
Any number of properties with the name
may be present
within each
with the type
Gives the access classification of the information regarding
the event.
text with one of the following values:
confidential
This is merely advisory and cannot be
considered a confidentiality measure.
A single property with the name
may be present within each
with the type .
Gives a comment regarding the event.
Any number of properties with the name
may be present within each
with the type .
description
Gives a detailed description of the event.
A single property with the name
may be present
within each
with the type
Gives the geographical position of the event.
text and must match the following syntax:
Optionally, either a U+002B PLUS SIGN character (+) or a
U+002D HYPHEN-MINUS character (-).
One or more digits in the range U+0030 DIGIT ZERO .. U+0039
DIGIT NINE.
Optionally*, a U+002E FULL STOP character (.) followed by one
or more digits in the range U+0030 DIGIT ZERO .. U+0039 DIGIT
A U+003B SEMICOLON character (;).
Optionally, either a U+002B PLUS SIGN character (+) or a
U+002D HYPHEN-MINUS character (-).
One or more digits in the range U+0030 DIGIT ZERO .. U+0039
DIGIT NINE.
Optionally*, a U+002E FULL STOP character (.) followed by one
or more digits in the range U+0030 DIGIT ZERO .. U+0039 DIGIT
The optional components marked with an asterisk (*) should be
included, and should have dix digits each.
The value specifies latitude and longitude, in
that order (i.e., "LAT LON" ordering), in decimal degress. The
longitude represents the location east and west of the prime
meridian as a positive or negative real number, respectively.
latitude represents the location north and south of the equator as
a positive or negative real number, respectively.
A single property with the name
may be present within each
with the type .
Gives the location of the event.
A single property with the name
may be present within
with the type .
Gives a resource that will be needed for the event.
Any number of properties with the name
may be present within
with the type .
Gives the confirmation status of the event.
text with one of the following values:
A single property with the name
may be present within each
with the type .
Gives a short summary of the event.
User agents should replace U+000A LINE FEED (LF) characters in
SPACE characters when using the value.
A single property with the name
may be present within
with the type .
Gives the date and time by which the event ends.
If the property with the name
is present within an
with the type
that has a property with the name
whose value is a
, then the
of the property with
must be text
also. Otherwise, the
of the property
must be text that is a .
In either case, the
be later in time than
the value of the dtstart
property of the same .
The time given by the
property is not
inclusive. For day-long events, therefore, the the
property's
will be the day
after the end of the event.
A single property with the name
may be present within each
with the type , so long as that
does not have a property with the
Gives the date and time at which the event starts.
text that is either a
Exactly one property with the name
must be present within
with the type .
Gives the date and time at which the event starts.
text that is a .
The duration represented is the sum of all the durations
represented by integers in the value.
A single property with the name
may be present within
with the type , so long as that
does not have a property with the
Gives whether the event is to be considered as consuming time
on a calendar, for the purpose of free-busy time searches.
text with one of the following values:
transparent
A single property with the name
may be present within each
with the type .
Gives the contact information for the event.
Any number of properties with the name
may be present within
with the type .
for the event.
A single property with the name
may be present within each
with the type .
Gives a date and time at which the event does not occur despite
the recurrence rules.
text that is either a
Any number of properties with the name
may be present within
with the type .
Gives a rule for finding dates and times at which the event
does not occur despite the recurrence rules.
text that matches the RECUR value type defined in the iCalendar
specification.
Any number of properties with the name
may be present within
with the type .
Gives a date and time at which the event recurs.
text that is one of the following:
followed by
a U+002F SOLIDUS character (/) followed by a second
representing a later time.
followed by
a U+002F SOLIDUS character (/) followed by a .
Any number of properties with the name
may be present within
with the type .
Gives a rule for finding dates and times at which the event
text that matches the RECUR value type defined in the iCalendar
specification.
Any number of properties with the name
may be present within
with the type .
Gives the date and time at which the event information was first
created in a calendaring system.
text that is a .
A single property with the name
may be present within
with the type .
last-modified
Gives the date and time at which the event information was last
modified in a calendaring system.
text that is a .
A single property with the name
may be present within
with the type .
Gives a revision number for the event information.
text that is a .
A single property with the name
may be present within
with the type .
A string is a valid vevent duration string if it
matches the following pattern:A U+0050 LATIN CAPITAL LETTER P character.
One of the following:
followed by a
U+0057 LATIN CAPITAL LETTER W character. The integer represents
a duration of that number of weeks.
At least one, and possible both in this order, of the
following:
followed by a
U+0044 LATIN CAPITAL LETTER D character. The integer
represents a duration of that number of days.
A U+0054 LATIN CAPITAL LETTER T character followed by
any one of the following, or the first and second of the
following in that order, or the second and third of the
following in that order, or all three of the following in
this order:
followed by
a U+0048 LATIN CAPITAL LETTER H character. The integer
represents a duration of that number of hours.
followed by
a U+004D LATIN CAPITAL LETTER M character. The integer
represents a duration of that number of minutes.
followed by
a U+0053 LATIN CAPITAL LETTER S character. The integer
represents a duration of that number of seconds.
5.4.3.1 Examples
Here is an example of a page that uses the
vocabulary to mark up an event:
&body item="vevent"&
&h1 itemprop="summary"&Bluesday Tuesday: Money Road&/h1&
&time itemprop="dtstart" datetime="T19:00:00Z"&May 5th @ 7pm&/time&
(until &time itemprop="dtend" datetime="T21:00:00Z"&9pm&/time&)
&a href="http://livebrum.co.uk//bluesday-tuesday-money-road"
rel="bookmark" itemprop="url"&Link to this page&/a&
&p&Location: &span itemprop="location"&The RoadHouse&/span&&/p&
&p&&input type=button value="Add to Calendar"
onclick="location = getCalendar(this)"&&/p&
&meta itemprop="description" content="via livebrum.co.uk"&
The "getCalendar()" method could look like
function getCalendar(node) {
while (node && !node.item.contains('vevent'))
node = node.parentN
if (!node) {
alert('No event data found.');
var stamp = new Date();
var stampString = '' + stamp.getUTCFullYear() + (stamp.getUTCMonth() + 1) + stamp.getUTCDate() + 'T' +
stamp.getUTCHours() + stamp.getUTCMinutes() + stamp.getUTCSeconds() + 'Z';
var calendar = 'BEGIN:VCALENDAR\r\nPRODID:HTML\r\nVERSION:2.0\r\nBEGIN:VEVENT\r\nDTSTAMP:' + stampString + '\r\n';
for (var propIndex = 0; propIndex & node.properties. propIndex += 1) {
var prop = node.properties[propIndex];
var value = prop.
var parameters = '';
if (prop.localName == 'time') {
value = value.replace(/[:-]/g, '');
if (prop.date && prop.time)
parameters = ';VALUE=DATE';
parameters = ';VALUE=DATE-TIME';
value = value.replace(/\\/g, '\\n');
value = value.replace(/;/g, '\\;');
value = value.replace(/,/g, \\,');
value = value.replace(/\n/g, '\\n');
for (var nameIndex = 0; nameIndex & prop.itemprop. nameIndex += 1) {
var name = prop.itemprop[nameIndex];
if (!name.match(':') && !name.match('.'))
calendar += name.toUpperCase() + parameters + ':' + value + '\r\n';
calendar += 'END:VEVENT\r\nEND:VCALENDAR\r\n';
return 'data:text/component=vevent,' + encodeURI(calendar);
The same page could offer some markup, such as the following,
for copy-and-pasting into blogs:
&div item="vevent"&
&p&I'm going to
&strong itemprop="summary"&Bluesday Tuesday: Money Road&/strong&,
&time itemprop="dtstart" datetime="T19:00:00Z"&May 5th at 7pm&/time&
to &time itemprop="dtend" content="T21:00:00Z"&9pm&/time&,
at &span itemprop="location"&The RoadHouse&/span&!&/p&
&p&&a href="http://livebrum.co.uk//bluesday-tuesday-money-road"
itemprop="url"&See this event on livebrum.co.uk&/a&.&/p&
&meta itemprop="description" content="via livebrum.co.uk"&
5.4.4 Licensing worksAn item with the
work represents a work (e.g. an
article, an image, a video, a song, etc). This type is primarily
intended to allow authors to include licensing information for
works.The following are the type's .title
Gives the name of the work.
A single property with the name
may be present within each
with the type .
Gives the name or contact information of one of the authors or
creators of the work.
with the type
, or text.
Any number of properties with the name
may be present within each
with the type .
Identifies one of the licenses under which the work is
available.
Any number of properties with the name
may be present within each
with the type .
In addition, exactly one property with the name
must be present within each
with the type , giving the
work.5.4.4.1 Examples
This example shows an embedded image entitiled My
Pond, licensed under the Creative Commons Attribution-Share
Alike 3.0 United States License and the MIT license
simultaneously.
&figure item="work"&
&img itemprop="about" src="mypond.jpeg"&
&p&&cite itemprop="title"&My Pond&/cite&&/p&
&p&&small&Licensed under the &a itemprop="license"
href="http://creativecommons.org/licenses/by-sa/3.0/us/"&Creative
Commons Attribution-Share Alike 3.0 United States License&/a&
and the &a itemprop="license"
href="http://www.opensource.org/licenses/mit-license.php"&MIT
license&/a&.&/small&
5.5 Converting HTML to other formats
In all these algorithms, unless otherwise stated, operations that
iterate over a series of elements (whether items, properties, or
otherwise) must do so in .
A generic API upon which the vocaulary-specific conversions
defined below (vCard, iCalendar) can be built will need to provide
the following information when given a Document (or
equivalent):
The textContent of , if any.
The list of .
For each , the list of
properties that have that
For each property, its .
For each property, its
(which might be a
further ).
For each property, if its
is not itself an , whether the element is a
element, a , or another element.
5.5.1 JSON
Given a list of nodes nodes in a
Document, a user agent must run the following algorithm
to extract the microdata from those
nodes into a JSON form:
Let result be an empty object.
Let items be an empty array.
For each node in nodes, check if the element is a ,
and if it is then
for that element and
add it to items.
Add an entry to result called "items" whose value is the array items.
Return the result of serializing result
When the user agent is to get the object for an item
item, it must run the following substeps:
Let result be an empty object.
Add an entry to result called "type" whose value is the
Let properties be an empty
For each element element that has one or
item, run the following substeps:
Let value be the
of element.
If value is an , then
for value, and then replace
value with the object returned from those
For each name name in element's , run the
following substeps:
If there is no entry named name in
properties, then add an entry named name to properties whose
value is an empty array.
Append value to the entry named name in properties.
Add an entry to result called "properties" whose value is the array properties.
Return result.
To convert a Document to RDF, a user agent must run
the following algorithm:
is not null,
then generate the following triple:
http://purl.org/dc/terms/title
the textContent of , as a plain literal, with the language information set from the
of , if it is not unknown.
For each , , and
element in the Document, run these
If the element does not have a rel
attribute, then skip this element.
If the element does not have an href
attribute, then skip this element.
element's href attribute relative to the
element is not successful, then skip this element.
Otherwise, , obtaining list of tokens.
If list of tokens contains more than
one instance of the token , then
remove all such tokens.
Coalesce duplicate tokens in list of
If list of tokens contains both the
and , then remove them both
and replace them with the single (uppercase) token ALTERNATE-STYLESHEET.
For each token token in list of tokens that contains neither a U+003A
COLON character (:) nor a U+002E FULL STOP character (.),
generate the following triple:
the concatenation of the string "http://www.w3.org/1999/xhtml/vocab#" and token, with any characters in token that are not valid in the &ifragment& production of the IRI syntax being %-escaped
that results from
the value of the element's href attribute relative to the element
element in the Document
that has a
attribute and
attribute, if the
value of the
contains neither a U+003A COLON character (:) nor a U+002E FULL
STOP character (.), generate the following triple:
the concatenation of the string "http://www.w3.org/1999/xhtml/vocab#" and the value of the element's
attribute, , with any characters in the value that are not valid in the &ifragment& production of the IRI syntax being %-escaped
the value of the element's
attribute, as a plain literal, with the language information set from the
of the element, if it is not unknown.
For each , ,
element in the
Document that has a cite
attribute that
successfully relative to the element, generate the following
http://purl.org/dc/terms/source
that results from
the value of the element's cite attribute relative to the element
For each element that is also a , run the
following steps:
. Let item be the
subject returned.
Generate the following triple:
http://www.w3.org/1999/xhtml/vocab#item
If the element is, or is a descendant of, an
element that has no
element ancestors, and the
has the type , generate the following
http://purl.org/dc/terms/creator
When the user agent is to generate the triples for an
item item, it must follow the following
If of the elements whose
item, there are any with a
equal to the string
"", and the first such element
is a , and its
is not an , let subject
property. Otherwise, let subject be a new blank
Let type be the
If type is neither the empty string nor an
, then let type be
the result of concatenating the string "http://www.w3.org/1999/xhtml/custom#" with the
type, with any characters in type that are not valid in the &ifragment&
production of the IRI syntax being %-escaped.
If type is not the empty string, generate
the following triple:
http://www.w3.org/-rdf-syntax-ns#type
For each element element that has one or
item, run the following substeps:
Let value be the
of element.
If value is an , then
for value, and then replace value
with the subject returned from those steps.
Otherwise, if element is not one of
the , let value be a plain literal, with the language
information set from the
of the element, if
it is not unknown.
For each name name in element's , run the
following substeps:
If name is equal to the string
"", skip this name.
Otherwise, if type is , and name is
equal to the string "",
let name be the string "http://purl.org/dc/elements/1.1/title".
Otherwise, if type is , and name is
equal to the string "", let name be the string "http://creativecommons.org/ns#attributionName".
Otherwise, if type is , and name is
equal to the string "", let name be the string "http://www.w3.org/1999/xhtml/vocab#license".
Otherwise, if name is not an
, then let name be
the result of concatenating the string "http://www.w3.org/1999/xhtml/custom#" with name, with any characters in name that are not valid in the &ifragment&
production of the IRI syntax being %-escaped.
Generate the following triple:
Return subject.
5.5.3 vCard
Given a list of nodes nodes in a
Document, a user agent must run the following algorithm
to extract any vcard data represented by those nodes
(only the first vCard is returned):
If none of the nodes in nodes are
with the type , then there is no vCard. Abort the
algorithm, returning nothing.
Let node be the first node in nodes that is an
with the type .
Let output be an empty string.
with the type "BEGIN" and the value "VCARD"
to output.
with the type "PROFILE" and the value "VCARD"
to output.
with the type "VERSION" and the value "3.0"
to output.
with the type "SOURCE" and the result of
that is the
as the value to output.
is not null,
with the type "NAME" and with the result of
obtained from the textContent
as the value to output.
If there is a property named
node and the element of the first such property
that is not an ,
with the type "UID" and with the result of
that is that property's
as the value to
For each element element that has one or
node: for each name name
in element's , run
the following substeps:
If name is equal to the string "", skip this name.
Let parameters be an empty set of
name-value pairs.
Run the appropriate set of substeps from the following
list. The steps will set a variable value,
which is used in the next step.
If the property's
and name is
Let n1 be the
of the first
property named
in subitem, or the empty string if there is no
such property or the property's value is itself an .
Let n2 be the
of the first
property named
in subitem, or the empty string if there is no
such property or the property's value is itself an .
Let n3 be the
of the first
property named
subitem, or the empty string if there is
no such property or the property's value is itself an .
Let n4 be the
of the first
property named
in subitem, or the empty string if there
is no such property or the property's value is itself an
Let n5 be the
of the first
property named
in subitem, or the empty string if there
is no such property or the property's value is itself an
Let value be the concatenation of the
following, in this order:
The result of
A U+003B SEMICOLON character (;)
The result of
A U+003B SEMICOLON character (;)
The result of
A U+003B SEMICOLON character (;)
The result of
A U+003B SEMICOLON character (;)
The result of
If the property's
and name is
Let value be the empty
Append to value the result of
in subitem.
Append a U+003B SEMICOLON character (;) to value.
Append to value the result of
in subitem.
Append a U+003B SEMICOLON character (;) to value.
Append to value the result of
Append a U+003B SEMICOLON character (;) to value.
Append to value the result of
in subitem.
Append a U+003B SEMICOLON character (;) to value.
Append to value the result of
in subitem.
Append a U+003B SEMICOLON character (;) to value.
Append to value the result of
Append a U+003B SEMICOLON character (;) to value.
Append to value the result of
in subitem.
If there is a property named
in subitem, and the first such property has a
that is not
and whose value
consists only of ,
then add a parameter named "TYPE" whose
value is the
of that property
to parameters.
If the property's
and name is
Let value be the empty
Append to value the result of
in subitem.
For each property named
in subitem, run the following steps:
of the property
is an , then skip
this property.
Append a U+003B SEMICOLON character (;) to value.
Append the result of
given by the
of the property
If the property's
with the type
and name is
Let value be the result of
obtained from
from the element that
represents subitem.
Add a parameter named "VALUE"
whose value is "VCARD" to parameters.
If the property's
is none of the above
Let value the result of
value in subitem.
If there is a property named type in subitem, and the
first such property has a
that is not an
and whose value
consists only of ,
then add a parameter named "TYPE" whose
value is the
of that property
to parameters.
Otherwise (the property's
is not an )
Let value be the property's .
If element is one of the , add a parameter with the name "VALUE" and the value "URI" to parameters.
Otherwise, if element is a
element and the value is
a , add a parameter with the name
"VALUE" and the value "DATE" to parameters.
Otherwise, if element is a
element and the value is
parameter with the name "VALUE" and the
value "DATE-TIME" to parameters.
Prefix every U+005C REVERSE SOLIDUS character (\) in
value with another U+005C REVERSE SOLIDUS
character (\).
Prefix every U+002C COMMA character (,) in value with a U+005C REVERSE SOLIDUS character
Unless name is , prefix every U+003B SEMICOLON
character (;) in value with a U+005C
REVERSE SOLIDUS character (\).
Replace every U+000D CARRIAGE RETURN U+000A LINE FEED
character pair (CRLF) in value with a U+005C REVERSE
SOLIDUS character (\) followed by a U+006E LATIN SMALL LETTER
Replace every remaining U+000D CARRIAGE RETURN (CR) or
U+000A LINE FEED (LF) character in value
with a U+005C REVERSE SOLIDUS character (\) followed by a U+006E
LATIN SMALL LETTER N.
with the type name, the parameters parameters, and the value value to output.
If there is no property named
is node, then run the following
If there is no property named
node, then skip the remainder of these
If the first property named
node has a
that is an , then skip the remainder of
these substeps.
Let fn be the
of the first property
If there is a property named
node, and the
of the first such
property is equal to fn (and is not an ), then
with the type "N" whose value
is four U+003B SEMICOLON characters (";;;;") to output. Then, skip
the remainder of these substeps.
in fn, if any, are not all
contiguous, then skip the remainder of these substeps.
, and let part
one be the first resulting token, and part
two be the second, if any, or the empty string if there is
no second token. (There cannot be three, given the previous
If the last character of part one is a
U+002C COMMA character (,), then remove that character from part one and
the type "N" whose value is the
concatenation of the following strings:
The result of
A U+003B SEMICOLON character (;)
The result of
Three U+003B SEMICOLON characters (;)
Then, skip the remainder of these substeps.
If part two is two Unicode code-points
long and its second character is a U+002E FULL STOP character
with the type "N" whose value is the concatenation of the
following strings:
The result of
A U+003B SEMICOLON character (;)
The result of
consisting of the first character of part two
Three U+003B SEMICOLON characters (;)
Then, skip the remainder of these substeps.
If part two is one Unicode code-point
long, then
with the type "N" whose value is the concatenation of the
following strings:
The result of
A U+003B SEMICOLON character (;)
The result of
Three U+003B SEMICOLON characters (;)
Then, skip the remainder of these substeps.
with the type "N" whose value is the concatenation of the
following strings:
The result of
A U+003B SEMICOLON character (;)
The result of
Three U+003B SEMICOLON characters (;)
with the type "END" and the value "VCARD"
to output.
When the above algorithm says that the user agent is to add
a vCard line consisting of a type type,
optionally some parameters, and a value value to
a string output, it must run the following
Let line be an empty string.
Append type, , to line.
If there are any parameters, then for each parameter, in the
order that they were added, run these substeps:
Append a U+003B SEMICOLON character (;) to line.
Append the parameter's name to line.
Append a U+003D EQUALS SIGN character (=) to line.
Append the parameter's value to line.
Append a U+003A COLON character (:) to line.
Append value to line.
Let maximum length be 75.
If and while line is longer than maximum length Unicode code points long, run the
following substeps:
Append the first maximum length
Unicode code points of line to output.
Remove the first maximum length
Unicode code points from line.
Append a U+000D CARRIAGE RETURN character (CR) to output.
Append a U+000A LINE FEED character (LF) to output.
Append a U+0020 SPACE character to output.
Let maximum length be 74.
Append (what remains of) line to output.
Append a U+000D CARRIAGE RETURN character (CR) to output.
Append a U+000A LINE FEED character (LF) to output.
When the steps above require the user agent to obtain the result
of collecting vCard subproperties named subname in subitem, the user
agent must run the following steps:
Let value be the empty string.
For each property named subname in the item
subitem, run the following substeps:
of the property is itself an , then skip this
If this is not the first property named subname in subitem (ignoring
any that were skipped by the previous step), then append a U+002C
COMMA character (,) to value.
Append the result of
given by the
of the property to
Return value.
When the steps above require the user agent to obtain the result
of collecting the first vCard subproperty named subname in subitem, the user
agent must run the following steps:
If there are no properties named subname
in subitem, then abort these substeps,
returning the empty string.
the first property named subname in subitem is an , then abort these substeps,
returning the empty string.
Return the result of
given by the
of the first property
named subname in subitem.
When the above algorithms say the user agent is to escape the vCard text
string value, the user agent must use the
following steps:
Prefix every U+005C REVERSE SOLIDUS character (\) in value with another U+005C REVERSE SOLIDUS character
Prefix every U+002C COMMA character (,) in value with a U+005C REVERSE SOLIDUS character
Prefix every U+003B SEMICOLON character (;) in value with a U+005C REVERSE SOLIDUS character
Replace every U+000D CARRIAGE RETURN U+000A LINE FEED
character pair (CRLF) in value with a U+005C
REVERSE SOLIDUS character (\) followed by a U+006E LATIN SMALL
Replace every remaining U+000D CARRIAGE RETURN (CR) or
U+000A LINE FEED (LF) character in value with a
U+005C REVERSE SOLIDUS character (\) followed by a U+006E LATIN
SMALL LETTER N.
Return the mutated value.
This algorithm can generate invalid vCard output, if
the input does not conform to the rules described for the
5.5.4 iCalendar
Given a list of nodes nodes in a
Document, a user agent must run the following algorithm
to extract any vevent data represented by those
If none of the nodes in nodes are
with the type , then there is no vEvent
data. Abort the algorithm, returning nothing.
Let output be an empty string.
with the type "BEGIN" and the value "VCALENDAR"
to output.
with the type "PRODID" and the value equal to a user-agent
specific string representing the user agent to output.
with the type "VERSION" and the value "2.0"
to output.
For each node node in nodes that is an
with the type , run the following steps:
with the type "BEGIN" and the value "VEVENT"
to output.
with the type "DTSTAMP" and a value consisting of an iCalendar
DATE-TIME string representing the current date and time, with the
annotation "VALUE=DATE-TIME", to output.
If there is a property named
node and the element of the first such property
that is not an ,
with the type "UID" and that property's
as the value to
For each element element that has one or
node: for each name name
in element's , run
t

我要回帖

更多关于 have time to do 的文章

 

随机推荐