One document matched: draft-ietf-vcarddav-vcardxml-05.xml
<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc rfcedstyle="yes" ?>
<?rfc rfcprocack="yes"?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?><!-- default = 3 -->
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc strict="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<rfc ipr="trust200902" docName="draft-ietf-vcarddav-vcardxml-05" category="std">
<front>
<title abbrev="vCard XML">vCard XML Representation</title>
<author initials="S." surname="Perreault" fullname="Simon Perreault">
<organization>Viagénie</organization>
<address>
<postal>
<street>2600 boul. Laurier, suite 625</street>
<city>Québec</city>
<region>QC</region>
<code>G1V 4W1</code>
<country>Canada</country>
</postal>
<phone>+1 418 656 9254</phone>
<email>simon.perreault@viagenie.ca</email>
<uri>http://www.viagenie.ca</uri>
</address>
</author>
<date year="2010"/>
<area>Applications</area>
<keyword>vcard</keyword>
<abstract>
<t>This document defines the XML schema of the vCard data format.</t>
</abstract>
</front>
<middle>
<section title="Introduction">
<t>vCard <xref target="I-D.ietf-vcarddav-vcardrev"/> is a data
format for representing and exchanging information about individuals and
other entities.
It is a text-based format (as opposed to a binary format). This
document defines an XML representation for vCard. The underlying data
structure is exactly the same, enabling a 1-to-1 mapping between the
original vCard format and the XML representation. The XML formatting may
be preferred in some contexts where an XML engine is readily available
and may be reused instead of writing a stand-alone vCard parser.</t>
<t>Earlier work on an XML format for vCard was started in 1998 by Frank
Dawson <xref target="I-D.dawson-vcard-xml-dtd"/>. Sadly it did not take
over the world.</t>
</section>
<section title="The Schema">
<t>The schema is expressed in the RELAX NG language <xref
target="relaxng"/><xref target="relaxng-compact"/> and is found in
<xref target="schema"/>.</t>
</section>
<section title="Example: Author's XML vCard">
<figure>
<artwork>
<![CDATA[%%simon.xml%%]]>
</artwork>
</figure>
</section>
<section title="Design Considerations">
<t>The general idea is to map vCard parameters, properties, and value
types to XML elements. For example, the "FN" property is mapped to the
"fn" element. That element in turn contains a text element whose
content corresponds to the vCard property's value.</t>
<t>vCard parameters are also mapped to XML elements. They are contained in
the <parameters> element, which is contained in property elements.
For example, the "TYPE" parameter applied to the "TEL" property would
look like the following in XML:</t>
<figure>
<artwork><![CDATA[
<tel>
<parameters>
<type>voice</type>
<type>video</type>
</parameters>
<uri>tel:+1-555-555-555</uri>
</tel>
]]></artwork>
</figure>
<t>Parameters taking a list of values are simply repeated multiple times,
once for each value in the list.</t>
<t>Properties having structured values (e.g. the "N" property) are
expressed by XML element trees. Element names in that tree (e.g.
"surname", "given", etc.) do not have a vCard equivalent since they
are identified by position in plain vCard.</t>
<t>Line folding is a non-issue in XML. Therefore, the mapping from vCard
to XML is done after the unfolding procedure is carried out.
Conversely, the mapping from XML to vCard is done before the folding
procedure is carried out.</t>
<t>A top-level <vcards> element is used as root. It contains one or
more <vcard> element, each representing a complete vCard. The
<vcards> element MUST be present even when only a single vCard is
present in an XML document.</t>
<t>The group construct (Section 3.2 in <xref
target="I-D.ietf-vcarddav-vcardrev"/>) is represented with the
<group> element. The "name" attribute contains the group's
name. For example:</t>
<figure>
<artwork><![CDATA[
<vcards>
<vcard>
<group name="contact">
<fn>...</fn>
<email>...</email>
</group>
<group name="media">
<photo>...</photo>
</group>
<categories>...</categories>
</vcard>
</vcards>
]]></artwork>
</figure>
<t>is equivalent to:</t>
<figure>
<artwork><![CDATA[
BEGIN:VCARD
VERSION:4.0
contact.FN=...
contact.EMAIL=...
media.PHOTO=...
CATEGORIES=...
END:VCARD
]]></artwork>
</figure>
<section title="Extensibility">
<t>The original vCard format is extensible. New properties, parameters,
data types and values (collectively known as vCard objects) can be
registered with IANA. It is expected that these vCard extensions will
also specify extensions to the XML format described in this
document.</t>
<t>Unregistered extensions (i.e. those starting with "X-" and
"VND-...-") are expressed in XML by using elements starting with "x-"
and "vnd-...-". Usage of XML namespaces for extensibility is
RECOMMENDED for extensions that have no equivalent in plain text
vCard. Refer to <xref target="conversion"/> for the implications when
converting between plain-text vCard and XML.</t>
<figure>
<preamble>Examples:</preamble>
<artwork><![CDATA[
<x-my-prop>
<parameters>
<pref>1</pref>
<text>value goes here</text>
<x-my-prop>
<ext:my-prop
ext:xmlns="http://example.com/extensions/my-vcard">
<parameters>
<pref>1</pref>
</parameters> <!-- Core vCard elements -->
<text>value goes here</text> <!-- are still accessible -->
</ext:my-prop>
]]></artwork>
</figure>
<t>Note that extension elements do not need the "X- or "VND-" prefix in
XML. The XML namespace mechanism is sufficient.</t>
<t>A vCard XML parser MUST ignore XML elements and attributes for which
it doesn't recognize the expanded name. The normal behaviour of
ignoring XML processing instructions whose target is not recognized
MUST also be followed.</t>
<t>In the original vCard format, the "VERSION" property was mandatory and
played a role in extensibility. In XML, this property is absent. Its
role is played by the vCard core namespace identifier, which includes
the version number. vCard revisions will use a different
namespace.</t>
<t>Parameters containing a list of values are expressed using a list of
elements in XML (e.g. the <type> element).</t>
</section>
<section title="Limitations">
<t>The schema does not validate the cardinality of properties. This is a
limitation of the schema definition language. Cardinalities of the
original vCard format <xref target="I-D.ietf-vcarddav-vcardrev"/>
MUST still be respected.</t>
<t>Some constructs (e.g. value enumerations in type parameters) have
additional ordering constraints in XML. This is a result of
limitations of the schema definition language and the order is
arbitrary. The order MUST be respected in XML for the vCard to be
valid. However, reordering as part of conversion to or from plain
vCard MAY happen.</t>
</section>
</section>
<section title="Format Conversions" anchor="conversion">
<t>When converting from XML vCard (this specification) to plain-text vCard
<xref target="I-D.ietf-vcarddav-vcardrev"/>, the following rules
apply:</t>
<t>
<list style="symbols">
<t>Properties in the vCard 4 namespace:
<list style="symbols">
<t>If the converter knows of a specific plain-text representation
for this property, it uses it. For example, the <adr>
element corresponds to the "ADR" property, which is encoded
using comma-separated lists separated by semi-colons.</t>
<t>Otherwise, the property name is taken from the element name,
property parameters are taken from the <parameters>
element, and the content of the property is taken from the
content of the value element. If the property element has
attributes or contains other XML elements, they are dropped.</t>
<t>If a standard property's XML element contains XML elements and
attributes for which the converter doesn't recognize the
expanded name, they are dropped. Therefore, it is RECOMMENDED to
limit extensions to the property level to ensure that all data
is preserved intact in round-trip conversions.</t>
</list>
</t>
<t>Properties in other namespaces are wrapped as-is inside an "XML"
property.</t>
<t>Property value escaping (Section 3.3 of <xref
target="I-D.ietf-vcarddav-vcardrev"/>) is carried out. For
example, a NEWLINE character (ASCII decimal 10) becomes "\n".</t>
<t>Double-quoting of parameter values, as well as backslash escaping
in parameter values, is carried out. For example,
<param>"foo","bar"</param> becomes
PARAM="\"foo\",\"bar\"".</t>
</list>
</t>
<t>When converting from plain-text vCard <xref
target="I-D.ietf-vcarddav-vcardrev"/> to XML vCard (this
specification), the following rules apply:</t>
<t>
<list style="symbols">
<t>The content of "XML" properties is converted as-is to XML.</t>
<t>Properties for which the converter knows of a specific XML
representation use it. For example, the "ADR" property is
represented using the <adr> element and related
sub-elements.</t>
<t>Other properties are converted to XML in the following way:
<list style="symbols">
<t>The XML namespace of the property element is set to the vCard 4
namespace.</t>
<t>The name of the property element is set to the lowercased name
of the property.</t>
<t>If the property has parameters, they get translated as-is
(without lowercasing of parameter names, removal of backslash
escaping, and removal of quoting) into sub-elements of the
<parameters> element</t>
<t>The property element contains a single <text> element
whose content is copied as-is from the property's value.</t>
</list>
</t>
<t>Property value escaping is undone. For example, "\n" becomes a
NEWLINE character (ASCII decimal 10).</t>
<t>Double-quoting of parameter values, as well as backslash escaping
in parameter values, is undone. For example, PARAM="\"foo\",\"bar\"" becomes
<param>"foo","bar"</param>.</t>
</list>
</t>
<t>For example, these two vCards are equivalent:</t>
<figure>
<artwork><![CDATA[
<xml version="1.0">
<vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
<vcard>
<fn><text>J. Doe</text></fn>
<n>
<surname><text>Doe</text></surname>
<given><text>J.</text></given>
<prefix/>
<suffix/>
</n>
<x-file>
<parameters><type>image/jpeg</type></parameters>
<text>alien.jpg</text>
</x-file>
<a xmlns="http://www.w3.org/1999/xhtml"
href="http://www.example.com">My web page!</a>
</vcard>
</vcards>
</xml>
]]></artwork>
</figure>
<figure>
<artwork><![CDATA[
BEGIN:VCARD
VERSION:4.0
FN:J. Doe
N:Doe;J.;;
X-FILE;TYPE=image/jpeg:alien.jpg
XML:<a xmlns="http://www.w3.org/1999/xhtml"\n
href="http://www.example.com">My web page!</a>
END:VCARD
]]></artwork>
</figure>
</section>
<section title="Security Considerations" anchor="security">
<t>All the security considerations applicable to plain vCard <xref
target="I-D.ietf-vcarddav-vcardrev"/> are applicable to this document
as well.</t>
</section>
<section title="IANA Considerations">
<section title="Registration of the XML Namespace">
<t>
<list style="hanging">
<t hangText="URI:">urn:ietf:params:xml:ns:vcard-4.0</t>
<t hangText="Registrant Contact:">Simon Perreault
<simon.perreault@viagenie.ca></t>
<t hangText="XML:">None. Namespace URIs do not represent an XML
specification.</t>
</list>
</t>
</section>
<section title="Media Type">
<t>This section defines the MIME media type for use with vCard-in-XML
data.</t>
<t>
<list style="hanging">
<t hangText="To:">ietf-types@iana.org</t>
<t hangText="Subject:">Registration of media type
application/vcard+xml</t>
<t hangText="Type name:">application</t>
<t hangText="Subtype name:">vcard+xml</t>
<t hangText="Required parameters:">none</t>
<t hangText="Optional parameters:">none</t>
<t hangText="Encoding considerations:">Same as for
application/xml.</t>
<t hangText="Security considerations:">See <xref
target="security"/>.</t>
<t hangText="Interoperability considerations:">This media type
provides an alternative syntax to vCard data <xref
target="I-D.ietf-vcarddav-vcardrev"/> based on XML.</t>
<t hangText="Published specification:">This specification.</t>
<t hangText="Applications which use this media type:">Applications
that currently make use of the text/vcard media type can use this
as an alternative.</t>
<t hangText="Additional information:">
<list style="hanging">
<t hangText="Magic number(s):">none</t>
<t hangText="File extension(s):">XML data should use ".xml" as
the file extension.</t>
<t hangText="Macintosh file type code(s):">none</t>
</list>
</t>
<t hangText="Person & email address to contact for further
information:">Simon Perreault
<simon.perreault@viagenie.ca></t>
<t hangText="Intended usage:">COMMON</t>
<t hangText="Restrictions on usage:">none</t>
<t hangText="Author:">Simon Perreault</t>
<t hangText="Change controller:">IETF</t>
</list>
</t>
</section>
</section>
<section title="Acknowledgements">
<t>Thanks to the following people for their input:</t>
<t>Alexey Melnikov, Barry Leiba, Cyrus Daboo, Joe Hildebrand, Joseph
Smarr, Marc Blanchet, Peter Saint-Andre, Robins George, Zahhar Kirillov,
Zoltan Ordogh.</t>
</section>
</middle>
<back>
<references title="Normative References">
<?rfc include="reference.I-D.draft-ietf-vcarddav-vcardrev-12"?>
<?rfc include="reference.relaxng"?>
<?rfc include="reference.relaxng-compact"?>
</references>
<references title="Informative References">
<?rfc include="reference.I-D.draft-dawson-vcard-xml-dtd-03"?>
</references>
<section title="Relax NG Schema" anchor="schema">
<figure>
<artwork>
<![CDATA[%%vcard.rnc%%]]>
</artwork>
</figure>
</section>
<section
title="Change Log (to be removed by RFC Editor prior to publication)"
anchor="changelog">
<section title="Changes in -05">
<t>
<list style="symbols">
<t>Synchronized with draft-ietf-vcarddav-vcardrev-13.</t>
</list>
</t>
</section>
<section title="Changes in -04">
<t>
<list style="symbols">
<t>Synchronized with draft-ietf-vcarddav-vcardrev-12.</t>
<t>Added application/vcard+xml media type.</t>
<t>Added rules for backslash escaping and quoting when
converting.</t>
<t>Added description of <vcards> element.</t>
<t>Described group construct in XML.</t>
</list>
</t>
</section>
<section title="Changes in -03">
<t>
<list style="symbols">
<t>Created "Format Conversions" section.</t>
<t>Turned more <type> parameter values into plain text.</t>
<t>Removed need for empty value elements in components.</t>
<t>Wrapped value of <sex>, <class>, and <kind> in
value elements.</t>
</list>
</t>
</section>
<section title="Changes in -02">
<t>
<list style="symbols">
<t>Synchronized with draft-ietf-vcarddav-vcardrev-10.</t>
<t>Turned <type> parameter values into plain text.</t>
<t>Moved the "XML" property to vCard base.</t>
<t>Changed title to avoid confusion with XML Schema.</t>
<t>Added prefixes "value-", "param-", and "property-" in schema.</t>
<t>Better language for specifying what a parser must ignore.</t>
</list>
</t>
</section>
<section title="Changes in -01">
<t>
<list style="symbols">
<t>Synchronized with draft-ietf-vcarddav-vcardrev-09.</t>
<t>Added the <vcards> element to allow multiple vCards in a
single XML file.</t>
<t>Created the <parameters> container element.</t>
<t>Use text value for enumeration in <class> element.</t>
<t>Created the "XML" vCard property.</t>
<t>Added IANA considerations section.</t>
<t>Added security considerations section.</t>
</list>
</t>
</section>
<section title="Changes in -00">
<t>
<list style="symbols">
<t>Same as draft-perreault-vcarddav-vcardxml-02.</t>
</list>
</t>
</section>
</section>
</back>
</rfc>
| PAFTECH AB 2003-2026 | 2026-04-24 01:21:55 |