sequences in XSLT

后端 未结 1 1216
Happy的楠姐
Happy的楠姐 2021-01-17 04:40

my xml input is-

 
  bar 
       bar 
       

        
1条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-17 05:07

    Same as here, use the id of the first preceding sibling whose name is different in order to group the records:

    
    
    
    
    
    
    
    
        
            
                
                    
                
            
        
    
    
    
    
    

    Added:

    But the output i am getting is not same as my desired output...

    When applied to your (cleaned up) input of:

     
    
        bar 
        bar 
        foobar 
        foobar 
        foobar
        bar
        bar 
    
    

    the result is:

    
    
      
        
          bar
          bar
        
        
          foobar
          foobar
          foobar
        
        
          bar
          bar
        
      
    
    

    which to me seems to be exactly the result you have asked for:

    
    
       
      
      
     bar  
     bar
     
      
     foobar>
     foobar>
     foobar>
      
           
     bar  
     bar 
     
     
    
    

    except for the > characters inside the elements, which I have removed from the input.

    --

    P.S. Please DO NOT delete your question after it has been answered.

    0 讨论(0)
提交回复
热议问题