XSLT 1.0 Get Current DateTime

前端 未结 3 2026
栀梦
栀梦 2020-12-10 12:26

I have a node in my XML file containing the following:

2011-12-01T16:33:33Z

I wish to take this line and replace it w

3条回答
  •  醉梦人生
    2020-12-10 13:00

    You'll better pass the current data as an input / xsl:param to the template.

    The XSLT aims to be purely functional language; that is, all templates / functions should conform to e.g. the following condition: If a pure function is called with parameters that cause no side-effects, the result is constant with respect to that parameter list (sometimes called referential transparency), i.e. if the pure function is again called with the same parameters, the same result will be returned (this can enable caching optimizations such as memoization).

    Although there are workarounds on this (as InfantPro'Aravind' pointed out), it is not recommended to do such things; by doing it, you're ruining one of the most significant XSLT benefits.

提交回复
热议问题