Subject: [VCARDDAV] Embedding XML in vCard

From: Simon Perreault <[email-masked]>
Date: Tue, 20 Oct 2009 13:17:55 -0400

Dear WG,

Here's a first proposal for embedding XML in vCard, as discussed at IETF 75 in
Stockholm.

First, I propose that this be part of draft-ietf-vcarddav-vcardxml, not of
draft-ietf-vcarddav-vcardrev. This is to eliminate mutual referencing, and also
to eliminate the question of "how do I interpret an XML blob if all I'm
compliant with is plain vCard?" Only XML-aware clients which also happen to
understand plain vCard would know what to do with an XML blob. Which I think
makes sense.

The proposal is for a new property named "XML". Example:

BEGIN:VCARD
VERSION:4.0
FN:Simon Perreault
XML:<email>[email-masked]</email>
END:VCARD

That's it.

Details:

- Multiple XML-encoded properties could be present in a single "XML" property,
e.g. XML:<prop1>...</prop1><prop2>...</prop2>

- Multiple instances of an "XML" property could be present in a single vCard.
This is so that the order of properties does not change during conversion. Yes I
know order doesn't matter, but I think it would be nice to have the following
property hold:

strcmp( vcard(xml("BEGIN:VCARD...END:VCARD")), "BEGIN:VCARD...END:VCARD" ) == 0

- The content of the "XML" property would be an XML chunk with default XML
namespace being the vCard 4 namespace. The elements allowed there would be those
that are allowed to be immediate children of the <vcard> element. The normal
rule for extensibility would apply (i.e. things in unknown namespaces are
ignored). The chunk would be subject to normal line folding and escaping, i.e:
  1. Replace all newlines with "\n".
     (All the rest of the full UTF-8 gamut is untouched.)
  2. Fold long lines.
     (Do it after "\n" for bonus points.)

- The following would be implicitly valid:

BEGIN:VCARD
XML:<!-- All the content is here. -->
END:VCARD

How about that?

Simon
-- 
DNS64 open-source   --> http://ecdysis.viagenie.ca
STUN/TURN server    --> http://numb.viagenie.ca
vCard 4.0           --> http://www.vcarddav.org

---

From: Marc Blanchet <[email-masked]>
Date: Tue, 20 Oct 2009 15:24:19 -0400

Simon Perreault a écrit :
> compliant with is plain vCard?" 

as individual, I agree with the proposal.

as co-chair, I highly suggest that "draft-ietf-vcarddav-vcardrev" 
contains text regarding the XML property and refers to the 
draft-ietf-vcarddav-vcardxml for the details/definition. That way, XML 
is a known property in standard vcard. This will bind the two at RFC 
publication so that they will be referencing each other with their RFC 
numbers, but definitions will not be duplicated.

Marc.

Only XML-aware clients which also happen to

---

From: Peter Saint-Andre <[email-masked]>
Date: Tue, 20 Oct 2009 14:22:34 -0600

On 10/20/09 11:17 AM, Simon Perreault wrote:

> that are allowed to be immediate children of the <vcard> element.

Why not specify that the element allowed in the "XML" property is
<vcard> (which naturally can contain any of its defined children)?

I'm hoping we can avoid things like this:

BEGIN:VCARD
VERSION:4.0
XML:<fn><text>Simon Perreault</text></fn>
XML:<n>
       <surname><text>Perreault</text></surname>
       <given><text>Simon</text></given>
       <prefix><text/></prefix>
       <suffix>
         <text>ing. jr.</text>
         <text>M.Sc.</text>
       </suffix>
     </n>
XML:<bday><date>--0203</date></bday>
XML:<anniversary><date-time>20090808T1430-0500</date-time></anniversary>
XML:<sex>1</sex>
XML:<lang><pref>1</pref><language-tag>fr</language-tag></lang>
.
.
.
END:VCARD

Peter

- --
Peter Saint-Andre
https://stpeter.im/

---

From: Peter Saint-Andre <[email-masked]>
Date: Tue, 20 Oct 2009 14:24:10 -0600

> numbers, but definitions will not be duplicated.

I like that approach.

Peter

- --
Peter Saint-Andre
https://stpeter.im/

---

From: Simon Perreault <[email-masked]>
Date: Tue, 20 Oct 2009 16:39:27 -0400

> <vcard> (which naturally can contain any of its defined children)?

Two reasons come to mind:

- A <vcard> element semantically contains a complete vCard. What the XML
property contains is a partial vCard.

- Why add it when it doesn't fix the following?

> XML:<lang><pref>1</pref><language-tag>fr</language-tag></lang>

Worse:

BEGIN:VCARD
VERSION:4.0
XML:<vcard><fn><text>Simon Perreault</text></fn></vcard>
XML:<vcard><n>
       <surname><text>Perreault</text></surname>
       <given><text>Simon</text></given>
       <prefix><text/></prefix>
       <suffix>
         <text>ing. jr.</text>
         <text>M.Sc.</text>
       </suffix>
     </n></vcard>
XML:<vcard><bday><date>--0203</date></bday></vcard>
XML:<vcard><anniversary><date-time>20090808T1430-0500</date-time></anniversary></vcard>
XML:<vcard><sex>1</sex></vcard>
XML:<vcard><lang><pref>1</pref><language-tag>fr</language-tag></lang></vcard>
.
.
.
END:VCARD

Simon

---

From: Peter Saint-Andre <[email-masked]>
Date: Tue, 20 Oct 2009 15:02:29 -0600

> property contains is a partial vCard.

I'm wondering why the XML property contains a partial vCard. :)

> - Why add it when it doesn't fix the following?

<snip type='evil'/>

I see your point. However, my feeling is that the proper relationship
between a vCard and the XML property is similar to the relationship
between the TXT and HTML encodings of an email message. Perhaps that
feeling is misplaced.

Peter

- --
Peter Saint-Andre
https://stpeter.im/

---

From: Simon Perreault <[email-masked]>
Date: Wed, 21 Oct 2009 10:44:52 -0400

> Here's a first proposal for embedding XML in vCard, as discussed at IETF 75 in

I just realized that I had forgotten about Joe Hildebrand's proposal, which I
even replied to at the time! Sorry about that.

The differences are:

- Base64 encoding vs. plain text with escaping for backslashes and newlines. I
would prefer plain text whenever possible. In this case it's clearly possible.

- The use of an container <extensions> element vs. no container element. I still
don't fully understand the need for a container element.

- The use of a media type that is set to "text/xml" vs. implicit XML. I would
prefer implicit XML to keep it simple. If it turns out that it's such a good
idea that it needs extending to other media types, we'll do something about it
then. But I seriously doubt it. After all, the goal is to migrate to XML, not to
keep adding stuff to the old vCard format.

- A property cardinality of (0,1) vs. (0,n). I don't have a strong opinion on this.

Simon