After changing the namespace on the attached answers_orig.xsd to http://www.w3.org/2001/XMLSchema, I got the below exception from Castor XML SourceGenerator (see below). The answers_orig.xsd schema was automatically generated from answers.xdr (MS format) so I commented out some stuff to produce answers.xsd which I think does almost exactly the same thing as the original XDR specification.
Should Castor support the answers_orig.xsd?
I would, of course, like the process of XDR -> XSD -> Java to be as
automated as possible so it would be excellent if Castor supported this kind
of schema.
Can anyone help?
D:\tmp\binding\castor-0.9.3.9>java -cp
castor-0.9.3.9-xml.jar;d:\myprojects\tfr-hac\development\java\lib\xerces.jar
org.
exolab.castor.builder.SourceGenerator -i ..\answers_orig.xsd -package
com.tfr.itv.ctc
Exception in thread "main" java.lang.IllegalArgumentException: duplicate
name found: _anyObject
at org.exolab.javasource.JClass.addField(JClass.java:242)
at
org.exolab.castor.builder.FieldInfo.createJavaField(FieldInfo.java:155)
at
org.exolab.castor.builder.SourceFactory.handleField(SourceFactory.java:1385)
at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.ja
va:1541)
at
org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.java:
677)
at
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java
:914)
at
org.exolab.castor.builder.SourceGenerator.processContentModel(SourceGenerato
r.java:896)
at
org.exolab.castor.builder.SourceGenerator.processContentModel(SourceGenerato
r.java:891)
at
org.exolab.castor.builder.SourceGenerator.processComplexType(SourceGenerator
.java:807)
at
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java
:758)
at
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java
:707)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.jav
a:354)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.jav
a:412)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.jav
a:441)
at
org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:665)
answers_orig.xsd
Description: Binary data
answers.xsd
Description: Binary data
answers.xdr
Description: Binary data
