[Simple-support] Dupliate attributes, but different xpaths
Brought to you by:
niallg
|
From: Rosczak, J. <Jan...@hl...> - 2011-08-05 06:04:18
|
Hello,
I would like to map the following XML
<application name='SpecialApplication'>
<system value='SPECIAL_SYSTEM' />
<tranCode value='X3320' />
</application>
to the Java class
@Root(name = "application")
public class Application {
@Attribute()
@Path("/")
private String name;
@Path("system")
@Attribute(name = "value")
private String system;
@Path("tranCode")
@Attribute(name = "value")
private String transactionCode;
But, that does not work.
First of all is the root path in the @Path annotation not supported, maybe there is another way to reference the root element?
Then the framework complaints about the duplicate attribute "value" although I would think that the attributes reference different elements as denoted by the @Path annotation.
Can this XML be mapped at all?
Thanks and kind regards
Jan Rosczak
IT Architect
Development Methods, Frameworks & Tools
__________________________________
Hapag-Lloyd AG
Ballindamm 25
D-20095 Hamburg
Phone +49 (40) 3001- 2983
Fax +49 (40) 3001- 2942
Mail jan...@hl...
http://www.hapag-lloyd.com
Vorsitzender des Aufsichtsrats: Dr. Michael Frenzel
Vorstand: Michael Behrendt (Vorsitzender), Peter Ganz, Ulrich Kranich, Jesper Praestensgaard
Sitz: Hamburg, Handelsregister: Amtsgericht Hamburg HRB 97937
Chairman of the Supervisory Board: Dr. Michael Frenzel
Executive Board: Michael Behrendt (Chairman), Peter Ganz, Ulrich Kranich, Jesper Praestensgaard
Registered Seat: Hamburg, Company Register: Amtsgericht Hamburg HRB 97937
|