I am using xjc to create JAXB classes. I am using the following command
xjc -d src -p com.abc.proj the-types.xsd
I am getting the following error
parsing a schema...
[ERROR] s4s-att-invalid-value: Invalid attribute value for 'name' in element 'attribute'. Recorded reason: cvc-datatype-valid.1.2.1: 'xmlns:xsi' is not a valid value for 'NCName'.
line 106 of file:/C:/Port/Field/the-types.xsd
[ERROR] src-attribute.3.1: One of 'ref' or 'name' must be present in a local attribute declaration.
line 106 of file:/C:/Port/Field/the-types.xsd
[ERROR] s4s-att-invalid-value: Invalid attribute value for 'name' in element 'attribute'. Recorded reason: cvc-datatype-valid.1.2.1: 'xsi:noNamespaceSchemaLocation' is not a valid value for 'NCName'.
line 107 of file:/C:/Port/Field/the-types.xsd
[ERROR] src-attribute.3.1: One of 'ref' or 'name' must be present in a local attribute declaration.
line 107 of file:/C:/Port/Field/the-types.xsd
Failed to parse a schema.
Line 106 and 107 starting with **<xs:attribute name="" ..>
**of the-types.xsd file are giving errors. The .xsd file is:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="the-types">
<xs:complexType>
<xs:sequence>
<xs:element name="AType" maxOccurs="unbounded">
...............
</xs:element>
</xs:sequence>
**<xs:attribute name="xmlns:xsi" type="xs:string"></xs:attribute>
<xs:attribute name="xsi:noNamespaceSchemaLocation" type="xs:string"></xs:attribute>**
</xs:complexType>
</xs:element>
</xs:schema>
What I understand from the link Invalid attribute value for 'name' in element 'element' that we cannot use : in the name. But this doesn't help. How should I change my xsd in order to get the JAXB classes.