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

Peter Saint-Andre <stpeter@stpeter.im> Tue, 30 March 2010 21:12 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 5AA8C3A6987 for <vcarddav@core3.amsl.com>; Tue, 30 Mar 2010 14:12:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.237
X-Spam-Level:
X-Spam-Status: No, score=-1.237 tagged_above=-999 required=5 tests=[AWL=0.232, BAYES_00=-2.599, DNS_FROM_OPENWHOIS=1.13]
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 jgk673u+zmwh for <vcarddav@core3.amsl.com>; Tue, 30 Mar 2010 14:12:33 -0700 (PDT)
Received: from stpeter.im (stpeter.im [207.210.219.233]) by core3.amsl.com (Postfix) with ESMTP id 86F463A6B1F for <vcarddav@ietf.org>; Tue, 30 Mar 2010 14:12:19 -0700 (PDT)
Received: from dhcp-64-101-72-158.cisco.com (dhcp-64-101-72-158.cisco.com [64.101.72.158]) (Authenticated sender: stpeter) by stpeter.im (Postfix) with ESMTPSA id 1988440D3A for <vcarddav@ietf.org>; Tue, 30 Mar 2010 15:12:48 -0600 (MDT)
Message-ID: <4BB2694F.7060108@stpeter.im>
Date: Tue, 30 Mar 2010 15:12:47 -0600
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: <C7D75D68.20C07%joe.hildebrand@webex.com>
In-Reply-To: <C7D75D68.20C07%joe.hildebrand@webex.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="------------ms090709060209010108010808"
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, 30 Mar 2010 21:12:34 -0000

On 3/30/10 8:48 AM, Joe Hildebrand wrote:
> On 3/30/10 6:55 AM, "Simon Perreault" <simon.perreault@viagenie.ca> wrote:
> 
>>> - In the text format, XML: properties always get directly transliterated
>>> into XML as children of<vcard>.  This means they MUST have a namespace
>>> other than the default.  If they don't, we can specify what happens, but the
>>> list of things I've thought of are: 1) error, and fail translation 2) warn,
>>> and don't copy the XML: property 3) warn, and change the namespace to some
>>> specified warning namespace 4) do 3 silently 5) copy the element as-is.
>>>
>>> I don't like 5, because the element won't round-trip back to text format the
>>> same way.  3 or 4 sound fine to me, but I could live with 2 or even 1.
>>
>> I'd rather follow Postel's principle.
>>
>> - On output, the element in XML: MUST have a namespace, and it MUST NOT
>> be the vCard 4 namespace.
> 
> Yes.
> 
>> - On input, the content of the XML: property MUST be interpreted as a
>> single XML element.

Qualified by what namespace? My sense of the discussion so far is that
the single XML element contained in the "XML:" property MUST have some
namespace.

> Some text like this would probably be worth mentioning to those that hadn't
> thought of the round-tripping problem:
> 
> "Note that if the element is in the vCard 4 namespace (either by having no
> namespace declaration, or by having the vCard 4 namespace explicitly
> redefined), and the element is inserted into an XML format document, it will
> not be possible to regenerate the exact form of the text document from the
> XML document."
> 
>>> - Text format properties that are not currently in the XML definition (such
>>> as X-, VND-, and new-but-iana-registered) are unlikely to ever have any
>>> interesting structure in XML.  The best we can do is specify syntactic
>>> transformations that survive round trips.  As a consequence, we might
>>> consider suggesting that ALL new properties SHOULD be defined in XML format
>>> going forward, with XML: being their native representation in the text
>>> format.
>>
>> +0.5
>>
>> The problem is that these new properties would be in the vCard 4
>> namespace, and we said that no element in this namespace can appear as
>> the content of the XML property.
> 
> No.  I'm suggesting that we put these extensions in a new namespace,

"DAV:" perhaps? ;-)

> preferably a new namespace per spec that adds 1+ properties.

Why are we defining this bucket in the first place? It seems to me that
we want to be encouraging people to use the extensibility they have with
XML, not redefine the "urn:ietf:params:xml:ns:vcard-4.0" namespace by
creating new elements in that namespace outside the schema we've defined.

>>> - Do we specify what happens to \n in text format, when translated?  Does it
>>> stay \n, or get translated to CRLF?  What about wrapped lines?  Do they get
>>> unwrapped?  My preference would be unwrap and translate to \n to CRLF.
>>
>> We have this currently:
>>
>>                                                                The chunk
>>        is subject to normal line folding and escaping, i.e. replace all
>>        backslashes with "\\", then replace all newlines with "\n", then
>>        fold long lines.
>>
>> Can you suggest text to be added?
> 
> Ah, that's in the base spec, and I was looking for it in the XML spec.  The
> XML spec has:
> 
>    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.
> 
> Which is a little unclear with respect to \\, although it can be intuited.
> 
> I guess I'm hoping we're going to end up with sections in the XML spec that
> talk about how to convert to and from the XML format (with examples).  That
> would be an appropriate place to move the text above.  The example should
> have one of each of the known edge cases.

+1 to more examples.

Peter

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