How to select the smallest value from a bunch of variables?
问题 Assume I have variables $a , $b , $c and $d which all hold numbers. I would like to get the smallest (largest) value. My typical XSLT 1.0 approach to this is <xsl:variable name="minimum"> <xsl:for-each select="$a | $b | $c | $d"> <xsl:sort select="." data-type="number" order="ascending" /> <xsl:if test="position()=1"><xsl:value-of select="." /></xsl:if> </xsl:for-each> </xsl:variable> However, my xslt 1.0 processor complains with runtime error: file stylesheet.xslt line 106 element for-each