tags:

views:

180

answers:

1

HI All,

I am trying to use JAXB 1.0 provided by JDeveloper 10g version. I have created a Schema definition with elements having default values. I have following questions:

  1. Whenever I create the Java Content tree using the JAXB generated classes, the java objects should have been created with the default values mentioned in the XML schema. But it doesn't happen. How to make JAXB create the Java objects of an XML document with default values of the elements?
  2. I am trying to add the schemalocation to the marshalled XML document using Marshaller.setProperty( Marshaller.JAXB_SCHEMA_LOCATION, "http://mylocation"); But its not getting reflected in the marshalled XML content.

Please advise, Ramesh

+1  A: 

Have a look at JAXB default value plugin. Some nice additional plugins are mentioned here.

dma_k