This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Line Numbering


->-----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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]