Re: [Simple-support] Parsing dynamic elements into a map
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-11-23 07:41:27
|
You would need to write a Converter for this, there is no what to do this via the @ElementMap annotation. Try the @Convert annotation. ________________________________ From: Michael Daly <Mic...@Si...> To: "sim...@li..." <sim...@li...> Sent: Tuesday, 22 November 2011 9:28 PM Subject: [Simple-support] Parsing dynamic elements into a map We have some XML being returned as key-value pairs such that the element name is the key (and the inner text is the value). The keys (elements) are completely configurable, so the element (user, userName, address1, some_configurable_field) can be any text that a user defines. <patron> <user>31</user> <userName>IPA</userName> <address1> 1234 Lake Drive </address> <some_configurable_field> Configurable data </some_configurable_field> </patron> Is there a way to parse these values into a Map, such that: HashMap map = new HashMap(); key => value "user" => 31 "userName" => IPA "address1" => 1234 Lake Drive "some_configurable_field" => Configurable data for any dynamic element => value pair? Thanks any for any insight. Mike ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |