trying to create the same field twice: id
The issue comes from a name collision between an attribute and a child element within certain complex types in this schema. Specifically it is the id element and the ID attribute. The schema has something like this...
<xs:element name="id" type="II" minOccurs="0" maxOccurs="unbounded"/>
<xs:attribute name="ID" type="xs:ID"/>
I would argue that the ID attribute is of little value...
The purpose of the xs:ID datatype is to define unique identifiers that are global to a document and emulate the ID attribute type available in the XML DTDs.
This attribute can be used for referencing parts of a document within the document itself but has no real application outside of the document scope. However, the id element has application outside of the scope of the document as well as within it. So since the ID attribute is of little importance the solution is to rename it to something that will not cause a name collision.
Rather than modifying the XSD itself, I like to use a bindings file to customise the output of xjc. A binding file like the one below would allow xjc to compile the schema successfully.
The bindings look for these ID attributes on specific objects and rename them to 'id2'. It's as simple as that.