xsl-list
[Top] [All Lists]

tokenize() for text wrap

2005-02-10 08:50:22
Hello XSL list,

I'm just trying an idea for text wrapping when transforming XML to SVG.

Inside a named template to which a long string of non-marked up text
($text) and some other bits and pieces is passed I have the following
for-each:

<xsl:for-each select="tokenize($text, '.{30,}?\s+')">
    <tspan dy="{...}">
        <xsl:value-of select="." />
    </tspan>
</xsl:for-each>

The idea is that it splits the $text string up at the first space after
30 characters (this number is actually a variable in the real thing) and
then formats each token as a tspan element. The output, however,
contains the correct number of tspan elements (which also have the
correct 'dy' attributes) but all but the last one is empty. (I think the
text in the last one is the correct, though).

(I'm working with Saxon 8.2B; I've tried different combinations of
$flags for the tokenize() function but the result is always the same)

Any ideas what might be wrong with it?

Cheers,
Richard

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>