I'm having trouble constructing my first XSD file. I'm trying to generate Java POJO's bases on my XSD with jaxb2-maven-plugin
.
To start, I've followed the example that I've seen this tutorial
This is my xsd
file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name = "Tshirt">
<xs:complexType>
<xs:sequence>
<xs:element name = "Color" type = "clothesColorType" />
<xs:element name = "Size" type = "clothesSizeType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="clothesSizeType">
<xs:restriction base="xs:string">
<xs:enumeration value="S" />
<xs:enumeration value="M" />
<xs:enumeration value="L" />
<xs:enumeration value="XL" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="clothesColorType">
<xs:restriction base="xs:string">
<xs:enumeration value="Black" />
<xs:enumeration value="White" />
<xs:enumeration value="Green" />
<xs:enumeration value="Blue" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
When my plugin try to parse the file, I get the error
org.xml.sax.SAXParseException; systemId: file:/ruta/src/main/resources/wsdl-definition/Assurance.xsd; lineNumber: 47; columnNumber: 72; src-resolve: No se puede resolver el nombre 'clothesColorType' para un componente 'type definition'.
I have been googling for hours but I have not found the response. Any Ideas?
Thank you in advance.