[mmox] Better XML maps

Catherine Pfeffer <cathypfeffer@gmail.com> Thu, 26 February 2009 10:57 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 A70BD28C1F8 for <mmox@core3.amsl.com>; Thu, 26 Feb 2009 02:57:05 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.314
X-Spam-Level:
X-Spam-Status: No, score=-1.314 tagged_above=-999 required=5 tests=[AWL=-0.882, 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 aBL5z5ZQN7jn for <mmox@core3.amsl.com>; Thu, 26 Feb 2009 02:57:05 -0800 (PST)
Received: from mail-bw0-f178.google.com (mail-bw0-f178.google.com [209.85.218.178]) by core3.amsl.com (Postfix) with ESMTP id 7CD5F28C187 for <mmox@ietf.org>; Thu, 26 Feb 2009 02:57:04 -0800 (PST)
Received: by bwz26 with SMTP id 26so435869bwz.37 for <mmox@ietf.org>; Thu, 26 Feb 2009 02:57:24 -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=IS8wWaXShOPlJRrH3fusPCyX433zemmeNZFRQit6AwM=; b=vlj3QExAfskxaVwverbbMMj7enBG/RQgLQpVZk6X1/uDZlRy70gFqv4wo8YGF0c4g/ 2GTCJoK5mACW6xs/yVa+yt5w/qc3w3kcBKYumJGSl6Veb8LDUmlW2JpuDRiI4F7xy/t/ TJteNIZwPNAQImIwzJ9NcD799drR8FLq/v9ag=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=kBQ/AFIUPlE7E8VO9Lf/VRFc5fpHmZFsbfjn9Now986V+gNAxrCZUebieIkzTnUaBF 1IkjYdVFVrQ/D8Glv8aRQcp/u1zo6VykoLy7GSjW9NbAtJlRQrmZHtd24rItJhWpHqJ8 5KWXckwJsHLGbCDoRLZP/5b9OhU7I8Rwb5wSo=
MIME-Version: 1.0
Received: by 10.181.216.12 with SMTP id t12mr411602bkq.122.1235645844726; Thu, 26 Feb 2009 02:57:24 -0800 (PST)
Date: Thu, 26 Feb 2009 11:57:24 +0100
Message-ID: <ebe4d1860902260257q140bd08eqc1012018316c46dd@mail.gmail.com>
From: Catherine Pfeffer <cathypfeffer@gmail.com>
To: mmox@ietf.org
Content-Type: multipart/alternative; boundary="001636c59860a4a3630463d03798"
Subject: [mmox] Better XML maps
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: Thu, 26 Feb 2009 10:57:05 -0000

Hi Meadhbh,


 I know this contradicts what I just said on the list, but I am trying to be
very honest intellectually, so here is a technical trick to make XML maps a
less "terrible serialization":


Replace

 <map>

...

<key>Taper_X</key>

<float>0.5</float>

...

</map>

with

 <map>

...

<entry key="Taper_X">

<float>0.5</float>

</entry>

...

</map>


That's 20 characters versus 11, but so much more DOM and XPath friendly.


Corresponding XPath expression is

map/entry[@key = 'Taper_X']/float


 You can go down to 12 bytes if you use <e> instead of <entry>.


(but believe me, drop XML and JSON serializations... simple is beautiful)

-- 
Cathy