This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: String comparisons fail unexpectedly: how can 'USA' not be 'USA'?
- From: TSchutzerWeissmann at uk dot imshealth dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 27 Feb 2002 14:26:46 -0000
- Subject: RE: [xsl] String comparisons fail unexpectedly: how can 'USA' not be 'USA'?
- Reply-to: xsl-list at lists dot mulberrytech dot com
>ouch......
Thanks for your sympathy! In the end, I have had to use this:
<xsl:variable name="current" select="."/>
<xsl:for-each select="$contacts/TR">
<xsl:variable name="corp"
select="./TD[5]/FONT/text()"/>
<xsl:variable name="cty"
select="./TD[3]/FONT/text()"/>
<xsl:apply-templates
select="$current/Corporation[@code=$corp]/Access[contains(Billcodes/Billcode
/@Country, $cty)]/Panels">
...
which is horrid.
Is there a way of using keys instead? I haven't had much luck with keys even
though previously they've been fine. For example, the Corporation/@code
doesn't have any problem with leading space so I tried this:
<xsl:key name="cc" match="Corporation" use="@code"/> #before the first
template
and replace the apply-templates above with
xsl:apply-templates
select="key('cc',$corp)/Access[contains(Billcodes/Billcode/@Country,
$cty)]/Panels"/>
and it broke, ie, no templates were applied past this one. what's going
wrong?
Thanks for your help,
TOm
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list