繁体   English   中英

FpML自定义绑定jaxb

[英]FpML Custom binding jaxb

我需要在我的项目中使用FpML并努力用JAXB生成Java类:

[ERROR] Element "{http://www.fpml.org/FpML-5/confirmation}tradeId" shows up in more than one properties.
line 1142 of file:/D:/FpML/schema/fpml/5-5/confirmation/fpml-doc-5-5.xsd

fpml-doc-5.5.xsd导入到主模式中。

我尝试使用内联自定义绑定(我放弃使用外部文件),如下所示:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns="http://www.fpml.org/FpML-5/confirmation" xmlns:fpml-annotation="http://www.fpml.org/annotation" targetNamespace="http://www.fpml.org/FpML-5/confirmation" ecore:documentRoot="FpML" ecore:nsPrefix="conf" ecore:package="org.fpml.confirmation" version="$Revision: 10163 $" elementFormDefault="qualified" attributeFormDefault="unqualified"
        xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
        xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" 
        jaxb:version="1.0">
....


    <xsd:element name="issuer" type="IssuerId"></xsd:element>
      <xsd:element name="tradeId" type="TradeId">
        <xsd:annotation>
           <xsd:appinfo>
                    <jaxb:property name="tradeIdentifierId"/>
           </xsd:appinfo>
        </xsd:annotation>
      </xsd:element>

仍然发生相同的错误。

直接编辑架构以重命名tradeId将解决此问题,但我不能这样做。 我仍然可以定义自己的内联绑定。

你能说明点什么吗?

使用JAXB版本2。我使用的jaxb-xjc 2.1.13没有FPML 5.5确认的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM