
7 Dec
2017
7 Dec
'17
10:28 a.m.
Finished that little test: yes, <xsl:copy-of> preserved the datatype. --------- <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:variable name="arbitraryDate"> <xsl:copy-of select="xs:date('2017-12-07')"/> </xsl:variable> <!-- the variable $D retains the dateness (i.e., the xs:date datatype), else the following would throw an error. --> <xsl:value-of select="format-date( $arbitraryDate,'[FNn] [D01] [MNn] [Y]')"/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> ---------