OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   [newbie] Mapping a Map 101?

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: [newbie] Mapping a Map 101?
  • From: PA <petite.abeille@gmail.com>
  • Date: Fri, 10 Dec 2004 23:04:03 +0100
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:return-path:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=D8hZCXAL/PkWx+8E/emFJK36G4sOyWoeCDGPVcgQnOJODP5FQPOxkDT3OHkjGbwdS2mLLfCfSXlRSggmRGFMyz7mL+uu9PZktH61zUZs4YiZYhdSnM/wL+IOuB+RezcHku9m+7TEusXOGofWfhRxcSBbKdv4hCdFhLSxRkCs43s=

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.





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS