[xsl] Linefeed-treatment in fop 0.20.4

Subject: [xsl] Linefeed-treatment in fop 0.20.4
From: RShonk@xxxxxxxxxxxxx
Date: Tue, 19 Nov 2002 16:12:04 -0500
Can anyone tell me if there is an easier way to do this? My NOTE_TEXT node
is returned from an Oracle blob object which contains line-feed characters
and is multi-line. When rendering the linefeed '\n' was ignored and
everything ended up on one line. I tried to use linefeed-treatment and
white-space-treatment = "preserve", but these are not yet implemented in
fop 0.20.4
Here is the xslt workaround I came up with to get the multiline results I
was looking for, but there has got to be an easier way.

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"

--- trimmed header / fo:table nodes ---

                <xsl:apply-templates select="NOTE_TEXT">
                  <xsl:with-param name="noteToken" select

<xsl:template match="NOTE_TEXT">
  <xsl:param name="noteToken"/>
  <xsl:call-template name="note.loop">
    <xsl:with-param name="i" select="1"/>
    <xsl:with-param name="noteMax" select="Token:countTokens($noteToken)"/>
    <xsl:with-param name="noteToken" select="$noteToken"/>

<xsl:template name="note.loop">
  <xsl:param name="i"/>
  <xsl:param name="noteMax"/>
  <xsl:param name="noteToken"/>
  <xsl:if test="$i &lt;= $noteMax">
      <xsl:value-of select="Token:nextToken($noteToken)"/>
    <xsl:if test="$i &lt; $noteMax">
      <xsl:call-template name="note.loop">
        <xsl:with-param name="i" select="$i + 1"/>
        <xsl:with-param name="noteMax" select="$noteMax"/>
        <xsl:with-param name="noteToken" select="$noteToken"/>

Thanks in advance,
Richard Shonk
Flowserve Corp.
Programmer / Analyst
Parts Distribution Center
Moosic, Pa.
(570) 451-2225

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread