Hi, I have recently upgraded from using castor 1.0.1 to 1.1.1, but am having difficultly using the source generator with schemas containing anonymous complex types (default binding type set to "type").
I've attached a simple schema in an attempt to explain the problem. When I use version 1.0.1 I end up with 5 classes generated - two "type" classes and 3 "element" classes as expected. However, with version 1.1.1 only 2 classes are generated - one for complex type server and a "null" class (attached). Our binding file adds the "Type" to the end of class names. The following warning is emitted by the source generator "A class name generation conflict has occured between element '/Configuration/Servers' and element '/Configuration'". It appears that the anonymous complex types are causing a naming conflict and the resulting "null" class? Any help regarding this would be greatly appreciated. Do I have something misconfigured? Regards, Richard
IBConfiguration.xsd
Description: Binary data
/* * This class was automatically generated with * <a href="http://www.castor.org">Castor 1.1.1</a>, using an XML * Schema. * $Id$ */ package com.ultra_as.ib.configuration.generated; //---------------------------------/ //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; /** * Class NullType. * * @version $Revision$ $Date$ */ public class NullType implements java.io.Serializable { //--------------------------/ //- Class/Member Variables -/ //--------------------------/ /** * Field _serversElement. */ private NullType _serversElement; //----------------/ //- Constructors -/ //----------------/ public NullType() { super(); } //-----------/ //- Methods -/ //-----------/ /** * Returns the value of field 'serversElement'. * * @return the value of field 'ServersElement'. */ public com.ultra_as.ib.configuration.generated.NullType getServersElement( ) { return this._serversElement; } /** * Method isValid. * * @return true if this object is valid according to the schema */ public boolean isValid( ) { try { validate(); } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; } /** * * * @param out * @throws org.exolab.castor.xml.MarshalException if object is * null or if any SAXException is thrown during marshaling * @throws org.exolab.castor.xml.ValidationException if this * object is an invalid instance according to the schema */ public void marshal( final java.io.Writer out) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); } /** * * * @param handler * @throws java.io.IOException if an IOException occurs during * marshaling * @throws org.exolab.castor.xml.ValidationException if this * object is an invalid instance according to the schema * @throws org.exolab.castor.xml.MarshalException if object is * null or if any SAXException is thrown during marshaling */ public void marshal( final org.xml.sax.ContentHandler handler) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, handler); } /** * Sets the value of field 'serversElement'. * * @param serversElement the value of field 'serversElement'. */ public void setServersElement( final com.ultra_as.ib.configuration.generated.NullType serversElement) { this._serversElement = serversElement; } /** * Method unmarshalNullType. * * @param reader * @throws org.exolab.castor.xml.MarshalException if object is * null or if any SAXException is thrown during marshaling * @throws org.exolab.castor.xml.ValidationException if this * object is an invalid instance according to the schema * @return the unmarshaled * com.ultra_as.ib.configuration.generated.NullType */ public static com.ultra_as.ib.configuration.generated.NullType unmarshalNullType( final java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (com.ultra_as.ib.configuration.generated.NullType) Unmarshaller.unmarshal(com.ultra_as.ib.configuration.generated.NullType.class, reader); } /** * * * @throws org.exolab.castor.xml.ValidationException if this * object is an invalid instance according to the schema */ public void validate( ) throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); } }
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email

