The specific case that fails for me is when a simpleType with an enumeration is 
defined explicitly for an element.  The generated types are not assigned 
correct packages according to binding.  The following will generate ELEMENTA 
type without the defined package "net.elementa.bind" but will put ROOT in the 
correct package.

Test:

bindking.xml:
<binding xmlns="http://www.castor.org/SourceGenerator/Binding"; 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
         defaultBinding="element">
  <package>
    <name>net.elementa.bind</name>
    <namespace>http://elementa.net/elementa</namespace>
  </package>
</binding>


elementa.xsd:
<xs:schema targetNamespace="http://elementa.net/elementa"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
    <xs:element name="ROOT">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="ELEMENTA"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
        <xs:element name="ELEMENTA">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:enumeration value="a"/>
                                <xs:enumeration value="b"/>
                                <xs:enumeration value="c"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
</xs:schema>


As always, appologies if this is already listed - I couldn't find it.  It works 
in earlier versions of castor.

thanks,
k

       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

Reply via email to