I'm trying convert an XML file to text using XSLT, but I don't have any experience using XSLT.
Here's a sample XML file:
<DOC xsi:noNamespaceSchemaLocation="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DOC_REQUISITES DOC_DATE="2009-04-23" DOC_NO="99999999"/>
<DOCID TradeDate="2009-04-23" Weekday="Monday" MainFirmId="ZXC0000" FirmName="Firm Name" FirmINN="1234567899">
<FIRM FirmID="FirmId">
<CURRENCY CurrencyId="USD">
<DEPARTMENT DepartmentId="ABCD" DepName="Department Name1">
<SETTLEDATE SettleDate="2009-04-23">
<SECURITY SecurityId="QAZ" SecShortName="SecName1" SecurityType="dc" FaceValue="5">
<TRDACC TrdAccId="ABC00000">
<RECORDS RecNo="1" TradeNo="111" TradeTime="15:15:16" Price="10" Quantity="50" Value="500"/>
</TRDACC>
<TRDACC TrdAccId="SDC00000">
<RECORDS RecNo="2" TradeNo="112" TradeTime="15:15:16" Price="10" Quantity="50" Value="500"/>
<RECORDS RecNo="3" TradeNo="113" TradeTime="15:15:16" Price="20" Quantity="10" Value="200"/>
</TRDACC>
</SECURITY>
<SECURITY SecurityId="WSX" SecShortName="SecName2" SecurityType="dc" FaceValue="1">
<TRDACC TrdAccId="ABC00000">
<RECORDS RecNo="4" TradeNo="114" TradeTime="15:15:13" Price="2" Quantity="1" Value="2"/>
</TRDACC>
</SECURITY>
</SETTLEDATE>
</DEPARTMENT>
<DEPARTMENT DepartmentId="CBSD" DepName="Department Name2">
<SETTLEDATE SettleDate="2009-05-20">
<SECURITY SecurityId="RFV" SecShortName="SecName3" SecurityType="dc" FaceValue="2">
<TRDACC TrdAccId="SDC00000">
<RECORDS RecNo="5" TradeNo="115" TradeTime="15:15:13" Price="100" Quantity="10" Value="1000"/>
</TRDACC>
</SECURITY>
</SETTLEDATE>
</DEPARTMENT>
</CURRENCY>
</FIRM>
</DOCID>
</DOC>
My desired output looks like this:
2009-04-23,99999999,2009-04-23,Monday,ZXC0000,Firm Name,1234567899,FirmId,USD,ABCD,Department Name1,2009-04-23,QAZ,SecName1,dc,5,ABC00000,1,111,15:15:16,10,50,500
2009-04-23,99999999,2009-04-23,Monday,ZXC0000,Firm Name,1234567899,FirmId,USD,ABCD,Department Name1,2009-04-23,QAZ,SecName1,dc,5,SDC00000,2,112,15:15:16,10,50,500
2009-04-23,99999999,2009-04-23,Monday,ZXC0000,Firm Name,1234567899,FirmId,USD,ABCD,Department Name1,2009-04-23,QAZ,SecName1,dc,5,SDC00000,3,113,15:15:16,20,10,200
2009-04-23,99999999,2009-04-23,Monday,ZXC0000,Firm Name,1234567899,FirmId,USD,ABCD,Department Name1,2009-04-23,WSX,SecName2,dc,1,ABC00000,4,114,15:15:13,2,1,2
2009-04-23,99999999,2009-04-23,Monday,ZXC0000,Firm Name,1234567899,FirmId,USD,CBSD,Department Name2,2009-05-20,RFV,SecName3,dc,2,SDC00000,5,115,15:15:13,100,10,1000