XSLT 1.0 Get Current DateTime

前端 未结 3 2027
栀梦
栀梦 2020-12-10 12:26

I have a node in my XML file containing the following:

2011-12-01T16:33:33Z

I wish to take this line and replace it w

3条回答
  •  时光说笑
    2020-12-10 13:07

    Playing with DateTime is not possible with XSLT 1.0 alone .. In a similar situations I took help of scripting .. (C#)

    Sample XML:

    
    
      2011-12-01T16:33:33Z
    
    

    Sample XSLT:

    
    
      
      
        
        
          
            
                
            
        
        
          
          
          
        
    
    
    

    Resulting Output:

    
    
      2012-02-22T18:03:12Z
    
    

    The script may reside in a same file (like I have it in my sample XSLT code) or if the code triggering XSLTransformation is C# then move the same code in the calling place :)

提交回复
热议问题