Re: [Simple-support] ElementMap with unknown child elements
Brought to you by:
niallg
|
From: Max S. <ma...@se...> - 2013-03-12 18:46:06
|
Hi Alex,
I'm not quite sure if I understood your problem: You need the element
<Child1>Value1</Child1> to be inserted into the HashMap with "Child1" as
key and "Value1" as value?
Best regards
Max
schrieb Alex Boyd:
> Hey All,
> Given the XML :
> <Parent>
>
> <Child1>Value1</Child1>
>
> <Child2>Value2</Child2>
>
> <Child3>Value3</Child3>
>
> </Parent>
> How would I serialize / deserialize so that I have a Java Object like below. I don't know the name of the child elements, I just want to get key-value pairs from the children, with key being the element name, and value being the text element inside the xml.
> class Parent
> {
>
> public HashMap<String,String> children;
>
> }
> I have tried multiple different combinations of ElementMap and ElementList but couldn't seem to get it to work the way I wanted.
> Thanks in advance,
> Alex Boyd
>
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
>
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
|