Title: castor does not create java classes for all datatypes
 
Castor generates the code for simple types into the *Descriptor.java file of the parent
that aggregates the simple type.  For instance, if you have
 
<xsd:complexType name="Address"
    <xsd:sequence>
        <xsd:element name="StreeAddress" type="xsd:string"/>
        <xsd:element name="PostalCode" type="xsd:string"/>
        <xsd:element name="Country" type="dtCOUNTRIES"/>
    </xsd:sequence>
</xsd:complexType>
 
Castor will generate Address.java and AddressDescriptor.java for this.
The regexp code for dtCOUNTRIES will be generated into AddressDescriptor.java.
 
 
 
-----Original Message-----
From: Weinzierl Christian [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 16, 2003 6:07 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] castor does not create java classes for all datatypes

hello,
i am new to castor ( castor 0.9.5) and i have some problems concerning the creation of java classes with castor.
i have quite a large xml schema (~1400 lines) and when i use castor, i get most of the elements and datatypes created in a java class.

for example i have got the following simple type:

<xsd:simpleType name="dtCURRENCIES">
                <xsd:restriction base="xsd:string">
                        <xsd:enumeration value="ADP"/>
                        <xsd:enumeration value="AED"/>
                        ....<!--around 180 different values -->
                </xsd:restriction>
        </xsd:simpleType>

and i get DtCURRENCIES.java and DtCURRENCIESDescriptor.java
so far so good ;-) (actually, this is great ;-))

i also got the following simple type

<xsd:simpleType name="dtCOUNTRIES">
                <xsd:restriction base="xsd:string">
                        <xsd:pattern value="(AD|AE|AF|AG|AI|AL|AM|....other patterns.....YE|YT|YU|ZA|ZM|ZW){1,1}(-[A-Z|0-9]{1,3}){0,1}"/>

                </xsd:restriction>
        </xsd:simpleType>

but castor does not create any java class. WHY? in the CASTOR User Document it says, that the XML schema facet "pattern" fo the datatype "string" is supported.

perhaps someone could give me some hint.

this is my main problem at the moment, but there is one mor thing where i don't know why it happend (althoug i already managed to fix it)

i had the following complex type:

<xsd:complexType name="dtPARENT">
                <xsd:sequence>
                        <xsd:element name="PARENT_TYPE">
                                <xsd:simpleType>
                                        <xsd:restriction base="xsd:string">
                                                <xsd:enumeration value="PRODUCT_GROUP"/>
                                                <xsd:enumeration value="CUST_GROUP"/>
                                                <xsd:enumeration value="CUST_SEGMENT"/>
                                                <xsd:enumeration value="CATEGORY"/>
                                                <xsd:enumeration value="PRODUCT_SET"/>
                                        </xsd:restriction>
                                </xsd:simpleType>
                        </xsd:element>
                        <xsd:element name="PARENT_NAME" type="xsd:string">
                        </xsd:element>
                </xsd:sequence>
        </xsd:complexType>

 castor created DtPARENT.java and PARENT_TYPE.java

this would be ok, but i found out, that castor created only CUST_SEGMENT, CATEGORY and PRODUCT_SET as class variables in the class PARENT_TYPE.java i added the missing variables and it was ok, but i do not understand how this could happen.

any kinds of explanations are welcome ;-)

christian w.


DISCLAIMER:
This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message and attachments.

Reply via email to