XSLT: moving a grouping html elements into section levels

前端 未结 4 902
礼貌的吻别
礼貌的吻别 2020-11-27 08:18

I\'m trying to write an XSLT that organizes an HTML file into different section levels depending on the header level. Here is my input:


 

        
4条回答
  •  遥遥无期
    2020-11-27 08:56

    A more general grouping in XSLT 1.0

    
        
        
        
            
                
            
        
        
            
                
            
        
        
            

    Output:

    
        
    HEADER 1 CONTENT

    Level 1 para

    Level 1 para

    Level 1 para

    Level 1 para

    Header 2 CONTENT

    Level 2 para

    Level 2 para

    Level 2 para

    Level 2 para

    And with a more complex input sample like:

    
        

    1

    1

    1.1

    2

    1.1.1

    3

    1.2

    4

    2

    5

    2.1

    6

    Output:

    
        
    1

    1

    1.1

    2

    1.1.1

    3

    1.2

    4

    2

    5

    2.1

    6

提交回复
热议问题