Subject: [xsl] text string handling or wrap From: "ajay sinha" <sinhajay@xxxxxxxxxxx> Date: Tue, 08 Jan 2002 14:39:19 |
<xsl:template name="textwrap"> <xsl:param name="Text"/> <xsl:value-of select="substring($Text, 1, 30)"/> <br></br> <xsl:variable name="rest" select="substring($Text, 31)" /> <xsl:if test="string-length($rest) > 30"> <xsl:call-template name="textwrap"> <xsl:with-param name="Text" select="$rest" /> </xsl:call-template> </xsl:if>
<xsl:template name="textwrap"> <xsl:param name="Text"/> <xsl:variable name="linelen" select="30"/>
<xsl:choose> <xsl:when test="string-length($Text) > 30"> <xsl:value-of select="substring(Text, 1, 30)"/>
<xsl:call-template name="textwrap"> <xsl:with-param name="Text" select="substring($Text, 31)"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$Text"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="textwrapzz"> <xsl:param name="Text"/> <xsl:choose> <xsl:when test="$Text!=''"> <xsl:choose> <xsl:when test="string-length($Text) > 30"> <xsl:value-of select="substring(Text, 1, 30)"/> <br></br> <xsl:variable name="rest" select="substring(Text, 31)"/> <xsl:call-template name="textwrap"> <xsl:with-param name="Text" select="$rest"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$Text"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:value-of select="$Text"/> </xsl:otherwise> </xsl:choose> </xsl:template>
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] text() and not(), Joerg Pietschmann | Thread | RE: [xsl] text string handling or w, Andrew Welch |
Re: [xsl] How to know if an attribu, Joerg Heinicke | Date | Re: Regular expression functions (W, Jeni Tennison |
Month |