[mmox] XML serialization

Catherine Pfeffer <cathypfeffer@gmail.com> Mon, 23 February 2009 10:38 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 3602C3A698F for <mmox@core3.amsl.com>; Mon, 23 Feb 2009 02:38:52 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, 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 71JwYvzgu23Z for <mmox@core3.amsl.com>; Mon, 23 Feb 2009 02:38:51 -0800 (PST)
Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by core3.amsl.com (Postfix) with ESMTP id F09D13A6874 for <mmox@ietf.org>; Mon, 23 Feb 2009 02:38:50 -0800 (PST)
Received: by nf-out-0910.google.com with SMTP id d3so364851nfc.39 for <mmox@ietf.org>; Mon, 23 Feb 2009 02:39:07 -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=uDdbC7qboZ5XCGfN+OPlyi0nbNazWv4NgfOUpBJIY30=; b=cFhBu3BSF1V/usi8kAOdLpaOpDtGwtNE9C89CDD+zUvgJ0yw4wyhGAOY7ho4tiCHoa PCO8wYQYduunsbHoxY3pdQ3Wk2JeUytp0n6eWthxU4DHFno6tEjj1KSUVd2Es/8Od6Rk 6949pIxOByxhPsoQv1riE82j+Y9LPi3KY1X+0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LOE2GCxFaDv1v+iVgVTQg8Z/B3pNF3cF6N+3cCVrmzTSVrI0qkQObyte/+icIrNYD4 KEdJ+BAzaZTLChzDv271FkwY7G7HDQkPRcSvs6l3mdUehmLWU8lqnZQenIa7AfoxMhq5 q3NLsPzs2DEIIzv+EpUrlKYYEPGusjvGAr+q8=
MIME-Version: 1.0
Received: by 10.210.134.5 with SMTP id h5mr288673ebd.146.1235385547796; Mon, 23 Feb 2009 02:39:07 -0800 (PST)
Date: Mon, 23 Feb 2009 11:39:07 +0100
Message-ID: <ebe4d1860902230239q207d4c0ar5b0582ad7ca855bf@mail.gmail.com>
From: Catherine Pfeffer <cathypfeffer@gmail.com>
To: mmox@ietf.org
Content-Type: multipart/alternative; boundary="0015174c12e2bcb2110463939c45"
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: Mon, 23 Feb 2009 10:38:52 -0000

Jon Watte wrote:
> > Meadhbh Hamrick (Infinity) wrote:
> > <llsd>
> >   <map>
> >     <key>success</key>
> >     <boolean>true</boolean>
> >     <key>something_i_like_to_eat_on_sundays</key>
> >     <string>bananas</string>
> >   </map>
> > </llsd>
>
> IMO, that's a terrible serialization, because it depends on ordering.
> While XML is ordered, this particular serialization makes it hard to
> write XPath that selects "the string that comes after key success but
> before key something_i_like_to_eat_on_sundays".

Yes, I have already made this very same remark to Infinity in private.

The "classical way" to solve this is to add new wrapper tags:

<llsd>
   <map>
      <entry>
        <key>success</key>
        <boolean>true</boolean>
      </entry>
      <entry>
        <key>something_i_like_to_eat_on_sundays</key>
        <string>bananas</string>
       </entry>
   </map>
</llsd>

but that would make the "angle bracket tax" even more expensive to pay...

It's not *that* complicated in XPath (following-sibling axis is made for
that). But it's just... well... unusual practice in the XML world.

I have the strong feeling that depending on the order is calling for
trouble, although I have not found yet examples where it would lead to real
problems, other than ugly XPath constructions or unusual DTD fragments.

-- 
Cathy