Subject: [mmox] explanations

From: Catherine Pfeffer <[email-masked]>
Date: Tue, 24 Feb 2009 20:25:09 +0100

Infinity wrote:
> i'm also a bit confused... what's the difference between
>
> <value type="integer" size="128">99992123123123</value>
>
> and
>
> <integer size="128"> 99992123123123</integer>
>
> ???

Let's restart from the beginning. We were speaking about maps. Taking
current LLSD proposal, an example of map would be:

<map>
     <key>something-big</key>
     <integer>99992123123123</integer>
     <key>something-smaller</key>
     <integer>42</integer>
</map>

This kind of constructs is unusual in the XML world, because it highly
depends on the order: key, integer, key, integer. To find the integer
associated with a key, you need to move in the following-siblings axis in
XPath terminology. I suggested the following construct to avoid this
problem:

<map>
     <entry>
       <key>something-big</key>
       <integer>99992123123123</integer>
     </entry>
     <entry>
       <key>something-smaller</key>
       <integer>42</integer>
     </entry>
</map>

but that's even more bloated. So Jon came with something equivalent to:

<map>
     <entry key="something-big" type="integer">99992123123123</entry>
     <entry key"something-smaller">42</entry>
</map>

which is smaller. Now this construct, valid for map entries, could be
generalized for <value>s outside of the maps:
     <value key="something-big" type="integer">99992123123123</value>

Whether this is a good idea or not can be discussed and that was the object
of my previous mail.

-- 
Cathy