How sort elements and store them in a variable, XSLT
问题 I was wondering whether it's possible to sort some elements first and store them (already sorted) in a variable. I would need to refer to them thought XSLT that's why I'd like to store them in a variable. I was trying to do the following, but it doesn't seem to work <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:variable name="deposits"> <xsl:for-each select="/BookingCostings/MultiDeposits"> <xsl:sort select="substring(@DepositDate, 1, 4)" /> <xsl:sort