Re: [VCARDDAV] How to encode X-Properties in XML?

Peter Saint-Andre <stpeter@stpeter.im> Tue, 09 March 2010 21:06 UTC

Return-Path: <stpeter@stpeter.im>
X-Original-To: vcarddav@core3.amsl.com
Delivered-To: vcarddav@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 1140A3A6A22 for <vcarddav@core3.amsl.com>; Tue, 9 Mar 2010 13:06:02 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.566
X-Spam-Level:
X-Spam-Status: No, score=-2.566 tagged_above=-999 required=5 tests=[AWL=0.033, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5prqKuKw9Bqm for <vcarddav@core3.amsl.com>; Tue, 9 Mar 2010 13:06:01 -0800 (PST)
Received: from stpeter.im (stpeter.im [207.210.219.233]) by core3.amsl.com (Postfix) with ESMTP id 117423A69A6 for <vcarddav@ietf.org>; Tue, 9 Mar 2010 13:05:58 -0800 (PST)
Received: from dhcp-64-101-72-245.cisco.com (dhcp-64-101-72-245.cisco.com [64.101.72.245]) (Authenticated sender: stpeter) by stpeter.im (Postfix) with ESMTPSA id 6DE3440E14 for <vcarddav@ietf.org>; Tue, 9 Mar 2010 14:06:02 -0700 (MST)
Message-ID: <4B96B839.5030609@stpeter.im>
Date: Tue, 09 Mar 2010 14:06:01 -0700
From: Peter Saint-Andre <stpeter@stpeter.im>
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: vcarddav@ietf.org
References: <4B951355.40508@viagenie.ca> <1B68D1C8710BC35F8DB33BE8@caldav.corp.apple.com>
In-Reply-To: <1B68D1C8710BC35F8DB33BE8@caldav.corp.apple.com>
X-Enigmail-Version: 1.0.1
OpenPGP: url=http://www.saint-andre.com/me/stpeter.asc
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha1"; boundary="------------ms000502080908000606020008"
Subject: Re: [VCARDDAV] How to encode X-Properties in XML?
X-BeenThere: vcarddav@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: IETF vcarddav wg mailing list <vcarddav.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/vcarddav>, <mailto:vcarddav-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/vcarddav>
List-Post: <mailto:vcarddav@ietf.org>
List-Help: <mailto:vcarddav-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/vcarddav>, <mailto:vcarddav-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 09 Mar 2010 21:06:02 -0000

On 3/9/10 8:39 AM, Cyrus Daboo wrote:
> Hi Simon,
> 
> --On March 8, 2010 10:10:13 AM -0500 Simon Perreault
> <simon.perreault@viagenie.ca> wrote:
> 
>> The main open issue we have for vCard XML is that of encoding
>> X-Properties in XML. vCard uses X- for unregistered extensions, while
>> vCard XML uses XML namespaces. It's not clear how to automatically
>> convert from one to another.
>>
>> A proposal: Create an XML namespace for X- properties. Put the content
>> into a <text> element.
>>
>> Example:
>>
>> X-FOO:bar
>>
>> would translate into:
>>
>> <foo
>> xmlns="urn:ietf:params:xml:ns:vcard-4.0:xname"><text>bar</text></foo>
>>
>> We don't need to add anything to the schema since we already specify that
>> an XML vCard parser MUST ignore elements in namespaces it doesn't
>> recognize. (Maybe we can add text to force it for this namespace.)
> 
> The choice we made for icalendar-in-xml was to simply allow the X-
> properties to appear as <x-...> elements in the default "icalendar"
> namespace. 

IIRC we had some discussion about this around the time of the Stockholm
meeting, starting here:

http://www.ietf.org/mail-archive/web/vcarddav/current/msg01126.html

Joe Hildebrand suggested:

X-FOO:test
VND-BAR:hi

Turning into:

<x name='FOO'><text>test</text></x>
<vnd name='BAR'><text>hi</text></vnd>

Simon said we could instead make use of XML namespaces.

<foo xmlns="urn:ietf:params:xml:ns:vcard-4.0:x"><text>test</text></x>
<bar xmlns="urn:ietf:params:xml:ns:vcard-4.0:vnd:bar"><text>hi</text></bar>

Joe replied that "pulling random elements into your own namespace is
somewhat odd from an XML standpoint."

I tend to agree. If we're going to be pulling in random elements, I'd
rather do so in a namespace other than the core one (let's have a
namespace that we know is going to be polluted from the start so that we
contain the ugliness).

> It did not seem worthwhile to have a special namespace for
> those as in reality they are processed in exactly the same way as
> regular properties. The key thing is that these elements/properties
> cannot be ignored. They are there for a purpose (be it only
> "experimental").

There might be value in doing the same thing as icalendar. Is it really
true that X- and VND data cannot be ignored? Or do we say that a
vCard-xml processor MUST support the urn:ietf:params:xml:ns:vcard-4.0:x
and urn:ietf:params:xml:ns:vcard-4.0:vnd namespaces (but perhaps MAY
treat data qualified by those namespaces differently somehow)?

Peter

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