XSL换行示例
2005/8/31 22:26:07
阅读全文(5287) | 回复(0) | 编辑 | 精华
<xsl:template match="News"> <xsl:call-template name="nl2br"> <!--自己的内容--> <xsl:with-param name="contents" select="//Content" /> </xsl:call-template></xsl:template> <xsl:template name="nl2br"> <xsl:param name="contents" /> <xsl:choose> <xsl:when test="contains($contents, ' ')"> <xsl:value-of select="substring-before($contents, ' ')" /> <br /> <xsl:call-template name="nl2br"> <xsl:with-param name="contents" select="substring-after($contents, ' ')" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$contents" /> </xsl:otherwise> </xsl:choose></xsl:template> 转自:http://bbs.xml.org.cn/dispbbs.asp?boardid=1&id=21542&star=2#4902
Posted by Qr on 2005/8/31 22:26:07
| 发表评论: |