turugina #7512(2008/08/31 20:15 GMT) [ XSLT ] Rating-1/1=-1.00
入出力の日付文字列はISO8601形式です。
see: "XQuery 1.0 and XPath 2.0 Functions and Operators" の日付関連の説明
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:my="uri:ja.doukaku.org:my-functions" exclude-result-prefixes="my" > <xsl:output method="text" /> <xsl:template match="/" > <xsl:value-of select="my:DateEx('2008-09-01T10:02:38', 10000)"/> </xsl:template> <xsl:function name="my:DateEx" as="xs:string"> <xsl:param name="dstr" as="xs:string" /> <xsl:param name="sec" as="xs:integer" /> <xsl:sequence select="xs:string( xs:dateTime($dstr) + xs:dayTimeDuration(fn:concat('PT',xs:string($sec),'S')) )" /> </xsl:function> </xsl:stylesheet>
Rating-1/1=-1.00-0+
1 reply [ reply ]
turugina
#7512()
[
XSLT
]
Rating-1/1=-1.00
see: "XQuery 1.0 and XPath 2.0 Functions and Operators" の日付関連の説明
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:my="uri:ja.doukaku.org:my-functions" exclude-result-prefixes="my" > <xsl:output method="text" /> <xsl:template match="/" > <xsl:value-of select="my:DateEx('2008-09-01T10:02:38', 10000)"/> </xsl:template> <xsl:function name="my:DateEx" as="xs:string"> <xsl:param name="dstr" as="xs:string" /> <xsl:param name="sec" as="xs:integer" /> <xsl:sequence select="xs:string( xs:dateTime($dstr) + xs:dayTimeDuration(fn:concat('PT',xs:string($sec),'S')) )" /> </xsl:function> </xsl:stylesheet>Rating-1/1=-1.00-0+
1 reply [ reply ]