• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Java 6 JAXB Mapping Issue  RSS feed

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • 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.
 
Get me the mayor's office! I need to tell her about this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!