[mmox] XML serialization

Catherine Pfeffer <cathypfeffer@gmail.com> Tue, 24 February 2009 13:50 UTC

Return-Path: <cathypfeffer@gmail.com>
X-Original-To: mmox@core3.amsl.com
Delivered-To: mmox@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 83BC33A6950 for <mmox@core3.amsl.com>; Tue, 24 Feb 2009 05:50:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.515
X-Spam-Level:
X-Spam-Status: No, score=-1.515 tagged_above=-999 required=5 tests=[AWL=-1.083, BAYES_00=-2.599, FF_IHOPE_YOU_SINK=2.166, HTML_MESSAGE=0.001]
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 draDgN9Mt4l4 for <mmox@core3.amsl.com>; Tue, 24 Feb 2009 05:50:48 -0800 (PST)
Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by core3.amsl.com (Postfix) with ESMTP id C43563A68B2 for <mmox@ietf.org>; Tue, 24 Feb 2009 05:50:47 -0800 (PST)
Received: by ug-out-1314.google.com with SMTP id j40so245462ugd.15 for <mmox@ietf.org>; Tue, 24 Feb 2009 05:51:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=GIV60L51GpIy8GeEodITOlKQcNk1D6tv/RfMWu3ix2Y=; b=uHA/ie30l27x+dpoR8BQP8B/obQuZQMZHI757cS9mDMThWdNuhTlvQVuazoKO4+BtK uDR+W0HICC4k4OlB9Rg70Kx0gqjiI+7LsMnwpqyY2hx0yye+nr/coo33RsdMvppaN33u NQtwLBhOjCVsN1uGmKxuVsBUA/h8nPgTFaiVU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=NiqHjslaDjrqeMiJxjKmxLRdQCxdU0zdDncLj+NqYDBfEN06coJKE3U/8RGNkEcf+0 s28N1SUdmUmVTHNT024yGPaNkJ/A30V+RCuNndiZjoMAnjlnLEKWPa0g4aux6M31cIfe rm6TJAuaiz+IPYkE4YJgI9NisrGCW8z4+PXzY=
MIME-Version: 1.0
Received: by 10.210.35.10 with SMTP id i10mr4393868ebi.151.1235483465728; Tue, 24 Feb 2009 05:51:05 -0800 (PST)
Date: Tue, 24 Feb 2009 14:51:05 +0100
Message-ID: <ebe4d1860902240551l2ab28b43o6d391fb1d455cacf@mail.gmail.com>
From: Catherine Pfeffer <cathypfeffer@gmail.com>
To: mmox@ietf.org
Content-Type: multipart/alternative; boundary="0015174c37b419c4da0463aa69c7"
Subject: [mmox] XML serialization
X-BeenThere: mmox@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Massively Multi-participant Online Games and Applications <mmox.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/mmox>, <mailto:mmox-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/mmox>
List-Post: <mailto:mmox@ietf.org>
List-Help: <mailto:mmox-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mmox>, <mailto:mmox-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Feb 2009 13:50:49 -0000

(Infinity: there is a question for you at the end of this message)

Jon said:
> A better way is
>
> <map>
>    <value type="boolean" key="success">true</value>
>    <value type="string"
>         key="something_i_like_to_eat_on_sundays">bananas</value>
> </map>
>
> natural way to express it.This has less of the angle bracket tax, and it
> has a VERY straight-forward parsing style. In fact, in my opinion it's
> the most In XPath, it's now trivial: "value[@key=success]"

Yes. I had thought at this solution too, but I had hesitated to propose it
straight away to the mailing list...

This solution has fewer angle bracket tax, but it also has hidden
implications. I assumed (perharps wrongly) that the authors of the XML
serialization had seen these implications, and rejected this solution
because of these implications.

Moving tags (<key>, <boolean>, <string> and so on) to attribute names or
values is not an innocent operation. Here are the consequences I can see:


1) To allow validation of the allowed types, the new "type" attribute would
need to be declared as an enumeration in the DTD or schema.

No big deal so far.


2) More of a problem: if using XML schema for validation, it is more
straightforward to check that
      <float>3.14</float>
and
      <integer>42</integer>
are correct, than to check that
      <value type="float">3.14</value>
      <value type="integer">42</value>
are correct.

(XML schema allows for checking that the data inside the tags conform to a
certain syntax, for example that floats are made of digts and possibly of a
decimal dot and a minus sign).


3) The key ("success" or "something_i_like_to_eat_on_sundays") is not part
of the data flow anymore, but part of the markup.

There are half-religious wars inside the XML world according to what should
be an attribute and what should be text ;-). Personally, in this case, I
would say that an attribute is more suited to this kind of data, because
then we could enumerate all the allowed values for the virtual world context
("name", "taper_x", "socks", "notecard_encoding", whatever is normalized on
top of VWSD), so I see this as an advantage of your solution.

On the other hand, if I understand well, LLSD has been defined to allow keys
to evolve rapidely and to be supported differently across various
implementations, so validating the key values is perharps a bad idea.


4) Other advantages of your solution, Jon: default values for attributes
could be omitted, and we could address size and signed-ness of the scalars
in separate attributes.

Examples:
         <value>42</value>
would be synonymous of
         <value type="integer" size="32" signed="yes">42</value>

         <value type="float" size="64">3.14159265353238</value>
would be synonymous of
         <value type="float" size="64" signed="yes">3.14159265353238</value>

Of course, there is a lot to spare on the angle bracket tax here, since most
data is probably integer, 32 bits,, and signed).

It is also more future-proof, since 'size="128"' could be added afterward
easily, even if not planned initially.


> I'm working on a list of the things I think are wrong with the current
> proposal, of which this is one thing (there are about six). If we're
> open to change on those things (including this), then I could get behind
> the LLSD. Stay tuned :-)

I have a similar list too ;-). Someone here has proposed a VWSD working
group to separate high level concerns (like meshes versus prims) from low
level concerns (like data types and serializations). If we are sure that
xxSD is the way to go (and not ASN or whatever), I would volunteer to be
part of such a group, and so would you, Jon, I guess ;-).

Infinity, how was the XML serialization thought? Have several alternatives
been compared and considered carefully? Or is it just the result of the
inspiration of the person who made it at a given time?

-- 
Cathy