1
다른 스키마의 한 모델 객체 (예 : GroupHeader)를 매핑하는 데 문제가 있습니다. 이 스키마는 각각 다른 네임 스페이스를 갖지만 일부 complextype은 각각의 구조가 거의 동일합니다. 그래서이 요소를 하나의 java Object에 매핑하고 싶습니다. JAXB를 사용하여이 작업을 수행 할 수 있습니까?JAXB (MOXy) - 하나의 모델 객체를 다른 스키마로 매핑
먼저 스키마 :
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.02" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.02"> <xs:element name="Document" type="Document"/> .... <xs:complexType name="GroupHeader33"> <xs:sequence> <xs:element name="MsgId" type="Max35Text"/> <xs:element name="CreDtTm" type="ISODateTime"/> <xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/> <xs:element name="NbOfTxs" type="Max15NumericText"/> <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/> <xs:element maxOccurs="1" minOccurs="0" name="TtlIntrBkSttlmAmt" type="ActiveCurrencyAndAmount"/> <xs:element maxOccurs="1" minOccurs="0" name="IntrBkSttlmDt" type="ISODate"/> <xs:element name="SttlmInf" type="SettlementInformation13"/> <xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation21"/> <xs:element maxOccurs="1" minOccurs="0" name="InstgAgt" type="BranchAndFinancialInstitutionIdentification4"/> <xs:element maxOccurs="1" minOccurs="0" name="InstdAgt" type="BranchAndFinancialInstitutionIdentification4"/> ...
두 번째 스키마 : 제 영어 :)에 대한
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.004.001.02" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pacs.004.001.02"> ... <xs:complexType name="GroupHeader38"> <xs:sequence> <xs:element name="MsgId" type="Max35Text"/> <xs:element name="CreDtTm" type="ISODateTime"/> <xs:element maxOccurs="2" minOccurs="0" name="Authstn" type="Authorisation1Choice"/> <xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/> <xs:element name="NbOfTxs" type="Max15NumericText"/> <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/> <xs:element maxOccurs="1" minOccurs="0" name="GrpRtr" type="TrueFalseIndicator"/> <xs:element maxOccurs="1" minOccurs="0" name="TtlRtrdIntrBkSttlmAmt" type="ActiveCurrencyAndAmount"/> <xs:element maxOccurs="1" minOccurs="0" name="IntrBkSttlmDt" type="ISODate"/> <xs:element name="SttlmInf" type="SettlementInformation13"/> <xs:element maxOccurs="1" minOccurs="0" name="InstgAgt" type="BranchAndFinancialInstitutionIdentification4"/> <xs:element maxOccurs="1" minOccurs="0" name="InstdAgt" type="BranchAndFinancialInstitutionIdentification4"/>
죄송합니다