xsl-list
[Top] [All Lists]

Re: Re: [xsl] Create word elements from a string

2009-10-29 04:45:10
On Thu, Oct 29, 2009 at 12:28 PM, Larry Hayashi <lhtrees(_at_)gmail(_dot_)com> 
wrote:
I did run into a problem with:

<xsl:when test="contains($str, ' ')">

The test always returns true even when I only have one word in the
text. I don't particularly understand why, but when I change it to
this, everything works fine:

<xsl:when test="contains(normalize-space($str), ' ')">

Did you run this modified syntax, with the same input you specified
earlier (i.e, <text>Jill ran up the hill.</text>)?
If your input was this (i.e, text node within <text> as mentioned
above), then I think normalize-space is not needed.

Why does it return true when normalize-space is not there? I would
think with only one word, there wouldn't be any spaces.

If you can post the input with which, you ran your stylesheet it would
be helpful to find an answer to your question. It would also be
helpful, if you mention the XSLT engine you are using.



-- 
Regards,
Mukul Gandhi

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