Andre,

I haven't tried this on your schema, but something like the following should work:

<?xml version="1.0"?>
<cbf:binding xmlns:cbf="http://www.castor.org/SourceGenerator/Binding";>

     <cbf:elementBinding name="/complexType:fahrzeugartruletype/value">
        <cbf:java-class name="FahrzeugartValueType"/>
     </cbf:elementBinding>

     <cbf:elementBinding name="/complexType:fahrzeugklasseruletype/value">
        <cbf:java-class name="FahrzeugklasseValueType"/>
     </cbf:elementBinding>

     ...

</cbf:binding>

--Keith

Andre Peterka wrote:
Hi all

I am trying to generate Classes with the SourceGenerator.

I get one error that I understand but can not solve.

The XSD is conatining a couple of simpleType's with the name of 'value' -
that causes a naming conflict during genearation.

Here is an extract of the XSD:

        <xs:complexType name="fahrzeugartruletype">
                <xs:sequence>
                        <xs:element name="value" maxOccurs="unbounded">
                                <xs:simpleType>
                                        <xs:restriction base="xs:integer">
                                                <xs:enumeration value="10"/>
                                                <xs:enumeration value="20"/>
                                                <xs:enumeration value="40"/>
                                                <xs:enumeration value="99"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                </xs:sequence>
                <xs:attribute name="operator" type="shortoperatortype"
use="required"/>
        </xs:complexType>
        <xs:complexType name="fahrzeugklasseruletype">
                <xs:sequence>
                        <xs:element name="value" maxOccurs="unbounded">
                                <xs:simpleType>
                                        <xs:restriction base="xs:string">
                                                <xs:enumeration value="A"/>
                                                <xs:enumeration value="B"/>
                                                <xs:enumeration value="C"/>
                                                <xs:enumeration value="D"/>
                                                <xs:enumeration value="E"/>
                                                <xs:enumeration value="F"/>
                                                <xs:enumeration value="G"/>
                                                <xs:enumeration value="L"/>
                                                <xs:enumeration value="M"/>
                                                <xs:enumeration value="S"/>
                                                <xs:enumeration value="T"/>
                                                <xs:enumeration value="U"/>
                                                <xs:enumeration value="X"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                </xs:sequence>
                <xs:attribute name="operator" type="shortoperatortype"
use="required"/>
        </xs:complexType>
        <xs:complexType name="motorartruletype">
                <xs:sequence>
                        <xs:element name="value" maxOccurs="unbounded">
                                <xs:simpleType>
                                        <xs:restriction base="xs:string">
                                                <xs:enumeration value="D"/>
                                                <xs:enumeration value="H"/>
                                                <xs:enumeration value="O"/>
                                                <xs:enumeration value="R"/>
                                                <xs:enumeration value="Z"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:element>
                </xs:sequence>
                <xs:attribute name="operator" type="shortoperatortype"
use="required"/>
        </xs:complexType>

The error reported is:
Warning: A class name generation conflict has occured between simpleType
'valueT
ype' and simpleType 'valueType'. Please use a Binding file to solve this
problem
.Continue anyway [not recommended] (y|n|?)

What do I have to specify in the binding file so that the types end up in
the types package with the names:
FahrzeugartValueType
FahrzeugklasseValueType
MotorartValueType

Thanxs in advance
Andre


------------------------------------------------------------------------

----------------------------------------------------------- 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