<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--数据分隔符-->
<xsl:variable name="spliter">,</xsl:variable>
<xsl:template match="/">
<!-- 测试数据 -->
<xsl:variable name="Img">
http://dotnet.aspx.cc/Images/logoSite.gif,
http://dotnet.aspx.cc/images/logo.gif,
http://dotnet.aspx.cc/images/logoSite.gif
</xsl:variable>
<xsl:call-template name="Split">
<xsl:with-param name="InputData" select="$Img"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="Split">
<xsl:param name="InputData" />
<xsl:variable name="NormalizedData" select="concat(normalize-space($InputData), $spliter)" />
<xsl:variable name="leftString" select="substring-before($NormalizedData, $spliter)" />
<xsl:variable name="remainedString" select="substring-after($NormalizedData, $spliter)" />
<img src="{$leftString}" />
<xsl:if test="substring-before($remainedString, $spliter) != ''">
<xsl:call-template name="Split">
<xsl:with-param name="InputData" select="$remainedString" />
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>