Subject: Re: [VCARDDAV] Comments on vCard XML Schema

From: Simon Perreault <[email-masked]>
Date: Fri, 05 Mar 2010 15:39:48 -0500

On 2009-11-29 21:38, Renato Iannella wrote:
> - A this is a RelaxNG Schema, the title should be renamed to reduce
> confusion with any "XML Schema" representation

How about "vCard XML Representation"?

> - is there an XML Scheme version planned?

No. It is easy to convert from Relax NG to XML Schema using Trang 
<http://www.thaiopensource.com/relaxng/trang.html>.

> - why is the "type" of the element content contained in the content
> model. eg <text>...</text>
> (this seems to make it more verbose)

Because

- We need a tag anyway because we have parameters. We can't just do this:

<email>
<parameters><type>work</type></parameters>
[email-masked]
</email>

- A tag per value type is easier to manipulate/validate/parse than a 
generic <value> tag whose content depends on the enclosing tag.

> - was the <type> element considered as an attribute of the parent
> element? (less verbosity)

Yes, but the type parameter takes a list of values. We could do:

<tel type="work,cell">...

But it's harder to grep/manipulate/parse/validate than separate elements.

Note that in the next revision we will have this instead:

<tel><parameters><type>work</type><type>cell</type></parameters>...

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

---

From: Renato Iannella <[email-masked]>
Date: Tue, 9 Mar 2010 16:16:00 +1000

> But it's harder to grep/manipulate/parse/validate than separate elements.

Well... is it? There is great debate on Elements V Attributes from a design/performance point-of-view [1]

I like [2] as it gives good reasons why Attributes make more sense in this case, and pointing out that "Sensible schema languages, meaning RELAX NG, treat elements and attributes symmetrically".

Cheers...  Renato Iannella
NICTA

[1] http://www.google.com.au/search?&q=xml+elements+versus+attributes
[2] http://recycledknowledge.blogspot.com/2008/03/elements-or-attributes.html

---

From: Julian Reschke <[email-masked]>
Date: Tue, 09 Mar 2010 09:19:58 +0100

On 09.03.2010 07:16, Renato Iannella wrote:
> ...

A *single* attribute is harder to process than a *set* of elements, 
because you get the additional complication of the micro-syntax (commas, 
whitespace etc) to process.

That being said, if the microsyntax is sufficiently clear (whitespace 
treatment, single delimiter, escaping of the delimiter character?!), 
then it's not *that* problematic.

Best regards, Julian