This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Line Numbering
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Line Numbering
- From: "Spychalski, Frank" <frank dot spychalski at sap dot com>
- Date: Mon, 14 Aug 2000 22:13:56 +0200
- Reply-To: xsl-list at mulberrytech dot com
->-----Original Message-----
->From: Darrin Bishop [mailto:dbishop@legis.state.il.us]
->Subject: Line Numbering
Hi,
->I know that xml is not about formatting, but I need to
->transform some xml
->to html that will allow me to put sixty charecters on a line
->and then break.
->I have not seen any discussion on this nor is there anything
->in the archives
->that I could find. Is this not possible with xslt? I have XSLT
->Programmer's Reference but can not seem to get going in the
->right direction.
yes, it is possible. Use recursion:
<xsl:template name="out">
<xsl:param name="text"/>
...
<xsl:value-of select="substring ($text, 1,60)"/>
...
<xsl:if test="substring($text,61) != ''">
<xsl:call-template name="out">
<xsl:with-param name="text">
<xsl:value-of select="substring($text,61)"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
I didn't test it, but it should work :-)
bye
Frank
-
Frank Spychalski
Research Engineer
SAP Labs, Palo Alto frank.spychalski@sap.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list