HyperJaxb - Any way to exclude xml schemas which are imported in included schemas?
Here's my problem:
I have two .xsd files,开发者_开发问答 let's call them a.xsd and b.xsd. What I want to achieve is to generate all the classes from a.xsd excluding the classes in b.xsd. Now the problem is, that a.xsd references a type in b.xsd (via a ), so even when excluded, the classes in b.xsd get build. Is there some way around this?
You can't exclude a schema, but you can exclude a schema-derived package.
Please see Ignoring packages:
<jaxb:bindings schemaLocation="schema-ignored.xsd" node="/xsd:schema">
<jaxb:schemaBindings>
<jaxb:package name="org.jvnet.hyperjaxb3.ejb.tests.issuesignored"/>
</jaxb:schemaBindings>
<hj:ignored-package name="org.jvnet.hyperjaxb3.ejb.tests.issuesignored"/>
</jaxb:bindings>
Since you actually have a reference to a type from b.xsd
somewhere in a.xsd
you will need to break this reference. You can either ignore this property using hj:ignored
or customize it with xjc:dom
to make it a DOM element in the Java class.
ps. I'm responding to users@hyperjaxb.java.net
faster than to questions on SO.
精彩评论