• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Java 6 JAXB Mapping Issue

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for reading my post. I'm working on a project which involves a significant amount of XML message parsing and routing. I'm planning to use JAXB for XML marshaling/unmarshaling. Please note that this project does not involve web services. I'm using JAXB for marshaling/unmarshaling of XML. I realize that there is very limited amount of documentation when it come to this topic. I found this tutorial at javabeat extremely useful as this is what I'm exactly going to do.

But I've hit a rough patch due to the way the XML messages are formed. I tried to change the message format but it seems it is impossible as what I'm working on is one single component of an existing component chain . This is my background. My problem is:

The messages received by my component are of the following format:


The message contains multiple counts of <MSG> tags. And the first <MSG> tag represents a batch header which describes elements common to the rest of the <MSG> elements. I have a object hierarchy which implements the above structure. But I'm stuck when it comes to describing JAXB that the first element is the header and the rest are messages, simply because the base element name is <MSG> for both of them.

You help, comments, ideas will be most helpful. Thanks in advance.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic