Compiling multiple XSD into single JAR using XMLBeans

Xetius picture Xetius · Mar 9, 2010 · Viewed 7.2k times · Source

I have the following directory structure:

schema1
    schema1.xsd
    schema1.xsdconfig
schema2
    schema2.xsd
    schema2.xsdconfig
schema3
    schema3.xsd
    schema3.xsdconfig

I am trying to compile all of these into a single JAR file using XMLBeans, but cannot work out the scomp command line to compile all of this together. I need a separate XSDConfig file for each XSD due to limitations in the incoming XML, and the requirement to force a different namespace onto each of these files.

How would I specify these files to be combined into a single JAR using scomp?

When I try to compile them I get the following message:

/Users/chris/development/iservice/sstp-gateway/schema/OrderTracking/request/orderTrackingReq.xsd:3:2: error: sch-props-correct.2: Duplicate global element: Session (Original global element found in file: response/orderTrackingResp.xsd)
Time to build schema type system: 0.603 seconds
BUILD FAILED

I don't know how to bind each individual xsdconfig to each xsd file.

Answer

Ravi Gupta picture Ravi Gupta · Mar 9, 2010

Please refer this. You can compile multiple schema at once using the XMLBean ant task.