This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl string comparison fails why?
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 25 Sep 2002 14:59:53 +0100
- Subject: Re: [xsl] xsl string comparison fails why?
- References: <1032961095.2884.52.camel@vectrag.localhost>
- Reply-to: xsl-list at lists dot mulberrytech dot com
<xsl:for-each select="admissions/state/text()">
<xsl:if test=".=$state">
<xsl:value-of select="."/>
so here you are iterating through each of teh text nodes of teh state
element. in the case of
<state>Alabama
<statelink
href="http://www.alabar.org/page.cfm?view=3&subgroup=main">
Bar Admissions Information</statelink>
</state>
there are two of those:
"Alabama
"
and
"
"
either side of the statelink element.
Neither of those is equal to "Alabama"
You want normalize-space() in there somewhere but I wonder if you really
mean to iterate through all th etext children of each state, or just
have one test for each state, something like
<xsl:for-each select="admissions/state">
<xsl:if test="normalize-space(text()[1])=$state">
<xsl:value-of select="$state"/>
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list