Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xsl:apply-templates select="content" mode="replace-bbcodes" />
- <xsl:template match="text()" mode="replace-bbcodes">
- <xsl:value-of select="." />
- </xsl:template>
- <xsl:template match="br" mode="replace-bbcodes">
- <br />
- </xsl:template>
- <xsl:template match="bbcode" mode="replace-bbcodes">
- <xsl:choose>
- <xsl:when test="@type='bold'">
- <strong><xsl:value-of select="text()" /></strong>
- </xsl:when>
- <xsl:when test="@type='url'">
- <xsl:variable name="link" select="@link" />
- <a href="{$link}"><xsl:value-of select="text()" /></a>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="text()" /></xsl:otherwise>
- </xsl:choose>
- </xsl:template>
Add Comment
Please, Sign In to add comment