xsl-list
[Top] [All Lists]

Re: Problems matching end-of-line character

2005-08-10 14:45:26

    Why is the end-of-line in $var1 not visible?

because you are searching for a space not a newline.

                <xsl:if 
test="contains(exsl-common:node-set($var1)/a/text(),'&xa;')">

does what you want.

Most weeks someone on this list calls a numeric character reference an
entity reference, and I moan that it isn't an entity reference. This is
one of those times that makes a difference.
Newlines in attribute values are normalised to space by an xml parser
before xlslt starts, character references hide the newline so it doesn't
get normalised, but entity expansion happens before normalisation, so
your EOL expands tp a newline character (not a character reference)
and then gets normalised to a space. So by the time xslt starts the
second argument to your contains() function is a space.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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