I am trying to Format my DateTime 2005-08-01T12:00:00 in XSL 1.0. I tried using substring functions but 'T' is still coming. I want my output to come like this -
<YEAR>2005</YEAR>
<MONTH>08</MONTH>
<DAY>01</DAY>
<HOUR>12<HOUR/>
<MINUTE>00<MINUTE/>
<SECOND>00<SECOND/>
How to write snippet of this and remove 'T' from the incoming value?
You can use the substring function for this. Remember, that that the indexing of each character in the string starts at 1 not 0. So, to get the year you would do this (assuming you are currently positioned on a date element)
Here is the full XSLT
When applied to the following XML
THe following is output
Obviously you would have to be sure the dates always came in with the same format for this to work.