[mmox] Example of what could be a real XML LLSD

Catherine Pfeffer <cathypfeffer@gmail.com> Wed, 25 February 2009 01:24 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 B1AF33A6816 for <mmox@core3.amsl.com>; Tue, 24 Feb 2009 17:24:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.293
X-Spam-Level:
X-Spam-Status: No, score=-2.293 tagged_above=-999 required=5 tests=[AWL=0.305, 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 iQkedKHeDaq5 for <mmox@core3.amsl.com>; Tue, 24 Feb 2009 17:24:23 -0800 (PST)
Received: from mail-ew0-f164.google.com (mail-ew0-f164.google.com [209.85.219.164]) by core3.amsl.com (Postfix) with ESMTP id E79A13A680A for <mmox@ietf.org>; Tue, 24 Feb 2009 17:24:22 -0800 (PST)
Received: by ewy8 with SMTP id 8so493191ewy.13 for <mmox@ietf.org>; Tue, 24 Feb 2009 17:24:40 -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=IZuxA7RcjOK7rgIJwQpggI5Y/OPuCrgkvISAJF9U8uA=; b=nCG4NfyGQeZd+WgyXO9+lJraxXMez8z7PhUva2J2j44syxignYSUZOpwzzbkL6xPAY qmiEtDdYYGI9vxW+kuq0NKnT16yO6FupkeH7sY+KxuWuUuaURDJZuylWm/Ip/ga3c0gD YvXO9Co4AnM5bTqlLtK6XKXLIoBBkL41QDiXk=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=vWbhUngs0+zvePRSyVKDtzg78fTwIH3MYNL1mZT8xb6jKFStUJOvtqxVTZimklt7PT AusbvroPrGPzAI2M4yCx5UwOP8GehZbQyRRw4gszQpXuUpRkGMByirauSzf3pMRGUnpT FjD2i9OotgSRd+Ji0Z9EscLXDuPePwMQ/WN/c=
MIME-Version: 1.0
Received: by 10.210.135.17 with SMTP id i17mr90661ebd.47.1235525080784; Tue, 24 Feb 2009 17:24:40 -0800 (PST)
Date: Wed, 25 Feb 2009 02:24:40 +0100
Message-ID: <ebe4d1860902241724s537a2d4dv1fd5014b50b6e085@mail.gmail.com>
From: Catherine Pfeffer <cathypfeffer@gmail.com>
To: mmox@ietf.org
Content-Type: multipart/alternative; boundary="0015174c11628d20d50463b4195e"
Subject: [mmox] Example of what could be a real XML LLSD
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: Wed, 25 Feb 2009 01:24:24 -0000

Hello,

Here is a real LLSD packet. Below I'll show how it could look like if we
would abandon the 1:1 mapping to binary serialization.

If transposing 1:1 the binary encoding, the packet is 2688 bytes long. If
doing it in a more xml-ish way, the packet is 1065 bytes long. That's 40 %
of the length the current LLSD proposal generates. It's also more legible by
humans, easier to validate and easier to parse. Those figures include 2
spaces of indentation at each tag level, and all the newline characters.

First the "transposition of binary serialization" way:

<llsd>
  <map>
    <key>AgentData</key>
    <map>
      <key>AgentId</key>
      <uuid>81466fc7-276f-455d-9b72-8316e9712535</uuid>
      <key>GroupId</key>
      <uuid/>
      <key>SessionId</key>
      <uuid>4bbb6fa9-e649-4507-a709-8831c237c4ee</uuid>
    </map>
    <key>ObjectData</key>
    <map>
      <key>BypassRaycast</key>
      <boolean>1</boolean>
      <key>EveryoneMask</key>
      <binary encoding="base64">AAAAAA==</binary>
      <key>Flags</key>
      <binary encoding="base64">AAAAAg==</binary>
      <key>GroupMask</key>
      <binary encoding="base64">AAAAAA==</binary>
      <key>Material</key>
      <integer>3</integer>
      <key>NextOwnerMask</key>
      <binary encoding="base64">AAjAAA==</binary>
      <key>PCode</key>
      <integer>9</integer>
      <key>Path</key>
      <map>
        <key>Begin</key>
        <integer>0</integer>
        <key>Curve</key>
        <integer>16</integer>
        <key>End</key>
        <integer>0</integer>
        <key>RadiusOffset</key>
        <integer>0</integer>
        <key>Revolutions</key>
        <integer>0</integer>
        <key>ScaleX</key>
        <integer>100</integer>
        <key>ScaleY</key>
        <integer>100</integer>
        <key>ShearX</key>
        <integer>0</integer>
        <key>ShearY</key>
        <integer>0</integer>
        <key>Skew</key>
        <integer>0</integer>
        <key>TaperX</key>
        <integer>0</integer>
        <key>TaperY</key>
        <integer>0</integer>
        <key>Twist</key>
        <integer>0</integer>
        <key>TwistBegin</key>
        <integer>0</integer>
      </map>
      <key>Profile</key>
      <map>
        <key>Begin</key>
        <integer>0</integer>
        <key>Curve</key>
        <integer>1</integer>
        <key>End</key>
        <integer>0</integer>
        <key>Hollow</key>
        <integer>0</integer>
      </map>
      <key>RayEnd</key>
      <array>
        <real>42.9329986572265625</real>
        <real>29.6600322723388671875</real>
        <real>31.399318695068359375</real>
      </array>
      <key>RayEndIsIntersection</key>
      <boolean>0</boolean>
      <key>RayStart</key>
      <array>
        <real>48.281482696533203125</real>
        <real>32.063152313232421875</real>
        <real>34.092010498046875</real>
      </array>
      <key>RayTargetId</key>
      <uuid/>
      <key>Rotation</key>
      <array>
        <real>0</real>
        <real>0</real>
        <real>0</real>
        <real>1</real>
      </array>
      <key>Scale</key>
      <array>
        <real>0.5</real>
        <real>0.5</real>
        <real>0.5</real>
      </array>
      <key>State</key>
      <integer>0</integer>
    </map>
  </map>
</llsd>

Now the "XML" way:

<llsd>
  <AgentData
      AgentId="81466fc7-276f-455d-9b72-8316e9712535"
      GroupId=""
      SessionId="4bbb6fa9-e649-4507-a709-8831c237c4ee" />
    <ObjectData
        BypassRaycast="1"
        EveryoneMask="0x00000000"
        Flags="0x00000002"
        GroupMask="0x00000000"
        Material="3"
        NextOwnerMask="0x0008C000"
        PCode="9">
      <Path
          Begin="0"
          Curve="16"
          End="0"
          RadiusOffset="0"
          Revolutions="0"
          ScaleX="100"
          ScaleY="100"
          ShearX="0"
          ShearY="0"
          Skew="0"
          TaperX="0"
          TaperY="0"
          Twist="0"
          TwistBegin="0" />
        <Profile
           Begin="0"
           Curve="1"
            End="0"
            Hollow="0" />
      <RayEnd
            x="42.9329986572265625"
            y="29.6600322723388671875"
            z="31.399318695068359375"
            IsIntersection="0" />
      <RayStart
            x="48.281482696533203125"
            y="32.063152313232421875"
            z="34.092010498046875" />
      <RayTargetId uuid="" />
      <Rotation x="0" y="0" z="0" s="1" />
      <Scale x="0.5" y="0.5" z="0.5" />
      <State bool="0" />
    </ObjectData>
</llsd>

Even better results could be achieved by using default values for some
attributes.

-- 
Cathy