The official JDFLibJ library published by CIP4 for processing JDF files is rather old-fashioned (especially, not based on JAXB). Therefore I tried to convert the JDF Schema to Java code by myself, so that I would get all the advantages of JAXB.
Here is what I did so far:
- From page
Download JDF Schema
downloaded the file JDF-Schema-1.5-lax-b62.zip.
The zip content looks like this. - Unzipped it, getting 8 .xsd files. The entry-point is
JDF.xsd
, including the other 7 .xsd files byxs:import
andxs:include
. - Called
xjc JDF.xsd
I expected to get:
- A package with several hundreds of .java files (classes and enums) would be generated.
2 classes (JDF
andJMF
) of them should be annotated with@XmlRootElement
.
But actually nothing was generated, and 800 lines of error messages appeared.
parsing a schema...
[ERROR] Base complex type "JMFAbstractResponse_" is derived by restriction, while this complex type "ResponseSetQueueEntryPosition" is derived by extension. This is not currently handled by XJC, but we are seeking input on this issue. Please report this to the JAXB team.
line 3421 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFMessage.xsd
[ERROR] Base complex type "JDFAbstractNode" is derived by restriction, while this complex type "ContoneCalibration" is derived by extension. This is not currently handled by XJC, but we are seeking input on this issue. Please report this to the JAXB team.
line 718 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFProcess.xsd
[ERROR] Base complex type "JMFAbstractResponse_" is derived by restriction, while this complex type "ResponseShutDown" is derived by extension. This is not currently handled by XJC, but we are seeking input on this issue. Please report this to the JAXB team.
line 1993 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFMessage.xsd
...rest of output omitted here...
[ERROR] Property "GenericElements" is already defined. Use <jaxb:property> to resolve this conflict.
line 1272 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFCore.xsd
[ERROR] The following location is relevant to the above error
line 1274 of file:/D:/workspace4.4/de.tfritsch.jdf/JDFCore.xsd
Failed to parse a schema.
Is there any chance to work around this issue, at least for a partial solution?
Edit:
It seems others already ran into the same issue with the JDF schema. See this comment on bug-report JAXB-745 xjc derivation by extension/restriction.