]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/docs/rfc6351.txt
Merge branch '3.6-release'
[friendica-addons.git] / dav / SabreDAV / docs / rfc6351.txt
1
2
3
4
5
6
7 Internet Engineering Task Force (IETF)                      S. Perreault
8 Request for Comments: 6351                                      Viagenie
9 Category: Standards Track                                    August 2011
10 ISSN: 2070-1721
11
12
13                     xCard: vCard XML Representation
14
15 Abstract
16
17    This document defines the XML schema of the vCard data format.
18
19 Status of This Memo
20
21    This is an Internet Standards Track document.
22
23    This document is a product of the Internet Engineering Task Force
24    (IETF).  It represents the consensus of the IETF community.  It has
25    received public review and has been approved for publication by the
26    Internet Engineering Steering Group (IESG).  Further information on
27    Internet Standards is available in Section 2 of RFC 5741.
28
29    Information about the current status of this document, any errata,
30    and how to provide feedback on it may be obtained at
31    http://www.rfc-editor.org/info/rfc6351.
32
33 Copyright Notice
34
35    Copyright (c) 2011 IETF Trust and the persons identified as the
36    document authors.  All rights reserved.
37
38    This document is subject to BCP 78 and the IETF Trust's Legal
39    Provisions Relating to IETF Documents
40    (http://trustee.ietf.org/license-info) in effect on the date of
41    publication of this document.  Please review these documents
42    carefully, as they describe your rights and restrictions with respect
43    to this document.  Code Components extracted from this document must
44    include Simplified BSD License text as described in Section 4.e of
45    the Trust Legal Provisions and are provided without warranty as
46    described in the Simplified BSD License.
47
48
49
50
51
52
53
54
55
56
57
58 Perreault                    Standards Track                    [Page 1]
59 \f
60 RFC 6351                          xCard                      August 2011
61
62
63 Table of Contents
64
65    1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  2
66    2.  Conventions  . . . . . . . . . . . . . . . . . . . . . . . . .  2
67    3.  The Schema . . . . . . . . . . . . . . . . . . . . . . . . . .  2
68    4.  Example: Author's XML vCard  . . . . . . . . . . . . . . . . .  3
69    5.  Design Considerations  . . . . . . . . . . . . . . . . . . . .  4
70      5.1.  Extensibility  . . . . . . . . . . . . . . . . . . . . . .  6
71      5.2.  Limitations  . . . . . . . . . . . . . . . . . . . . . . .  7
72    6.  Format Conversions . . . . . . . . . . . . . . . . . . . . . .  8
73    7.  Security Considerations  . . . . . . . . . . . . . . . . . . . 10
74    8.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 11
75      8.1.  Registration of the XML Namespace  . . . . . . . . . . . . 11
76      8.2.  Media Type . . . . . . . . . . . . . . . . . . . . . . . . 11
77    9.  Acknowledgments  . . . . . . . . . . . . . . . . . . . . . . . 12
78    10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 12
79      10.1. Normative References . . . . . . . . . . . . . . . . . . . 12
80      10.2. Informative References . . . . . . . . . . . . . . . . . . 13
81    Appendix A.  Relax NG Schema . . . . . . . . . . . . . . . . . . . 14
82
83 1.  Introduction
84
85    vCard [RFC6350] is a data format for representing and exchanging
86    information about individuals and other entities.  It is a text-based
87    format (as opposed to a binary format).  This document defines xCard,
88    an XML [W3C.REC-xml-20081126] representation for vCard.  The
89    underlying data structure is exactly the same, enabling a 1-to-1
90    mapping between the original vCard format and the XML representation.
91    The XML formatting may be preferred in some contexts where an XML
92    engine is readily available and may be reused instead of writing a
93    standalone vCard parser.
94
95    Earlier work on an XML format for vCard was started in 1998 by Frank
96    Dawson [VCARD-DTD].  Sadly, it did not take over the world.
97
98 2.  Conventions
99
100    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
101    "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
102    document are to be interpreted as described in [RFC2119].
103
104 3.  The Schema
105
106    The schema is expressed in the RELAX NG language [ISO.19757-2.2008]
107    and is found in Appendix A.
108
109
110
111
112
113
114 Perreault                    Standards Track                    [Page 2]
115 \f
116 RFC 6351                          xCard                      August 2011
117
118
119 4.  Example: Author's XML vCard
120
121    <?xml version="1.0" encoding="UTF-8"?>
122    <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
123      <vcard>
124        <fn><text>Simon Perreault</text></fn>
125        <n>
126          <surname>Perreault</surname>
127          <given>Simon</given>
128          <additional/>
129          <prefix/>
130          <suffix>ing. jr</suffix>
131          <suffix>M.Sc.</suffix>
132        </n>
133        <bday><date>--0203</date></bday>
134        <anniversary>
135          <date-time>20090808T1430-0500</date-time>
136        </anniversary>
137        <gender><sex>M</sex></gender>
138        <lang>
139          <parameters><pref><integer>1</integer></pref></parameters>
140          <language-tag>fr</language-tag>
141        </lang>
142        <lang>
143          <parameters><pref><integer>2</integer></pref></parameters>
144          <language-tag>en</language-tag>
145        </lang>
146        <org>
147          <parameters><type><text>work</text></type></parameters>
148          <text>Viagenie</text>
149        </org>
150        <adr>
151          <parameters>
152            <type><text>work</text></type>
153            <label><text>Simon Perreault
154    2875 boul. Laurier, suite D2-630
155    Quebec, QC, Canada
156    G1V 2M2</text></label>
157          </parameters>
158          <pobox/>
159          <ext/>
160          <street>2875 boul. Laurier, suite D2-630</street>
161          <locality>Quebec</locality>
162          <region>QC</region>
163          <code>G1V 2M2</code>
164          <country>Canada</country>
165        </adr>
166        <tel>
167
168
169
170 Perreault                    Standards Track                    [Page 3]
171 \f
172 RFC 6351                          xCard                      August 2011
173
174
175          <parameters>
176            <type>
177              <text>work</text>
178              <text>voice</text>
179            </type>
180          </parameters>
181          <uri>tel:+1-418-656-9254;ext=102</uri>
182        </tel>
183        <tel>
184          <parameters>
185            <type>
186              <text>work</text>
187              <text>text</text>
188              <text>voice</text>
189              <text>cell</text>
190              <text>video</text>
191            </type>
192          </parameters>
193          <uri>tel:+1-418-262-6501</uri>
194        </tel>
195        <email>
196          <parameters><type><text>work</text></type></parameters>
197          <text>simon.perreault@viagenie.ca</text>
198        </email>
199        <geo>
200          <parameters><type><text>work</text></type></parameters>
201          <uri>geo:46.766336,-71.28955</uri>
202        </geo>
203        <key>
204          <parameters><type><text>work</text></type></parameters>
205          <uri>http://www.viagenie.ca/simon.perreault/simon.asc</uri>
206        </key>
207        <tz><text>America/Montreal</text></tz>
208        <url>
209          <parameters><type><text>home</text></type></parameters>
210          <uri>http://nomis80.org</uri>
211        </url>
212      </vcard>
213    </vcards>
214
215 5.  Design Considerations
216
217    The general idea is to map vCard parameters, properties, and value
218    types to XML elements.  For example, the "FN" property is mapped to
219    the "fn" element.  In turn, that element contains a text element
220    whose content corresponds to the vCard property's value.
221
222
223
224
225
226 Perreault                    Standards Track                    [Page 4]
227 \f
228 RFC 6351                          xCard                      August 2011
229
230
231    vCard parameters are also mapped to XML elements.  They are contained
232    in the <parameters> element, which is contained in property elements.
233    For example, the "TYPE" parameter applied to the "TEL" property would
234    look like the following in XML:
235
236      <tel>
237        <parameters>
238          <type>
239            <text>voice</text>
240            <text>video</text>
241          </type>
242        </parameters>
243        <uri>tel:+1-555-555-555</uri>
244      </tel>
245
246    Parameters taking a list of values are simply repeated multiple
247    times, once for each value in the list.
248
249    Properties having structured values (e.g., the "N" property) are
250    expressed by XML element trees.  Element names in that tree (e.g.,
251    "surname", "given", etc.) do not have a vCard equivalent since they
252    are identified by position in plain vCard.
253
254    Line folding is a non-issue in XML.  Therefore, the mapping from
255    vCard to XML is done after the unfolding procedure is carried out.
256    Conversely, the mapping from XML to vCard is done before the folding
257    procedure is carried out.
258
259    A top-level <vcards> element is used as root.  It contains one or
260    more <vcard> elements, each representing a complete vCard.  The
261    <vcards> element MUST be present even when only a single vCard is
262    present in an XML document.
263
264    The group construct (Section 3.2 in [RFC6350]) is represented with
265    the <group> element.  The "name" attribute contains the group's name.
266    For example:
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282 Perreault                    Standards Track                    [Page 5]
283 \f
284 RFC 6351                          xCard                      August 2011
285
286
287      <vcards>
288        <vcard>
289          <group name="contact">
290            <fn>...</fn>
291            <email>...</email>
292          </group>
293          <group name="media">
294            <photo>...</photo>
295          </group>
296          <categories>...</categories>
297        </vcard>
298      </vcards>
299
300    is equivalent to:
301
302      BEGIN:VCARD
303      VERSION:4.0
304      contact.FN=...
305      contact.EMAIL=...
306      media.PHOTO=...
307      CATEGORIES=...
308      END:VCARD
309
310 5.1.  Extensibility
311
312    The original vCard format is extensible.  New properties, parameters,
313    data types and values (collectively known as vCard elements, not to
314    be confused with XML elements) can be registered with IANA (see
315    [RFC6350], Section 10.2).  It is expected that these vCard extensions
316    will also specify extensions to the XML format described in this
317    document.
318
319    New XML vCard property and parameter element names MUST be lower-
320    case.  This is necessary to ensure that round-tripping between XML
321    and plain-text vCard works correctly.
322
323    Unregistered extensions (i.e., those starting with "X-" and
324    "VND-...-") are expressed in XML by using elements starting with "x-"
325    and "vnd-...-".  Usage of XML namespaces [W3C.REC-xml-names-20091208]
326    for extensibility is RECOMMENDED for extensions that have no
327    equivalent in plain-text vCard.  Refer to Section 6 for the
328    implications when converting between plain-text vCard and XML.
329
330
331
332
333
334
335
336
337
338 Perreault                    Standards Track                    [Page 6]
339 \f
340 RFC 6351                          xCard                      August 2011
341
342
343    Examples:
344
345      <x-my-prop>
346        <parameters>
347          <pref><integer>1</integer></pref>
348        </parameters>
349        <text>value goes here</text>
350      </x-my-prop>
351
352      <ext:my-prop
353          ext:xmlns="http://example.com/extensions/my-vcard">
354        <parameters>
355          <pref><integer>1</integer></pref>
356        </parameters>                 <!-- Core vCard elements  -->
357        <text>value goes here</text>  <!-- are still accessible -->
358      </ext:my-prop>
359
360    Note that extension elements do not need the "X-" or "VND-" prefix in
361    XML.  The XML namespace mechanism is sufficient.
362
363    A vCard XML parser MUST ignore XML elements and attributes for which
364    it doesn't recognize the expanded name.  The normal behavior of
365    ignoring XML processing instructions whose target is not recognized
366    MUST also be followed.
367
368    In the original vCard format, the "VERSION" property was mandatory
369    and played a role in extensibility.  In XML, this property is absent.
370    Its role is played by the vCard core namespace identifier, which
371    includes the version number. vCard revisions will use a different
372    namespace.
373
374    Parameters containing a list of values are expressed using a list of
375    elements in XML (e.g., the <type> element).
376
377 5.2.  Limitations
378
379    The schema does not validate the cardinality of properties.  This is
380    a limitation of the schema definition language.  Cardinalities of the
381    original vCard format [RFC6350] MUST still be respected.
382
383    Some constructs (e.g., value enumerations in type parameters) have
384    additional ordering constraints in XML.  This is a result of
385    limitations of the schema definition language, and the order is
386    arbitrary.  The order MUST be respected in XML for the vCard to be
387    valid.  However, reordering as part of conversion to or from plain
388    vCard MAY happen.
389
390
391
392
393
394 Perreault                    Standards Track                    [Page 7]
395 \f
396 RFC 6351                          xCard                      August 2011
397
398
399 6.  Format Conversions
400
401    When new properties or "X-" properties are used, a vCard<->xCard
402    converter might not recognize them or know what the appropriate
403    default value types are, yet they need to be able to preserve the
404    values.  A similar issue arises for unrecognized property parameters.
405    As a result, the following rules are applied when dealing with
406    unrecognized properties and property parameters:
407
408    o  When converting from vCard to xCard:
409
410       *  Any property that does not include a "VALUE" parameter and
411          whose default value type is not known MUST be converted using
412          the value type XML element <unknown>.  The content of that
413          element is the unprocessed value text.
414
415       *  Any unrecognized property parameter MUST be converted using the
416          value type XML element <unknown>, with its content set to the
417          parameter value text, treated as if it were a text value, or
418          list of text values.
419
420       *  The content of "XML" properties is copied as is to XML.
421
422       *  Property and parameter XML element names are converted to
423          lower-case.
424
425       *  Property value escaping is undone.  For example, "\n" becomes a
426          NEWLINE character (ASCII decimal 10).
427
428       *  Double-quoting of parameter values, as well as backslash
429          escaping in parameter values, is undone.  For example,
430          PARAM="\"foo\",\"bar\"" becomes <param>"foo","bar"</param>.
431
432    o  When converting xCard to vCard:
433
434       *  Properties in the vCard 4 namespace:
435
436          +  If the converter knows of a specific plain-text
437             representation for this property, it uses it.  For example,
438             the <adr> element corresponds to the "ADR" property, which
439             is encoded using comma-separated lists separated by
440             semicolons.
441
442          +  Otherwise, the property name is taken from the element name,
443             property parameters are taken from the <parameters> element,
444             and the content of the property is taken from the content of
445             the value element.  If the property element has attributes
446             or contains other XML elements, they are dropped.
447
448
449
450 Perreault                    Standards Track                    [Page 8]
451 \f
452 RFC 6351                          xCard                      August 2011
453
454
455          +  If a standard property's XML element contains XML elements
456             and attributes for which the converter doesn't recognize the
457             expanded name, they are dropped.  Therefore, it is
458             RECOMMENDED to limit extensions to the property level to
459             ensure that all data is preserved intact in round-trip
460             conversions.
461
462       *  Properties in other namespaces are wrapped as is inside an
463          "XML" property.
464
465       *  Any <unknown> property value XML elements are converted
466          directly into vCard values.  The containing property MUST NOT
467          have a "VALUE" parameter.
468
469       *  Any <unknown> parameter value XML elements are converted as if
470          they were <text> value type XML elements.
471
472       *  Property and parameter names are converted to upper-case.
473
474       *  Property value escaping (Section 3.3 of [RFC6350]) is carried
475          out.  For example, a NEWLINE character (ASCII decimal 10)
476          becomes "\n".
477
478       *  Double-quoting of parameter values, as well as backslash
479          escaping in parameter values, is carried out.  For example,
480          <param>"foo","bar"</param> becomes PARAM="\"foo\",\"bar\"".
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506 Perreault                    Standards Track                    [Page 9]
507 \f
508 RFC 6351                          xCard                      August 2011
509
510
511    For example, these two vCards are equivalent:
512
513      <?xml version="1.0"?>
514      <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
515        <vcard>
516          <fn><text>J. Doe</text></fn>
517          <n>
518            <surname>Doe</surname>
519            <given>J.</given>
520            <additional/>
521            <prefix/>
522            <suffix/>
523          </n>
524          <x-file>
525            <parameters>
526              <mediatype><text>image/jpeg</text></mediatype>
527            </parameters>
528            <unknown>alien.jpg</unknown>
529          </x-file>
530          <a xmlns="http://www.w3.org/1999/xhtml"
531             href="http://www.example.com">My web page!</a>
532        </vcard>
533      </vcards>
534
535
536      BEGIN:VCARD
537      VERSION:4.0
538      FN:J. Doe
539      N:Doe;J.;;
540      X-FILE;MEDIATYPE=image/jpeg:alien.jpg
541      XML:<a xmlns="http://www.w3.org/1999/xhtml"\n
542          href="http://www.example.com">My web page!</a>
543      END:VCARD
544
545 7.  Security Considerations
546
547    All the security considerations applicable to plain vCard [RFC6350]
548    are applicable to this document as well.
549
550    XML Signature [W3C.CR-xmldsig-core1-20110303] and XML Encryption
551    [W3C.CR-xmlenc-core1-20110303] can be used with xCard to provide
552    authentication and confidentiality.
553
554
555
556
557
558
559
560
561
562 Perreault                    Standards Track                   [Page 10]
563 \f
564 RFC 6351                          xCard                      August 2011
565
566
567 8.  IANA Considerations
568
569 8.1.  Registration of the XML Namespace
570
571    URI:  urn:ietf:params:xml:ns:vcard-4.0
572
573    Registrant Contact:  The IESG <iesg@ietf.org>
574
575    XML:  None.  Namespace URIs do not represent an XML specification.
576
577 8.2.  Media Type
578
579    This section defines the MIME media type [RFC4288] for use with
580    vCard-in-XML data.
581
582    To:  ietf-types@iana.org
583
584    Subject:  Registration of media type application/vcard+xml
585
586    Type name:  application
587
588    Subtype name:  vcard+xml
589
590    Required parameters:  none
591
592    Optional parameters:  charset as defined for application/xml in
593       [RFC3023]; per [RFC3023], use of the charset parameter with the
594       value "utf-8" is "STRONGLY RECOMMENDED".
595
596    Encoding considerations:  Same as encoding considerations of
597       application/xml as specified in [RFC3023].
598
599    Security considerations:  This media type has all of the security
600       considerations described in [RFC3023], plus those listed in
601       Section 7.
602
603    Interoperability considerations:  This media type provides an
604       alternative syntax to vCard data [RFC6350] based on XML.
605
606    Published specification:  This specification.
607
608    Applications that use this media type:  Applications that currently
609       make use of the text/vcard media type can use this as an
610       alternative.  In general, applications that maintain or process
611       contact information can use this media type.
612
613
614
615
616
617
618 Perreault                    Standards Track                   [Page 11]
619 \f
620 RFC 6351                          xCard                      August 2011
621
622
623    Additional information:
624
625       Magic number(s):  none
626
627       File extension(s):  XML data should use ".xml" as the file
628          extension.
629
630       Macintosh file type code(s):  none
631
632    Person & email address to contact for further information:  Simon
633       Perreault <simon.perreault@viagenie.ca>
634
635    Intended usage:  COMMON
636
637    Restrictions on usage:  none
638
639    Author:  Simon Perreault
640
641    Change controller:  IETF
642
643 9.  Acknowledgments
644
645    Thanks to the following people for their input:
646
647    Alexey Melnikov, Barry Leiba, Bjorn Hoehrmann, Cyrus Daboo, Joe
648    Hildebrand, Joseph Smarr, Marc Blanchet, Mike Douglass, Peter Saint-
649    Andre, Robins George, Zahhar Kirillov, Zoltan Ordogh.
650
651
652 10.  References
653
654 10.1.  Normative References
655
656    [ISO.19757-2.2008]
657               International Organization for Standardization,
658               "Information technology -- Document Schema Definition
659               Language (DSDL) -- Part 2: Regular-grammar-based
660               validation -- RELAX NG", ISO International
661               Standard 19757-2, October 2008.
662
663    [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
664               Requirement Levels", BCP 14, RFC 2119, March 1997.
665
666    [RFC3023]  Murata, M., St. Laurent, S., and D. Kohn, "XML Media
667               Types", RFC 3023, January 2001.
668
669    [RFC6350]  Perreault, S., "vCard Format Specification", RFC 6350,
670               August 2011.
671
672
673
674 Perreault                    Standards Track                   [Page 12]
675 \f
676 RFC 6351                          xCard                      August 2011
677
678
679    [W3C.REC-xml-20081126]
680               Paoli, J., Yergeau, F., Maler, E., Bray, T., and C.
681               Sperberg-McQueen, "Extensible Markup Language (XML) 1.0
682               (Fifth Edition)", World Wide Web Consortium
683               Recommendation REC-xml-20081126, November 2008,
684               <http://www.w3.org/TR/2008/REC-xml-20081126>.
685
686    [W3C.REC-xml-names-20091208]
687               Bray, T., Hollander, D., Layman, A., Tobin, R., and H.
688               Thompson, "Namespaces in XML 1.0 (Third Edition)", World
689               Wide Web Consortium Recommendation REC-xml-names-20091208,
690               December 2009,
691               <http://www.w3.org/TR/2009/REC-xml-names-20091208>.
692
693 10.2.  Informative References
694
695    [RFC4288]  Freed, N. and J. Klensin, "Media Type Specifications and
696               Registration Procedures", BCP 13, RFC 4288, December 2005.
697
698    [VCARD-DTD]
699               Dawson, F., "The vCard v3.0 XML DTD", Work in Progress,
700               June 1998.
701
702    [W3C.CR-xmldsig-core1-20110303]
703               Roessler, T., Solo, D., Yiu, K., Reagle, J., Hirsch, F.,
704               Eastlake, D., and M. Nystroem, "XML Signature Syntax and
705               Processing Version 1.1", World Wide Web Consortium CR CR-
706               xmldsig-core1-20110303, March 2011,
707               <http://www.w3.org/TR/2011/CR-xmldsig-core1-20110303>.
708
709    [W3C.CR-xmlenc-core1-20110303]
710               Eastlake, D., Reagle, J., Roessler, T., and F. Hirsch,
711               "XML Encryption Syntax and Processing Version 1.1", World
712               Wide Web Consortium CR CR-xmlenc-core1-20110303,
713               March 2011,
714               <http://www.w3.org/TR/2011/CR-xmlenc-core1-20110303>.
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730 Perreault                    Standards Track                   [Page 13]
731 \f
732 RFC 6351                          xCard                      August 2011
733
734
735 Appendix A.  Relax NG Schema
736
737 default namespace = "urn:ietf:params:xml:ns:vcard-4.0"
738
739 ### Section 3.3: vCard Format Specification
740 #
741 # 3.3
742 iana-token = xsd:string { pattern = "[a-zA-Z0-9-]+" }
743 x-name = xsd:string { pattern = "x-[a-zA-Z0-9-]+" }
744
745 ### Section 4: Value types
746 #
747 # 4.1
748 value-text = element text { text }
749 value-text-list = value-text+
750
751 # 4.2
752 value-uri = element uri { xsd:anyURI }
753
754 # 4.3.1
755 value-date = element date {
756     xsd:string { pattern = "\d{8}|\d{4}-\d\d|--\d\d(\d\d)?|---\d\d" }
757   }
758
759 # 4.3.2
760 value-time = element time {
761     xsd:string { pattern = "(\d\d(\d\d(\d\d)?)?|-\d\d(\d\d?)|--\d\d)"
762                          ~ "(Z|[+\-]\d\d(\d\d)?)?" }
763   }
764
765 # 4.3.3
766 value-date-time = element date-time {
767     xsd:string { pattern = "(\d{8}|--\d{4}|---\d\d)T\d\d(\d\d(\d\d)?)?"
768                          ~ "(Z|[+\-]\d\d(\d\d)?)?" }
769   }
770
771 # 4.3.4
772 value-date-and-or-time = value-date | value-date-time | value-time
773
774 # 4.3.5
775 value-timestamp = element timestamp {
776     xsd:string { pattern = "\d{8}T\d{6}(Z|[+\-]\d\d(\d\d)?)?" }
777   }
778
779 # 4.4
780 value-boolean = element boolean { xsd:boolean }
781
782
783
784
785
786 Perreault                    Standards Track                   [Page 14]
787 \f
788 RFC 6351                          xCard                      August 2011
789
790
791 # 4.5
792 value-integer = element integer { xsd:integer }
793
794 # 4.6
795 value-float = element float { xsd:float }
796
797 # 4.7
798 value-utc-offset = element utc-offset {
799     xsd:string { pattern = "[+\-]\d\d(\d\d)?" }
800   }
801
802 # 4.8
803 value-language-tag = element language-tag {
804     xsd:string { pattern = "([a-z]{2,3}((-[a-z]{3}){0,3})?|[a-z]{4,8})"
805                          ~ "(-[a-z]{4})?(-([a-z]{2}|\d{3}))?"
806                          ~ "(-([0-9a-z]{5,8}|\d[0-9a-z]{3}))*"
807                          ~ "(-[0-9a-wyz](-[0-9a-z]{2,8})+)*"
808                          ~ "(-x(-[0-9a-z]{1,8})+)?|x(-[0-9a-z]{1,8})+|"
809                          ~ "[a-z]{1,3}(-[0-9a-z]{2,8}){1,2}" }
810   }
811
812 ### Section 5: Parameters
813 #
814 # 5.1
815 param-language = element language { value-language-tag }?
816
817 # 5.2
818 param-pref = element pref {
819     element integer {
820       xsd:integer { minInclusive = "1" maxInclusive = "100" }
821     }
822   }?
823
824 # 5.4
825 param-altid = element altid { value-text }?
826
827 # 5.5
828 param-pid = element pid {
829     element text { xsd:string { pattern = "\d+(\.\d+)?" } }+
830   }?
831
832 # 5.6
833 param-type = element type { element text { "work" | "home" }+ }?
834
835 # 5.7
836 param-mediatype = element mediatype { value-text }?
837
838
839
840
841
842 Perreault                    Standards Track                   [Page 15]
843 \f
844 RFC 6351                          xCard                      August 2011
845
846
847 # 5.8
848 param-calscale = element calscale { element text { "gregorian" } }?
849
850 # 5.9
851 param-sort-as = element sort-as { value-text+ }?
852
853 # 5.10
854 param-geo = element geo { value-uri }?
855
856 # 5.11
857 param-tz = element tz { value-text | value-uri }?
858
859 ### Section 6: Properties
860 #
861 # 6.1.3
862 property-source = element source {
863     element parameters { param-altid, param-pid, param-pref,
864                          param-mediatype },
865     value-uri
866   }
867
868 # 6.1.4
869 property-kind = element kind {
870     element text { "individual" | "group" | "org" | "location" |
871                    x-name | iana-token }*
872   }
873
874 # 6.2.1
875 property-fn = element fn {
876     element parameters { param-language, param-altid, param-pid,
877                          param-pref, param-type }?,
878     value-text
879   }
880
881 # 6.2.2
882 property-n = element n {
883     element parameters { param-language, param-sort-as, param-altid }?,
884     element surname { text }+,
885     element given { text }+,
886     element additional { text }+,
887     element prefix { text }+,
888     element suffix { text }+
889   }
890
891
892
893
894
895
896
897
898 Perreault                    Standards Track                   [Page 16]
899 \f
900 RFC 6351                          xCard                      August 2011
901
902
903 # 6.2.3
904 property-nickname = element nickname {
905     element parameters { param-language, param-altid, param-pid,
906                          param-pref, param-type }?,
907     value-text-list
908   }
909
910 # 6.2.4
911 property-photo = element photo {
912     element parameters { param-altid, param-pid, param-pref, param-type,
913                          param-mediatype }?,
914     value-uri
915   }
916
917 # 6.2.5
918 property-bday = element bday {
919     element parameters { param-altid, param-calscale }?,
920     (value-date-and-or-time | value-text)
921   }
922
923 # 6.2.6
924 property-anniversary = element anniversary {
925     element parameters { param-altid, param-calscale }?,
926     (value-date-and-or-time | value-text)
927   }
928
929 # 6.2.7
930 property-gender = element gender {
931     element sex { "" | "M" | "F" | "O" | "N" | "U" },
932     element identity { text }?
933   }
934
935 # 6.3.1
936 param-label = element label { value-text }?
937 property-adr = element adr {
938     element parameters { param-language, param-altid, param-pid,
939                          param-pref, param-type, param-geo, param-tz,
940                          param-label }?,
941     element pobox { text }+,
942     element ext { text }+,
943     element street { text }+,
944     element locality { text }+,
945     element region { text }+,
946     element code { text }+,
947     element country { text }+
948   }
949
950
951
952
953
954 Perreault                    Standards Track                   [Page 17]
955 \f
956 RFC 6351                          xCard                      August 2011
957
958
959 # 6.4.1
960 property-tel = element tel {
961     element parameters {
962       param-altid,
963       param-pid,
964       param-pref,
965       element type {
966         element text { "work" | "home" | "text" | "voice"
967                      | "fax" | "cell" | "video" | "pager"
968                      | "textphone" }+
969       }?,
970       param-mediatype
971     }?,
972     (value-text | value-uri)
973   }
974
975 # 6.4.2
976 property-email = element email {
977     element parameters { param-altid, param-pid, param-pref,
978                          param-type }?,
979     value-text
980   }
981
982 # 6.4.3
983 property-impp = element impp {
984     element parameters { param-altid, param-pid, param-pref,
985                          param-type, param-mediatype }?,
986     value-uri
987   }
988
989 # 6.4.4
990 property-lang = element lang {
991     element parameters { param-altid, param-pid, param-pref,
992                          param-type }?,
993     value-language-tag
994   }
995
996 # 6.5.1
997 property-tz = element tz {
998     element parameters { param-altid, param-pid, param-pref,
999                          param-type, param-mediatype }?,
1000     (value-text | value-uri | value-utc-offset)
1001   }
1002
1003
1004
1005
1006
1007
1008
1009
1010 Perreault                    Standards Track                   [Page 18]
1011 \f
1012 RFC 6351                          xCard                      August 2011
1013
1014
1015 # 6.5.2
1016 property-geo = element geo {
1017     element parameters { param-altid, param-pid, param-pref,
1018                          param-type, param-mediatype }?,
1019     value-uri
1020   }
1021
1022 # 6.6.1
1023 property-title = element title {
1024     element parameters { param-language, param-altid, param-pid,
1025                          param-pref, param-type }?,
1026     value-text
1027   }
1028
1029 # 6.6.2
1030 property-role = element role {
1031     element parameters { param-language, param-altid, param-pid,
1032                          param-pref, param-type }?,
1033     value-text
1034   }
1035
1036 # 6.6.3
1037 property-logo = element logo {
1038     element parameters { param-language, param-altid, param-pid,
1039                          param-pref, param-type, param-mediatype }?,
1040     value-uri
1041   }
1042
1043 # 6.6.4
1044 property-org = element org {
1045     element parameters { param-language, param-altid, param-pid,
1046                          param-pref, param-type, param-sort-as }?,
1047     value-text-list
1048   }
1049
1050 # 6.6.5
1051 property-member = element member {
1052     element parameters { param-altid, param-pid, param-pref,
1053                          param-mediatype }?,
1054     value-uri
1055   }
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066 Perreault                    Standards Track                   [Page 19]
1067 \f
1068 RFC 6351                          xCard                      August 2011
1069
1070
1071 # 6.6.6
1072 property-related = element related {
1073     element parameters {
1074       param-altid,
1075       param-pid,
1076       param-pref,
1077       element type {
1078         element text {
1079           "work" | "home" | "contact" | "acquaintance" |
1080           "friend" | "met" | "co-worker" | "colleague" | "co-resident" |
1081           "neighbor" | "child" | "parent" | "sibling" | "spouse" |
1082           "kin" | "muse" | "crush" | "date" | "sweetheart" | "me" |
1083           "agent" | "emergency"
1084         }+
1085       }?,
1086       param-mediatype
1087     }?,
1088     (value-uri | value-text)
1089   }
1090
1091 # 6.7.1
1092 property-categories = element categories {
1093     element parameters { param-altid, param-pid, param-pref,
1094                          param-type }?,
1095     value-text-list
1096   }
1097
1098 # 6.7.2
1099 property-note = element note {
1100     element parameters { param-language, param-altid, param-pid,
1101                          param-pref, param-type }?,
1102     value-text
1103   }
1104
1105 # 6.7.3
1106 property-prodid = element prodid { value-text }
1107
1108 # 6.7.4
1109 property-rev = element rev { value-timestamp }
1110
1111 # 6.7.5
1112 property-sound = element sound {
1113     element parameters { param-language, param-altid, param-pid,
1114                          param-pref, param-type, param-mediatype }?,
1115     value-uri
1116   }
1117
1118
1119
1120
1121
1122 Perreault                    Standards Track                   [Page 20]
1123 \f
1124 RFC 6351                          xCard                      August 2011
1125
1126
1127 # 6.7.6
1128 property-uid = element uid { value-uri }
1129
1130 # 6.7.7
1131 property-clientpidmap = element clientpidmap {
1132     element sourceid { xsd:positiveInteger },
1133     value-uri
1134   }
1135
1136 # 6.7.8
1137 property-url = element url {
1138     element parameters { param-altid, param-pid, param-pref,
1139                          param-type, param-mediatype }?,
1140     value-uri
1141   }
1142
1143 # 6.8.1
1144 property-key = element key {
1145     element parameters { param-altid, param-pid, param-pref,
1146                          param-type, param-mediatype }?,
1147     (value-uri | value-text)
1148   }
1149
1150 # 6.9.1
1151 property-fburl = element fburl {
1152     element parameters { param-altid, param-pid, param-pref,
1153                          param-type, param-mediatype }?,
1154     value-uri
1155   }
1156
1157 # 6.9.2
1158 property-caladruri = element caladruri {
1159     element parameters { param-altid, param-pid, param-pref,
1160                          param-type, param-mediatype }?,
1161     value-uri
1162   }
1163
1164 # 6.9.3
1165 property-caluri = element caluri {
1166     element parameters { param-altid, param-pid, param-pref,
1167                          param-type, param-mediatype }?,
1168     value-uri
1169   }
1170
1171
1172
1173
1174
1175
1176
1177
1178 Perreault                    Standards Track                   [Page 21]
1179 \f
1180 RFC 6351                          xCard                      August 2011
1181
1182
1183 # Top-level grammar
1184 property = property-adr | property-anniversary | property-bday
1185          | property-caladruri | property-caluri | property-categories
1186          | property-clientpidmap | property-email | property-fburl
1187          | property-fn | property-geo | property-impp | property-key
1188          | property-kind | property-lang | property-logo
1189          | property-member | property-n | property-nickname
1190          | property-note | property-org | property-photo
1191          | property-prodid | property-related | property-rev
1192          | property-role | property-gender | property-sound
1193          | property-source | property-tel | property-title
1194          | property-tz | property-uid | property-url
1195 start = element vcards {
1196     element vcard {
1197       (property
1198        | element group {
1199            attribute name { text },
1200            property*
1201          })+
1202     }+
1203   }
1204
1205 Author's Address
1206
1207    Simon Perreault
1208    Viagenie
1209    2600 boul. Laurier, Suite 625
1210    Quebec, QC  G1V 4W1
1211    Canada
1212
1213    Phone: +1 418 656 9254
1214    EMail: simon.perreault@viagenie.ca
1215    URI:   http://www.viagenie.ca
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234 Perreault                    Standards Track                   [Page 22]
1235 \f