• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to marshall a number of generated classes into a single XML file

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have used the "xjc" tool feeding it 3 XSD files and it generates a list of classes like...
Class1.java
Class2.java
.....
ObjectFactory.java

I'm not sure if I'm supposed to be using the ObjectFactory to create all the classes, because I am able to do something like the following. Looking inside the ObjectFactory class it appears to be doing the same thing anyway. So I continue to create classes to build the XML model I want to marshall out.


Towards the end of the code after I have done all the class generation, I have the following block of code but it's giving me the error that follows. Can someone please let me know what I have done wrong? Thanks.




 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please provide a sample xml and how you are generating from xjc? If possible, provide the complete code sample.

Let me try.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic