Skip to content

Instantly share code, notes, and snippets.

@pinzolo
Created April 19, 2012 01:29
Show Gist options
  • Save pinzolo/2417741 to your computer and use it in GitHub Desktop.
Save pinzolo/2417741 to your computer and use it in GitHub Desktop.
改行コードを br タグに置き換える template (XSLT)
<xsl:template name="ReplaceLineSeparator">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="contains($value, '&#xA;')">
<xsl:value-of select="substring-before($value, '&#xA;')"/>
<br/>
<xsl:call-template name="ReplaceLineSeparator">
<xsl:with-param name="value" select="substring-after($value, '&#xA;')"/>
</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