This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes JAXB - including externally generated xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JAXB - including externally generated xml" Watch "JAXB - including externally generated xml" New topic
Author

JAXB - including externally generated xml

Ron Alby
Greenhorn

Joined: May 31, 2011
Posts: 27
I am working with an XML schema that is so big it destroys JAXB. There is absolutely nothing I can do about this.
I am working with a 3rd party application that sends me XML based on that huge schema.

I need to add additional information to the XML. I can not mess with the 3rd party application. However, I have approval to embed that huge 3rd party xml into an outer document, as shown below:



Please do not suggest that I read the 3rd party data into a Java object and then write it back out. Like I said, the schema for that data is huge and kills JAXB, XML Spy code generation, and every XML<->Java toolkit out there except Jibx - which I am not approved to use.

Additionally, I really don't want to go thru the overhead of unmarshalling all of that and then remarshalling it.

Is there a convenient way for me to accomplish this using JAXB?
  • Could I interrupt the JAXB output stream and insert the 3rd party xml?
  • Is there a convenient way for me to use <any> in the MyDocument schema to allow me to slip it in?
  • Any other ideas?
  • Do I hand roll the opening MyDocument, have JAXB generate MyAddlData, append the Huge3rdPartyData, and then hand roll the closing MyDocument?


  • Thank you for your input on this problem
    Ron Alby
    Greenhorn

    Joined: May 31, 2011
    Posts: 27
    After with a JAXB guy at work I think the best answer is:
    Hand roll the opening MyDocument, have JAXB generate MyAddlData, append the Huge3rdPartyData, and then hand roll the closing MyDocument

    Sorry for clogging up the forum.

    RonA
     
    Don't get me started about those stupid light bulbs.
     
    subject: JAXB - including externally generated xml
     
    It's not a secret anymore!