This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

String comparisons fail unexpectedly: how can 'USA' not be 'USA'?


Dear list,

this is very frustrating! I want to pull out lots of records from a data
source using a list. The data source has records that look like this:
<Billcode corp="EvilEmpire" country="USA">

and the list is an html table with rows like this:

<tr><td>EvilEmpire</td><td>USA</td></tr>

Initially I tried using a key with use="concat(@corp,'::',@country)" but no
joy, after a lot of trying things out very patiently or not so patiently I
tried this:

<xsl:value-of select="Billcode[2]/@country"/>
<xsl:value-of select="'USA'=Billcode[2]/@country"/>

and got, to my surprise, "USAfalse".

There must be something important I don't know about string comparisons!

I've tried wrapping things in string( )s but to no avail. 
Any help much appreciated,

Tom SW

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]