XML/XSLT stylesheet/string join — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:26, 26 мая 2010
Join strings with string-join() function
<source lang="xml">
<?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 10 return string($i * $i)), " => ")" />
</body> </html> </xsl:template>
</xsl:stylesheet> Output: <html>
<body>1 => 4 => 9 => 16 => 25 => 36 => 49 => 64 => 81 => 100
</body>
</html>
</source>