XSLT to convert dynamic XML to CSV and the XML nodes are not completely repetative II

前端 未结 2 613
[愿得一人]
[愿得一人] 2021-01-29 03:42

Am trying to create an XSLT to convert XML to CSV. Here am placing my XML and expected output anyone have any idea how to get the below output please share me on priority.

2条回答
  •  渐次进展
    2021-01-29 04:29

    The following stylesheet will produce the expected result (minus some formatting issues) from the given example. Whether that's the logic you want to apply in general is not clear.

    XSLT 1.0

    
    
    
    
        
        SttlmOblgtnId,Pmt,Id,Cd,Dt,Unit,Amt,Desc,Cd,RltdSttlmOblgtnId,SttlmDt,SctiesMvmntTp,Pmt,Unit,Amt
    
        
        
            
            
            ,
            
            ,
            
            ,
            
            ,
            
            ,
            
            ,
            
            ,
            
            ,
            
            ,
            
            
            ,
            
            ,
            
            ,
            
            ,
            
            
    
            
            ,,,,,,,,,
            
            ,
            
            ,
            
            ,
            
            ,
            
            
    
        
    
    
    
    

    Result:

    SttlmOblgtnId,Pmt,Id,Cd,Dt,Unit,Amt,Desc,Cd,RltdSttlmOblgtnId,SttlmDt,SctiesMvmntTp,Pmt,Unit,Amt
    A,Fail,SETTLE,CO,2011-11-11,11,20.00,SA,PR,Debit,2011-11-11,INDIA,MT,22.00
    ,,,,,,,,,Outward,2015-12-01,UK,EMP,100.00
    B,Ok,UNSETTLE,MM,2012-12-12,22,60.00,RB,IM,Credit,2012-12-12,DELHI,AP,66.00
    ,,,,,,,,,Value,2001-05-05,US,PASS,666.00
    

提交回复
热议问题