XSLT & XSL-FO: Creating a table with multiple rows?

前端 未结 2 1766
隐瞒了意图╮
隐瞒了意图╮ 2021-01-27 03:34

I\'m fairly new to XSLT and I am stuck with a problem where I have an Element with an unknown amount of children, and I need to display these children in a table such that there

2条回答
  •  耶瑟儿~
    2021-01-27 04:03

    One approach is to use two recursive templates:

    
        
    
    
        
        
    
    
        
            
            
    
            
                
                    
                        
                            
                        
                        
                    
                
            
        
    
    
        
        
            
            
            
    
            
                
                    
                        
                        
                    
                
                
                    
                    
                    
                
            
        
    
    
        
        
            
            
            
            
    
            
                
                    
                        
                        
                    
                
                
                    
                    
                    
                    
                
            
        
    
    
    

    With yout input

    
        
            Ralls, Kim
            Midnight Rain
        
        
            Corets, Eva
            Maeve Ascendant
        
        
    
    

    you get:

    
        
            
                
                    Ralls, Kim
                
                
                    Corets, Eva
                
                
                    Corets, Eva
                
                
                    Randall, Cynthia
                
                
                    Thurman, Paula
                
            
            
                
                    Knorr, Stefan
                
                
                    Kress, Peter
                
                
                    Crichton, Michael
                
                
                    Orwell, George
                
                
                    Martin, George
                
            
        
    
    

提交回复
热议问题