This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: white space with word wrapping
- From: "J.Pietschmann" <j3322ptm at yahoo dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 26 Mar 2002 23:00:56 +0100
- Subject: Re: [xsl] white space with word wrapping
- References: <20020326185932.33954.qmail@web20606.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Jay Ron wrote:
> Hope someone will help!!!
Me too!
> The following is not doing the word wrapping. When I
> pass <cellValue> without the space translation then
> the word wrapping take place....
I can't see a reason why it should do word wrapping.
After all, non breaking spaces (the  ) are supposed
to prevent the formatter from breking text there (apart
from this, FOP renders them always as full width space)
BTW as far as i can tell your elaborate text_wrapper and
wrapper_helper construction is actually a no-op. The
purpose of the wrapper_helper template also isn't obvious
to me, you could just call text_wrapper directly.
I suppose you intended to have the wrapper templates
insert spaces or zero width spaces into the output?
J.Pietschmann
> <fo:table-cell padding="0.6pt" border="0.5pt solid
> black" column-number="1">
> <fo:block background-color="#FFFFCC"
> color="black" font-size="10pt" text-align="left"
> font-family="sans-serif">
> <xsl:variable name="cellValue"
> select="translate(cell1,' ',' ')"/>
> <xsl:call-template name="text_wrapper">
> <xsl:with-param name="Text" select="$cellValue"/>
> </xsl:call-template>
> </fo:block> </fo:table-cell>
>
>
> <xsl:template name="text_wrapper">
> <xsl:param name="Text"/>
> <xsl:choose>
> <xsl:when test="string-length($Text)">
> <xsl:value-of select="substring($Text,1,30)"/>
> <xsl:call-template name="wrapper_helper">
> <xsl:with-param name="Text"
> select="substring($Text,31)"/> </xsl:call-template>
> </xsl:when>
> <xsl:otherwise>
> </xsl:otherwise>
> </xsl:choose>
> </xsl:template>
>
> <xsl:template name="wrapper_helper">
> <xsl:param name="Text"/>
> <xsl:value-of select="substring($Text,1,30)"/>
> <xsl:call-template name="text_wrapper">
> <xsl:with-param name="Text"
> select="substring($Text,31)"/>
> </xsl:call-template>
> </xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list