Here is my xml template:
<xsl:template name="paragraphs"> <xsl:param name="class" /> <xsl:param name="text" /> <xsl:choose> <xsl:when test="contains($text,' ')"> <xsl:if test="string-length(substring-before($text,' ')) > 0"><p class="{$class}"><xsl:value-of select="substring-before($text,' ')" /></p></xsl:if> <xsl:call-template name="paragraphs"><xsl:with-param name="class" select="$class" /><xsl:with-param name="text" select="substring-after($text,' ')" /></xsl:call-te$ </xsl:when> <xsl:otherwise><p class="{$class}"><xsl:value-of select="$text" /></p></xsl:otherwise> </xsl:choose> </xsl:template> Here is how I am using it in the xsl stylesheet
<xsl:call-template name="paragraphs"><xsl:with-param name="text" select="./comment" /></xsl:call-template> Now I need to convert the template into javascript. I honestly don't know how to do this.
I'd love some assistance on this.
No comments:
Post a Comment