Sri,

You don't have to modify the generated source code. Don't use the
marshal() method on the generated source code. 

Instead, create your own marshaller, configure it, and then marshal the
object.

So instead of:

myObject.marshal(writer);

Use the following:

Marshaller myMarshaller = new Marshaller(writer);
myMarshaller.setNoNamespaceSchemaLocation( SCHEMA_LOC_URI );
myMarshaller.setSuppressXSIType( false );
myMarshaller.setValidation( true );
myMarshaller.marshal(myObject);

This way, you don't have to modify the generated source code at all.

--Keith




Sri Ramaswamy wrote:
> 
> I am currently using castor-0.9.5.3. I want to have the ability
> to turn validation on while marshalling, and off during
> unmarshalling. I also would like the serialized xml to be readable
> and not on the same line. My castor.properties looks like this -
> 
> org.exolab.castor.indent=true
> org.exolab.castor.marshalling.validation=true
> org.exolab.castor.unmarshalling.validation=false
> 
> This file is in the classpath but its not doing a thing. Is it
> possible to get this granular from just the configuration file?
> If so, what do I need to do rght?
> 
> I also would like to be able to set the noNamespaceSchemaLocation.
> 
> For now I have resorted to tweaking the generated src files.
> 
> ..
> marshaller.setNoNamespaceSchemaLocation( SCHEMA_LOC_URI );
> marshaller.setSuppressXSIType( false );
> marshaller.setValidation( true );
> 
> (I still have the problem with not getting line breaks in the xml)
> 
> If possible, I would like to have everything in the configuration
> file and not go about modifying generated code.
> 
> Thanks for your help,
> Sri
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to