使用 XMLBeans 将多个 XSD 编译到单个 JAR 中
我有以下目录结构:
schema1
schema1.xsd
schema1.xsdconfig
schema2
schema2.xsd
schema2.xsdconfig
schema3
schema3.xsd
schema3.xsdconfig
我尝试使用 XMLBeans 将所有这些编译到单个 JAR 文件中,但无法计算出 scomp 命令行来将所有这些编译在一起。由于传入 XML 的限制,以及需要对每个文件强制使用不同的命名空间,我需要为每个 XSD 提供一个单独的 XSDConfig 文件。
如何使用 scomp
指定将这些文件合并到单个 JAR 中?
当我尝试编译它们时,我收到以下消息:
/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
我不知道如何将每个单独的 xsdconfig 绑定到每个 xsd 文件。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅此。您可以使用 XMLBean ant 任务一次编译多个模式。
Please refer this. You can compile multiple schema at once using the XMLBean ant task.
我相信您对在 response/orderTrackingResp.xsd 中指定的 Session 元素有问题。考虑重命名它或添加response/orderTrackingResp.xsdconfig,您可以在其中更改命名空间和其他生成的属性。
I believe that you have problem with Session element, specified in response/orderTrackingResp.xsd. Consider rename it or add response/orderTrackingResp.xsdconfig where you can change namespace and other generated properties.