XML to HTML table with XSLT

后端 未结 4 1509
梦如初夏
梦如初夏 2020-12-17 02:56

I need to be able to turn a flat xml data sets into html tables, and I\'m having trouble finding syntax examples that will fit my need. I would like to use one stylesheet th

4条回答
  •  攒了一身酷
    2020-12-17 03:19

    Few days ago I post an article, hope it can help you: http://web.swfideas.com/?p=12191

    Asuming this data:

    
    
    
      
        
          [C1R1]
          [C2R1]
        
        
          [C1R2]
          [C2R2]
        
        
          [C1R3]
          [C2R3]
        
      
    
    

    Now, the core, our XSLT template:

    
    
    
    
    
        
                
                        
                                

    In this first approach I’m avoiding to use COLSPAN and another real-life properties (implementation soon, I promise). So the result if we apply our XSLT will be like this:

    [C1R1] [C2R1]
    [C1R2] [C2R2]
    [C1R3] [C2R3]

    You can try it here: http://www.xsltcake.com/slices/gNfh6i/2

提交回复
热议问题