ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Generating an XML Document with JAXB
Subject:   JAXB1.4 | Root element of the schema is not created
Date:   2006-07-27 11:30:10
From:   dvohra09
Response to: JAXB1.4 | Root element of the schema is not created

To marshall, we need to follow the following steps:
1. Create a JAXBContext object and use this object to create a Marshaller object.
2. Create an ObjectFactory object to create instances of relevant generated Java content classes.
3. Using the ObjectFactory object, create an object tree with RootType as the root object. Populate these tree objects with relevant data using the appropriate setter methods.
4. Create a JAXBElement<<i>RootType> object from CatalogType object. JAXBElement<<i>RootType> represents catalog element in XML document.


RootType is the interface corresponding to the root element in schema.


1 to 1 of 1
  1. JAXB1.4 | Root element of the schema is not created
    2006-07-27 11:32:01  Deepak Vohra | [View]

1 to 1 of 1