XSLT 1.0: Sorting by concating portions of date string

前端 未结 2 1406
轻奢々
轻奢々 2021-01-26 00:20

I\'m trying to take XML data and sort elements by their data attribute. Unfortunately the dates come over in mm/dd/yyyy format and are not static lengths. (Jan = 1 instead of

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-26 00:51

    You can use multiple xsl:sort instructions like in this stylesheet:

    
        
            
                
            
        
        
            
                
                
                
                
                
                
            
        
    
    

    Output:

    
        
            
            
            
        
    
    

    Update from comments

    What I'm trying to do is in that stylesheet perform the sort as you've done and then export out the promotionid of the item with startdate '2/19/2011' in this case. I assumed it would be something like but I either am using it in the wrong place or have the statement wrong

    Update 3: Now with new selecting data conditions

    Use the "standard" maximum idiom. This stylesheet:

    
        
            
            
                
                
                
                
                    
                
            
        
    
    

    Output:

    64636
    

提交回复
热议问题