Re: [Simple-support] How to create inner children without creating inner class?
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-01-18 07:53:38
|
Hi,
Can you send me an example of the XML you want to generate?
Niall
--- On Mon, 17/1/11, Cristian <cri...@el...> wrote:
From: Cristian <cri...@el...>
Subject: Re: [Simple-support] How to create inner children without creating inner class?
To: sim...@li...
Received: Monday, 17 January, 2011, 10:07 AM
All right... I see that I can accomplish that by using Paths. This way:
@org.simpleframework.xml.Root
class Root {
@Element
@Path("children")
private final String innerChildren;
public Root(String name){
innerChildren = name;
}
}
The problem is that now I want to give a namespace to the path... but I have found no way to do so. If I do @Path("myns:children") I get <mynschildren> instead of <myns:children>.
Thanks for you help.
2011/1/17 Cristian <cri...@el...>
I need to generate an XML like this:
<Root>
<Children>
<InnerChildren>SomethingM</InnerChildren>
</Children>
</Root>
The simplest solution is creating an inner class on the Root class:
@Root
class Root{
@Element
Children element;
@Root
private static class Children{
@Element
String innerChildren;
}
}
But I want to avoid that inner class creation, since it will make things look strange while using Root objects. Is there anyway I can achieve that result without using inner classes?
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|