Convert date from DD-MMM-YYYY to YYYYMMDD format in xslt 1.0

前端 未结 3 1656
迷失自我
迷失自我 2020-12-17 01:20

How we can convert the date format from DD-MMM-YYYY to YYYY-MM-DD in XSLT.

10-JAN-2013 TO 20130110

in XSLT 1.0

3条回答
  •  孤街浪徒
    2020-12-17 01:52

    This is very straightforward with an xsl:choose element, and doesn't require any extensions.

    This stylesheet

    
    
    
      
      
    
      
        
          
        
      
    
      
        
          
            
          
        
      
    
      
        
        
        
        
        
        
        
          01
          02
          03
          04
          05
          06
          07
          08
          09
          10
          11
          12
        
        
      
    
    
    

    Applied to this XML data

    
    
      10-JAN-2013
      04-JUL-1776
      31-DEC-1999
    
    

    Produces this output

    
    
       20130110
       17760704
       19991231
    
    

提交回复
热议问题