XML/XSLT stylesheet/for loop
Версия от 18:22, 25 мая 2010; (обсуждение)
Put a for loop into string-join function
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:value-of
select="string-join((for $i in 1 to 3 return string($i * $i)), " => ")" />
<br />
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Output:
<html>
<body>1 => 4 => 9<br></body>
</html>