[英]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. 我有两个.xsd文件,我们称它们为a.xsd和b.xsd。 What I want to achieve is to generate all the classes from a.xsd excluding the classes in b.xsd. 我要实现的是从a.xsd生成所有类,但不包括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. 现在的问题是,a.xsd引用了b.xsd中的一个类型(通过a),因此即使被排除,b.xsd中的类也会被构建。 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. 由于您实际上在a.xsd
某处引用了b.xsd
的类型, b.xsd
您需要中断此引用。 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. 您可以使用hj:ignored
忽略此属性,也可以使用xjc:dom
对其进行自定义以使其成为Java类中的DOM元素。
ps. ps。 I'm responding to users@hyperjaxb.java.net
faster than to questions on SO. 我对users@hyperjaxb.java.net
答复比对SO的答复要快。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.