Created
April 19, 2012 01:29
-
-
Save pinzolo/2417741 to your computer and use it in GitHub Desktop.
改行コードを br タグに置き換える template (XSLT)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:template name="ReplaceLineSeparator"> | |
<xsl:param name="value"/> | |
<xsl:choose> | |
<xsl:when test="contains($value, '
')"> | |
<xsl:value-of select="substring-before($value, '
')"/> | |
<br/> | |
<xsl:call-template name="ReplaceLineSeparator"> | |
<xsl:with-param name="value" select="substring-after($value, '
')"/> | |
</xsl:call-template> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="$value"/> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment