入力 XML
<ClientInformation>
<FirstName>Ram</FirstName>
<LastName>Shah</LastName>
<MiddleName></MiddleName>
<DateOfBirth>01/01/1972</DateOfBirth>
<TaxIdentification>12346</TaxIdentification>
<RelationshipToInsuredCT>Spouse</RelationshipToInsuredCT>
<RelationshipToEmployeeCT>Spouse</RelationshipToEmployeeCT>
<RoleTypeCT>Insured</RoleTypeCT>
</ClientInformation>
出力 XML
<ContractClientVO>
<ConstantElement1></ConstantElement1>
<ConstantElement2></ConstantElement2>
<RelationshipToInsuredCT>Spouse</RelationshipToInsuredCT>
<RelationshipToEmployeeCT>Spouse</RelationshipToEmployeeCT>
<ClientRoleVO>
<ClientRoleConstantElement1></ClientRoleConstantElement1>
<RoleTypeCT>Insured</RoleTypeCT>
<ClientDetailVO>
<FirstName>Ram</FirstName>
<LastName>Shah</LastName>
<MiddleName></MiddleName>
<DateOfBirth>01/01/1972</DateOfBirth>
<TaxIdentification>12346</TaxIdentification>
</ClientDetailVO>
<ClientRoleVO>
</ContractClientVO>
マッピング参照用の XML
<ClientInformation>
<ContractClientVO>
<AssignmentReasonCT></AssignmentReasonCT>
<Associated></Associated>
<AuthorizedSignatureCT></AuthorizedSignatureCT>
<ClassCT></ClassCT>
<RelationshipToInsuredCT></RelationshipToInsuredCT>
<RelationshipToEmployeeCT></RelationshipToEmployeeCT>
<ClientRoleVO>
<AgentFK></AgentFK>
<Associated></Associated>
<RoleTypeCT></RoleTypeCT>
<ClientDetailVO>
<address></address>
<city></city>
<state></state>
<Amount></Amount>
<CountryTypeCT></CountryTypeCT>
<AmountOfInsurance></AmountOfInsurance>
<FirstName></FirstName>
<LastName></LastName>
<TaxIdentification></TaxIdentification>
</ClientDetailVO>
</ClientRoleVO>
</ContractClientVO>
</ClientInformation>
したがって、3 番目の xml は参照用です。出力 xml の構造を定義するのに役立ちます。
この種の問題に対する Groovy のすぐに使えるソリューションはありますか? または、各input xml
要素を調べて、 で検証しましたreference xml
。