1

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?

helpermethod
  • 59,493
  • 71
  • 188
  • 276

1 Answers1

1

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.

lexicore
  • 42,748
  • 17
  • 132
  • 221