Sven Hupert Kirf

Greenhorn
+ Follow
since Mar 06, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sven Hupert Kirf

hi,

i managed to annotate my classes so that they can be easily marshalled and unmarshalled.
the only problem im still struggling with is that i can´t create the leading <janitor> and trailing </janitor> tag.

my generated xml looks like this:



i know that there is the @ElementWrap annotation but unfortunately i can´t use thise in my Device Class because of the @RootElement Annotation



any ideas?
hi guys,

im new here, so firstly: hello :P

i have a problem related to xml processing.

i need to map these xml structure


to java objects.

the <device> tag can ouccur only once where there can be an arbitrary number of <sensor> and <actuator> blocks.

in my frist approach i tried to solve it with sax, but i quickly saw that it will end up relatively complex so i discarded this way of solving the problem.

then i read about jaxb and it seems to be exactly what i need. but after working through some how to´s and introduction i still can´t solve my problem appropriate. for example i get error meesages like "if the annotation @XMLattribut is used, the class can´t have a @XMLelement tag" and so on.
(i used the variant with annotation because of the lack of a schema)

can you help me to figure out what classes i need and wich structure they need to have? the goal should be that i have a device object whith a list of components as attribute which holds the sensos and actuator objects.

thanks in advance

ps: i´ve uploaded the classes whith which i already tried and failed to solve the problem :P link:(edit: deleted)
pps: sorry for the bad englisch, as you can see from the xml i´m german...