dev@jaxb.java.net

Generating classes from XCRI schema - "[ERROR] 'lang' is already defined" + others

From: mjw <matthew.willard_at_softwarecontractservices.com>
Date: Thu, 6 Nov 2008 09:03:26 -0800 (PST)

I am working on a web service application and need to generate Java classes
from this schema:
http://www.xcri.org/bindings/xcri_cap_1_1.xsd

For speed, I chose to use NetBeans's JAXB binding wizard. The JAXB
compiler's choking with this error:

<output>
xjc-typedef-target:
jaxb-code-generation:
Created dir: D:\XCRI NetBeans\build\generated\jaxbCache\XCRICAP
Compiling file:/D:/XCRI
NetBeans/xml-resources/jaxb/XCRICAP/www.xcri.org/bindings/xcri_cap_1_1.xsd
[ERROR] 'lang' is already defined
  line 113 of http://www.w3.org/2001/xml.xsd

[ERROR] (related to above error) the first definition appears here
  line 88 of http://www.w3.org/2001/03/xml.xsd

[ERROR] 'space' is already defined
  line 122 of http://www.w3.org/2001/xml.xsd

[ERROR] (related to above error) the first definition appears here
  line 95 of http://www.w3.org/2001/03/xml.xsd

[ERROR] 'base' is already defined
  line 129 of http://www.w3.org/2001/xml.xsd

[ERROR] (related to above error) the first definition appears here
  line 104 of http://www.w3.org/2001/03/xml.xsd

[ERROR] 'specialAttrs' is already defined
  line 145 of http://www.w3.org/2001/xml.xsd

[ERROR] (related to above error) the first definition appears here
  line 111 of http://www.w3.org/2001/03/xml.xsd

failure in the XJC task. Use the Ant -verbose switch for more details
D:\XCRI NetBeans\nbproject\xml_binding_build.xml:18: unable to parse the
schema. Error messages should have been provided
BUILD FAILED (total time: 7 seconds)
</output>

For two W3C schemas to clash would seem to be such a common error that
finding the solution ought to be easy, but two days wasted on this has
uncovered nothing.

The goal is to have an Ant script which uses JAXB to generate classes from
that schema.

I have tried Castor but run into other problems and for this project I'd
rather use JAXB anyway. Eclipse is my usual IDE.

I'm completely lost and really need the assistance of experts.
-- 
View this message in context: http://www.nabble.com/Generating-classes-from-XCRI-schema---%22-ERROR--%27lang%27-is-already-defined%22-%2B-others-tp20365204p20365204.html
Sent from the java.net - jaxb dev mailing list archive at Nabble.com.