| Article: |
Generating an XML Document with JAXB | |
| Subject: | JAXB 2.0 | |
| Date: | 2006-03-19 07:16:16 | |
| From: | dvohra09 | |
|
For JAXB 2.0 the JAR files required and the Java classes generated are different.
|
||
Showing messages 1 through 5 of 5.
-
JAXB1.4 | Root element of the schema is not created
2006-07-26 23:37:45 Gowtham_J [Reply | View]
-
JAXB1.4 | Root element of the schema is not created
2006-07-27 11:30:10 Deepak Vohra [Reply | View]
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. -
JAXB1.4 | Root element of the schema is not created
2006-07-27 11:32:01 Deepak Vohra [Reply | View]
Modify 4.
4. Create a JAXBElement<RootType> object from RootType object. JAXBElement<RootType> represents root element in XML document.
-
JAXB 2.0
2006-07-20 09:05:18 gpaladi [Reply | View]
Hello,
I tried all steps you have mentioned for JAXB 2.0. But when I run XJC, it's not creating all classes. I try to ran the sample catalog.xsd you have mentioned in the article. It created only the following 4 files.
ArticleType
CatalogType
JournalType
ObjectFactory
Can you please help to fix this problem.
Thanks
Guru -
JAXB 2.0
2006-07-20 09:28:20 Deepak Vohra [Reply | View]
That's all the classes JAXB 2.0 creates, just the value classes, unlike JAXB 1.0 which creates interfaces and implementation classes, another advantage of JAXB 2.0.





Hope you can help me to get rid of this problem.
Thanks in advance.
Gowtham J