XSLT: moving a grouping html elements into section levels

前端 未结 4 914
礼貌的吻别
礼貌的吻别 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

    An XSLT 1.0 solution (essentially borrowed by Jenni Tennison):

    
     
     
    
     
       
     
    
     
       
     
    
     
     
     
     
     
    
     
    
     
       
       

    when this transformation is applied on the following XML document:

    
        
            

    1

    1

    1.1

    2

    1.1.1

    3

    1.2

    4

    2

    5

    2.1

    6

    the wanted result is produced:

    
       
    1

    1

    1.1

    2

    1.1.1

    3

    1.2

    4

    2

    5

    2.1

    6

提交回复
热议问题