Convert Excel to XML

TaskMaster

Board Regular
Joined
Oct 15, 2020
Messages
77
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi all,

I have added an XML map to data in row 2 of my spreadsheet to be able to export this as an XML file. This works if I only want to capture the data in row 2. However, I will need the data in rows 3-5 as well, is there a way to have this incorporated into the same XML file. I have also included an extract of the XML file that is exported from the Excel.

XML New.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBH
1DTCC IDDTCC ID 2BizMsgIdrMsgDefIdrCreDtNbRcrdsReporting counterpartySector of the reporting counterpartyClearing ThresholdDrctnOfTheFrstLegDrctnOfTheScndLegOther counterpartySector of the other counterpartyClrThrshldRptgOblgtnSubmitgAgtNttyRspnsblForRptRptgTmStmpCtrctTpAsstClssPdctClssfctnUnqPdctIdrDerivBasedOnCrptAsstUnqTxIdrCollPrtflCdPltfmIdrTxPricFrstLegCcyScndLegCcyDlvryTpExctnTmStmpFctvDtXprtnDtSttlmDtMstrAgrmtVrsnPstTradRskRdctnFlgDerivEvtTmStmpTradConfTmStmpClrOblgtnClrStsIntraGrpIntrstRate FrstLegDayCntPmtFrqcyValIntrstRate ScndLegUnitValSprdDayCntPmtFrqcyValRstFrqcyValLvl
2TESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTEST
3TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1TEST1
NEWT



XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns1:BizData xmlns:ns2="urn:iso:std:iso:20022:tech:xsd:head.001.001.03" xmlns:ns1="urn:iso:std:iso:20022:tech:xsd:head.003.001.01" xmlns:ns3="urn:iso:std:iso:20022:tech:xsd:auth.030.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ns1:Hdr>
        <ns2:AppHdr>
            <ns2:Fr>
                <ns2:OrgId>
                    <ns2:Id>
                        <ns2:OrgId>
                            <ns2:Othr>
                                <ns2:Id>TEST</ns2:Id>
                            </ns2:Othr>
                        </ns2:OrgId>
                    </ns2:Id>
                </ns2:OrgId>
            </ns2:Fr>
            <ns2:To>
                <ns2:OrgId>
                    <ns2:Id>
                        <ns2:OrgId>
                            <ns2:Othr>
                                <ns2:Id>TEST</ns2:Id>
                            </ns2:Othr>
                        </ns2:OrgId>
                    </ns2:Id>
                </ns2:OrgId>
            </ns2:To>
            <ns2:BizMsgIdr>TEST</ns2:BizMsgIdr>
            <ns2:MsgDefIdr>TEST</ns2:MsgDefIdr>
            <ns2:CreDt>TEST</ns2:CreDt>
        </ns2:AppHdr>
    </ns1:Hdr>
    <ns1:Pyld>
        <ns3:Document>
            <ns3:DerivsTradRpt>
                <ns3:RptHdr>
                    <ns3:NbRcrds>TEST</ns3:NbRcrds>
                </ns3:RptHdr>
                <ns3:TradData>
                    <ns3:Rpt>
                        <ns3:New>
                            <ns3:CtrPtySpcfcData>
                                <ns3:CtrPty>
                                    <ns3:RptgCtrPty>
                                        <ns3:Id>
                                            <ns3:Lgl>
                                                <ns3:Id>
                                                    <ns3:LEI>TEST</ns3:LEI>
                                                </ns3:Id>
                                            </ns3:Lgl>
                                        </ns3:Id>
                                        <ns3:Ntr>
                                            <ns3:FI>
                                                <ns3:Sctr>
                                                    <ns3:Cd>TEST</ns3:Cd>
                                                </ns3:Sctr>
                                                <ns3:ClrThrshld>TEST</ns3:ClrThrshld>
                                            </ns3:FI>
                                        </ns3:Ntr>
                                        <ns3:DrctnOrSd>
                                            <ns3:Drctn>
                                                <ns3:DrctnOfTheFrstLeg>TEST</ns3:DrctnOfTheFrstLeg>
                                                <ns3:DrctnOfTheScndLeg>TEST</ns3:DrctnOfTheScndLeg>
                                            </ns3:Drctn>
                                        </ns3:DrctnOrSd>
                                    </ns3:RptgCtrPty>
                                    <ns3:OthrCtrPty>
                                        <ns3:IdTp>
                                            <ns3:Lgl>
                                                <ns3:Id>
                                                    <ns3:LEI>TEST</ns3:LEI>
                                                </ns3:Id>
                                            </ns3:Lgl>
                                        </ns3:IdTp>
                                        <ns3:Ntr>
                                            <ns3:FI>
                                                <ns3:Sctr>
                                                    <ns3:Cd>TEST</ns3:Cd>
                                                </ns3:Sctr>
                                                <ns3:ClrThrshld>TEST</ns3:ClrThrshld>
                                            </ns3:FI>
                                        </ns3:Ntr>
                                        <ns3:RptgOblgtn>TEST</ns3:RptgOblgtn>
                                    </ns3:OthrCtrPty>
                                    <ns3:SubmitgAgt>
                                        <ns3:LEI>TEST</ns3:LEI>
                                    </ns3:SubmitgAgt>
                                    <ns3:NttyRspnsblForRpt>
                                        <ns3:LEI>TEST</ns3:LEI>
                                    </ns3:NttyRspnsblForRpt>
                                </ns3:CtrPty>
                                <ns3:RptgTmStmp>TEST</ns3:RptgTmStmp>
                            </ns3:CtrPtySpcfcData>
                            <ns3:CmonTradData>
                                <ns3:CtrctData>
                                    <ns3:CtrctTp>TEST</ns3:CtrctTp>
                                    <ns3:AsstClss>TEST</ns3:AsstClss>
                                    <ns3:PdctClssfctn>TEST</ns3:PdctClssfctn>
                                    <ns3:PdctId>
                                        <ns3:UnqPdctIdr>
                                            <ns3:Id>TEST</ns3:Id>
                                        </ns3:UnqPdctIdr>
                                    </ns3:PdctId>
                                    <ns3:DerivBasedOnCrptAsst>TEST</ns3:DerivBasedOnCrptAsst>
                                </ns3:CtrctData>
                                <ns3:TxData>
                                    <ns3:TxId>
                                        <ns3:UnqTxIdr>TEST</ns3:UnqTxIdr>
                                    </ns3:TxId>
                                    <ns3:CollPrtflCd>
                                        <ns3:Prtfl>
                                            <ns3:Cd>TEST</ns3:Cd>
                                        </ns3:Prtfl>
                                    </ns3:CollPrtflCd>
                                    <ns3:PltfmIdr>TEST</ns3:PltfmIdr>
                                    <ns3:TxPric>
                                        <ns3:Pric>
                                            <ns3:Pctg>TEST</ns3:Pctg>
                                        </ns3:Pric>
                                    </ns3:TxPric>
                                    <ns3:NtnlAmt>
                                        <ns3:FrstLeg>
                                            <ns3:Amt>
                                                <ns3:Amt Ccy="TEST">TEST</ns3:Amt>
                                            </ns3:Amt>
                                        </ns3:FrstLeg>
                                        <ns3:ScndLeg>
                                            <ns3:Amt>
                                                <ns3:Amt Ccy="TEST">TEST</ns3:Amt>
                                            </ns3:Amt>
                                        </ns3:ScndLeg>
                                    </ns3:NtnlAmt>
                                    <ns3:DlvryTp>TEST</ns3:DlvryTp>
                                    <ns3:ExctnTmStmp>TEST</ns3:ExctnTmStmp>
                                    <ns3:FctvDt>TEST</ns3:FctvDt>
                                    <ns3:XprtnDt>TEST</ns3:XprtnDt>
                                    <ns3:SttlmDt>TEST</ns3:SttlmDt>
                                    <ns3:MstrAgrmt>
                                        <ns3:Tp>
                                            <ns3:Tp>TEST</ns3:Tp>
                                        </ns3:Tp>
                                        <ns3:Vrsn>TEST</ns3:Vrsn>
                                    </ns3:MstrAgrmt>
                                    <ns3:PstTradRskRdctnFlg>TEST</ns3:PstTradRskRdctnFlg>
                                    <ns3:DerivEvt>
                                        <ns3:Tp>TEST</ns3:Tp>
                                        <ns3:TmStmp>
                                            <ns3:Dt>TEST</ns3:Dt>
                                        </ns3:TmStmp>
                                    </ns3:DerivEvt>
                                    <ns3:TradConf>
                                        <ns3:Confd>
                                            <ns3:Tp>TEST</ns3:Tp>
                                            <ns3:TmStmp>TEST</ns3:TmStmp>
                                        </ns3:Confd>
                                    </ns3:TradConf>
                                    <ns3:TradClr>
                                        <ns3:ClrOblgtn>TEST</ns3:ClrOblgtn>
                                        <ns3:ClrSts>
                                            <ns3:NonClrd>
                                                <ns3:Rsn>TEST</ns3:Rsn>
                                            </ns3:NonClrd>
                                        </ns3:ClrSts>
                                        <ns3:IntraGrp>TEST</ns3:IntraGrp>
                                    </ns3:TradClr>
                                    <ns3:IntrstRate>
                                        <ns3:FrstLeg>
                                            <ns3:Fxd>
                                                <ns3:Rate>
                                                    <ns3:Rate>TEST</ns3:Rate>
                                                </ns3:Rate>
                                                <ns3:DayCnt>
                                                    <ns3:Cd>TEST</ns3:Cd>
                                                </ns3:DayCnt>
                                                <ns3:PmtFrqcy>
                                                    <ns3:Term>
                                                        <ns3:Unit>TEST</ns3:Unit>
                                                        <ns3:Val>TEST</ns3:Val>
                                                    </ns3:Term>
                                                </ns3:PmtFrqcy>
                                            </ns3:Fxd>
                                        </ns3:FrstLeg>
                                        <ns3:ScndLeg>
                                            <ns3:Fltg>
                                                <ns3:Nm>TEST</ns3:Nm>
                                                <ns3:RefPrd>
                                                    <ns3:Unit>TEST</ns3:Unit>
                                                    <ns3:Val>TEST</ns3:Val>
                                                </ns3:RefPrd>
                                                <ns3:Sprd>
                                                    <ns3:Pctg>TEST</ns3:Pctg>
                                                </ns3:Sprd>
                                                <ns3:DayCnt>
                                                    <ns3:Cd>TEST</ns3:Cd>
                                                </ns3:DayCnt>
                                                <ns3:PmtFrqcy>
                                                    <ns3:Term>
                                                        <ns3:Unit>TEST</ns3:Unit>
                                                        <ns3:Val>TEST</ns3:Val>
                                                    </ns3:Term>
                                                </ns3:PmtFrqcy>
                                                <ns3:RstFrqcy>
                                                    <ns3:Term>
                                                        <ns3:Unit>TEST</ns3:Unit>
                                                        <ns3:Val>TEST</ns3:Val>
                                                    </ns3:Term>
                                                </ns3:RstFrqcy>
                                            </ns3:Fltg>
                                        </ns3:ScndLeg>
                                    </ns3:IntrstRate>
                                </ns3:TxData>
                            </ns3:CmonTradData>
                            <ns3:Lvl>TEST</ns3:Lvl>
                        </ns3:New>
                    </ns3:Rpt>
                </ns3:TradData>
            </ns3:DerivsTradRpt>
        </ns3:Document>
    </ns1:Pyld>
</ns1:BizData>
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
You'll have to write a VBA routine to generate multi-level xml structures, Excel can only natively export XML that is one level "deep".
 
Upvote 0

Forum statistics

Threads
1,226,013
Messages
6,188,421
Members
453,473
Latest member
bbugs73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top