• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java 6 JAXB Mapping Issue

Isuru Sampath
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic