Re: [Simple-support] Dynamic element name
Brought to you by:
niallg
|
From: Nugroho S. <nug...@gm...> - 2011-06-26 10:29:22
|
Hi Niall,
Thank you. it works.
Regards,
Nugroho
On Sat, Jun 18, 2011 at 12:59 PM, Niall Gallagher <gal...@ya...
> wrote:
> To add a child element in the OutputNode use getChild(String), this should
> work for you. Also, check out the test cases. There are loads of examples.
>
> --- On *Mon, 13/6/11, Nugroho Saputro <nug...@gm...>* wrote:
>
>
> From: Nugroho Saputro <nug...@gm...>
> Subject: [Simple-support] Dynamic element name
> To: sim...@li...
> Received: Monday, 13 June, 2011, 9:58 PM
>
>
> Hi,
>
> Simple XML is a great framework, it support most of our requirements but I
> have a question regarding dynamic element name.
> I have some am working with XML that has dynamic element name. Please see
> the sample below, in this case custom fields are dynamic:
>
> <person>
> <name>Nugroho</name>
> .....
> <custom_fields>
> <birthdate>1976-12-26</birthdate>
> <opted-out>true</opted-out>
> </custom_fields>
> </person>
>
> It is possible to map custom fields in the above XML to a Map with element
> name as map key ?
>
> so the java class will be
>
> class Person {
> String name;
> Map<String, String> customFields;
> }
>
> I have tried creating Converted for it. I can convert
> from <custom_fields> InputNode to a Map but I am unable to convert Map to
> OutputNode in write() method, because there are no method I can use to add a
> child element in OutputNode.
>
> Thank you.
>
> Regards,
> Nugroho
>
>
> -----Inline Attachment Follows-----
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...<http://mc/compose?to=...@li...>
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
>
|