This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xsl string comparison fails why?
- From: "Brinkman, Theodore" <Theodore dot Brinkman at standardregister dot com>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 25 Sep 2002 13:22:55 -0400
- Subject: RE: [xsl] xsl string comparison fails why?
- Reply-to: xsl-list at lists dot mulberrytech dot com
But wouldn't "Virginia" match "West Virginia" with with contains(.,$state)?
-----Original Message-----
From: Passin, Tom [mailto:tpassin@mitretek.org]
Sent: Wednesday, September 25, 2002 12:49 PM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] xsl string comparison fails why?
[ Yates, Danny]
> For the first state (Alabama), "admissions/state/text()"
> evaluates to something like:
>
> Alabama<cr><space><space><cr><space><space>
>
> Which is NOT the same as:
>
> Alabama
>
> You can solve this either by using normalize-space() or by
> changing your <state> elements so that they don't use a mixed
> content model (i.e. containing both text and other elements). e.g.:
>
Actually, even nomalize-space() does not quite do it because it
collapses all the whitespace down to one space, resulting in
Alabama<space>
This still won't match "Alabama", but
contains(.,$state)
will work.
After that, as Mike and Danny say, some redesign will probably be a good
idea, either of the source or the stylesheet.
Cheers,
Tom P
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list