I need some help with my xsd and jaxb.
My xsd leads to an working class (MyWorkingType) and the 'ProblemType', which is not generated with an enum.
As I believe, that both forms are valid, why does this not work, where is the bug (jaxb or at the keyboard?)
Edit: I add my ant-script, because Xtian could create this via maven-plugin.
This is my xsd:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="ProblemType">
<xs:sequence>
<xs:element minOccurs="0" name="normalAttribute" nillable="true" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="enumAttribute">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="VALUE_1" />
<xs:enumeration value="VALUE_2" />
<xs:enumeration value="VALUE_3" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="workingEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="VALUE_1" />
<xs:enumeration value="VALUE_2" />
<xs:enumeration value="VALUE_3" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="MyWorkingType">
<xs:sequence>
<xs:element minOccurs="0" name="normalAttribute" nillable="true" type="xs:boolean" />
<xs:element minOccurs="1" maxOccurs="1" name="enumAttribute" type="workingEnum" />
</xs:sequence>
</xs:complexType>
</xs:schema>
This is my ant-script I use within eclipse:
<?xml version="1.0" encoding="UTF-8"?>
<project name="generate" default="generate-jaxb" basedir=".">
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath>
<fileset dir="../lib" includes="*.jar" />
</classpath>
</taskdef>
<target name="generate-jaxb">
<xjc destdir="../../src-gen" package="test.gen">
<arg value="-no-header" />
<schema dir="xsd/" includes="*.xsd"/>
</xjc>
</target>
</project>