← Prev in month ← Prev in thread

[newbie] Mapping a Map 101?

From
PA <>
To
Date
2004-12-10T22:04:03Z
ID
<>
Thread
[newbie] Mapping a Map 101?
Hello,

Not quiet sure if this is the right forum for such a basic question,  
but here you go...

I would like to map a, er, map (as in java.util.Map) into a XML  
element... but I'm not quiet sure how "verbose" I should be...

For example:

<map>
     <entry>
	    <key>
		    <string>aKey</string>
	    </key>
	    <value>
		    <integer>101</integer>
	    </value>
     </entry>
</map>

The above pretty much "spell out" everything: a map is composed of  
entries containing key value pairs.

This is pretty much how XML-RPC defines a structure:

http://www.xmlrpc.com/spec

Alternatively, XStream encodes a Map pretty much like the above, but  
drops the inner <key/> and <value/> while still specifying an <entry/>  
tag:

http://xstream.codehaus.org/converters.html

Finally, Apple uses only one <key/> element in their property lists:

http://developer.apple.com/documentation/Cocoa/Conceptual/ 
PropertyLists/index.html

In theory a map element could get going by simply defining it as a  
succession of values:

<map>
     <string>aKey</string>
     <integer>101</integer>
</map>

Is there a more or less "agreed upon" scheme to define a map type  
structure in XML?

Thoughts? Alternatives?

TIA.

PA.
← Prev in month ← Prev in thread