I have an xml structure:
<Date>Mon, 11 Aug 2009 13:15:10 GMT</Date>
i want to extract only 15:10 or '15' and '10'. What is the best way to do that using xslt
I have an xml structure:
<Date>Mon, 11 Aug 2009 13:15:10 GMT</Date>
i want to extract only 15:10 or '15' and '10'. What is the best way to do that using xslt
Here is a general XSLT solution which would be useful also in converting a string containing a date in the format specified in the problem, into an XML-structured date:
This uses the FXSL 1.x template
str-split-to-words
to perform tokenization with more than one possible delimiters.When this transformation is applied on the provided XML document:
the wanted result is produced:
Do note: The string is converted completely into an XML-structured date using this code fragment:
Try below; assumes the date is always in the same format.
If the date contains a colon only in the time field and time is always represented in the format HH:MM:SS then selecting a fixed length substring after first colon should solve your problem
untested XSLT one-liner