입력에서 가져온 값과 함께 다른 XML로 변환하려는 입력 XML 메시지가 있습니다. 그것을 살펴보고 샘플 XSLT를 안내해 주시겠습니까?XSLT를 사용하여 새 XML 작성
입력 XML :
<Req_IN>
<ReqID_IN>REQIDIN001</ReqID_IN>
<ReqType_IN>AZZ002</ReqType_IN>
<VMID_IN>VMIDINV003</VMID_IN>
<PSMID_IN>PSMIDIN004</PSMID_IN>
<SIDHIQ_IN>sssiiidddd54005</SIDHIQ_IN>
<SIP_IN>SIP_IN_10.20.30.40</SIP_IN>
<MPass_IN>full details of buyer</MPass_IN>
<currency_IN>USD</currency_IN>
<amt_IN>167.78</amt_IN>
<MIDets_IN>
<itCode_IN>a</itCode_IN>
<itDesc_IN>aadesc</itDesc_IN>
<itUntprice_IN>555</itUntprice_IN>
<itQuan_IN>41</itQuan_IN>
</MIDets_IN>
<MIDets_IN>
<itCode_IN>b</itCode_IN>
<itDesc_IN>bbbdesc</itDesc_IN>
<itUntprice_IN>44343</itUntprice_IN>
<itQuan_IN>32</itQuan_IN>
</MIDets_IN>
<MIDets_IN>
<itCode_IN>c</itCode_IN>
<itDesc_IN>abcdesc</itDesc_IN>
<itUntprice_IN>8979</itUntprice_IN>
<itQuan_IN>32</itQuan_IN>
</MIDets_IN>
<ConBDetails_IN>
<cname_IN>firstname lastname</cname_IN>
<ConAddress1>ConBDetails addressline1 </ConAddress1>
<ConAddress2>ConBDetails addressline2</ConAddress2>
<ConAddress3>ConBDetails addressline3</ConAddress3>
<City_IN>ConBdetails_city</City_IN>
<pcode_IN>ConBdetails_PIN</pcode_IN>
<c_IN>ConBdetails US</c_IN>
</ConBDetails_IN>
<mShipDets_IN>
<FullName>fname lname</FullName>
<MerAddress1>mShip addressline1</MerAddress1>
<MerAddress2>mShip addressline2</MerAddress2>
<MerAddress3>mShip addressline3</MerAddress3>
<City_IN>mShip city</City_IN>
<pcode_IN>mShip PIN</pcode_IN>
<c_IN>mSHIP US</c_IN>
</mShipDets_IN>
<VmeTransactionIdentifier>
<VMeUniqueId> a9001</VMeUniqueId>
<AuthenticationMethod>01</AuthenticationMethod>
<AuthenticationReasonCode>1C</AuthenticationReasonCode>
</VmeTransactionIdentifier>
</Req_IN>
출력 XML :
<Req_IN_new>
<PSMID_IN_new>value of PSMID_IN element(PSMIDIN004)</PSMID_IN_new>
<ReqID_IN_new>value of ReqID_IN element (REQIDIN001)</ReqID_IN_new>
<SPT_new>value of ReqID_IN element (REQIDIN001)</SPT_new>
<ConBDetails_IN_new>
<cname_IN_new>firstname lastname</cname_IN_new>
<street1>ConBDetails addressline1 </street1>
<street2>ConBDetails addressline2 </street2>
<street3>ConBDetails addressline3</street3>
<city>ConBdetails_city</city>
<postalCode>ConBdetails_PIN</postalCode>
<country>ConBdetails_US</country>
<ipAddress>value of SIP_IN element (SIP_IN_10.20.30.40)</ipAddress>
</ConBDetails_IN_new>
<MPass_IN_new>full details of buyer </MPass_IN_new>
<mShipDets_IN_new>
<FullName_new>fname lname</FullName_new>
<MerAddress1_new>mShip addressline1</MerAddress1_new>
<MerAddress2_new>mShip addressline2</MerAddress2_new>
<MerAddress3_new>mShip addressline3</MerAddress3_new>
<City_IN_new>mShip city</City_IN_new>
<pcode_IN_new>mShip PIN</pcode_IN_new>
<c_IN_new>mSHIP US</c_IN_new>
</mShipDets_IN_new>
<MIDets_IN_new id="0">
<itCode_IN_new>a</itCode_IN_new>
<itDesc_IN_new>aadesc</itDesc_IN_new>
<itUntprice_IN_new>555</itUntprice_IN_new>
<itQuan_IN_new>41</itQuan_IN_new>
</MIDets_IN_new>
<MIDets_IN_new id="1">
<itCode_IN_new>b</itCode_IN_new>
<itDesc_IN_new>bbbdesc</itDesc_IN_new>
<itUntprice_IN_new>44343</itUntprice_IN_new>
<itQuan_IN_new>32</itQuan_IN_new>
</MIDets_IN_new>
<MIDets_IN_new id="2">
<itCode_IN_new>c</itCode_IN_new>
<itDesc_IN_new>abcdesc</itDesc_IN_new>
<itUntprice_IN_new>8979</itUntprice_IN_new>
<itQuan_IN_new>41</itQuan_IN_new>
</MIDets_IN_new>
<totalAmt>
<amt_IN_new>167.78</amt_IN_new>
<currency_IN_new>USD</currency_IN_new>
</totalAmt>
</Req_IN_new>
보로딘, 귀하의 빠른 응답 주셔서 감사합니다. xslt를 테스트하고 완벽하게 작동합니다. 출력 요소 xml 요소를 입력 요소와 독립적으로 만들 수 있습니까? 출력 XML 요소가 '_new'접미사가있는 입력 XML에서 파생되지 않아야합니다. 이 출력 XML 요소는 출력 XML 당 fullname을 제공하여 구성해야합니다. – sarma
Borodin, 도와 주셔서 감사합니다, 귀하의 xslt 성공적으로 일했다. – sarma