Re: [mmox] XML serialization

Jon Watte <jwatte@gmail.com> Mon, 23 February 2009 23:02 UTC

Return-Path: <jwatte@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 8B81128C243 for <mmox@core3.amsl.com>; Mon, 23 Feb 2009 15:02:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.537
X-Spam-Level:
X-Spam-Status: No, score=-2.537 tagged_above=-999 required=5 tests=[AWL=0.062, 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 4rJlgDVVIskH for <mmox@core3.amsl.com>; Mon, 23 Feb 2009 15:02:55 -0800 (PST)
Received: from mail-gx0-f174.google.com (mail-gx0-f174.google.com [209.85.217.174]) by core3.amsl.com (Postfix) with ESMTP id 774D528C242 for <mmox@ietf.org>; Mon, 23 Feb 2009 15:02:55 -0800 (PST)
Received: by gxk22 with SMTP id 22so5908840gxk.13 for <mmox@ietf.org>; Mon, 23 Feb 2009 15:03:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=kMkMRwV5A5J/28Y/rkxiE2i0WhjhYCXEB+11hBp7Jpc=; b=gG1AsGYhgVTca0HQ8uUxmiA4WiGTrMPiUTpWtUWfETHk5nIQaOHQZaEqyTqFJ3skP+ c1ZgkM6EOJ8CF/wG8MMP0DH/Vf6IWd6GO9TUWhP5Vw9YBzT/3SrSbMhs2G+Dy36wqwTI LaVntAk581JvAwUVojDzC/XFIjIJNYunJAFbw=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=EMXW1M/bYjQEdLQEBw4gyrPp2fPj4EhQPFZo5CCSOslwneq5mgHAhIJ/Kj/pPtrCvy rbfmFWrtiTPH7SNVfMNxXog6VUGfopq06FbAzvl6LBGlzmb/iFaVgeg2r1ASfZ68p41Y +w5pzozWv4hVSJQ4XiPN9qufXcpoA9pWs2Ihs=
Received: by 10.100.138.10 with SMTP id l10mr4903973and.25.1235430192792; Mon, 23 Feb 2009 15:03:12 -0800 (PST)
Received: from ?192.168.168.111? (smtp.forterrainc.com [208.64.184.34]) by mx.google.com with ESMTPS id c9sm5798357ana.13.2009.02.23.15.03.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Feb 2009 15:03:12 -0800 (PST)
Message-ID: <49A32B2E.5030606@gmail.com>
Date: Mon, 23 Feb 2009 15:03:10 -0800
From: Jon Watte <jwatte@gmail.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
To: Mark Lentczner <markl@lindenlab.com>
References: <ebe4d1860902230239q207d4c0ar5b0582ad7ca855bf@mail.gmail.com> <49A30D7A.3040003@gmail.com> <777F85B9-1676-491D-91C8-0E772253619D@lindenlab.com>
In-Reply-To: <777F85B9-1676-491D-91C8-0E772253619D@lindenlab.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: mmox@ietf.org
Subject: Re: [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: Mon, 23 Feb 2009 23:02:56 -0000

Mark Lentczner wrote:
> Jon Watte wrote:
>> <map>
>> <value type="boolean" key="success>true</value>
>> <value type="string" 
>> key="something_i_like_to_eat_on_sundays">bananas</value>
>> </map>
>
> This format is notably more difficult for schemas (from XMLSchema to 
> RelaxNG) to support, since value now has a key attribute that is only 
> valid iff it is tested in a map element.  Second, you have left out 
> the top element, which needs to be something fixed, rather than being 
> map or array or value depending on the structure of the data.
>

Yes, my illustration was only an illustration of how to turn a tag-fest 
into something more useful.

> Including a type attribute also makes things difficult for schemas, as 
> the content of the value element now depends on the value of one of 
> it's attributes.
>

I don't think you can verify the content of any element absent the 
actual executable code endpoint. Trying to do that in schema is pretty 
useless IMO. For example, if we have a "float64_3" type for global 
position, then perhaps a schema validator could verify that the content 
of that element would be three float64 values separated by commas 
(assuming that's the defined serialization), but there would be no way 
for the schema to validate that that position was actually semantically 
valid within the target context, because that's a simulation property.

> Including the key value as an attribute value will make this somewhat 
> harder to edit in some systems where "human readable" text is 
> generally much easier to handle as element content.  Keeping the key 
> value as element content also keeps the processing with key values 
> consistent with the processing of string values with respect to string 
> handling including normalization.
>

My experience is the opposite. Hence, my proposed change :-)

Also, my suggested serialization is invariant to child node re-ordering. 
Most of the time, that's not important, but for some cases, where a tree 
might be put into a hash map for fast access, it matters. 
Not-order-specific XML is generally faster to parse and more robust, 
when you can actually assume it's non-order-specific.

I'd be comfortable with backing off to say that the element tag name is 
the data type, while key is still an attribute, but from my experience, 
putting the type as an attribute as well actually works out better in 
practice.

Sincerely,

jw