How to remove Z from xml timestamp input using XSLT 2.0 -
my input xml:
<chattranscript startat="2017-06-28t20:00:17z"> <message>hai</message> </chattranscript>
in input timestamp contains z. z should removed in output xml below:
<chat> <time>2017-06-28t20:00:17</time> </chat>
xpath 2.0 has function that:
xslt 2.0
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/chattranscript"> <chat> <time> <xsl:value-of select="adjust-datetime-to-timezone(@startat, ())"/> </time> </chat> </xsl:template> </xsl:stylesheet>
Comments
Post a Comment