RE: [xsl] String-length of substring-before is giving me wrong number

Subject: RE: [xsl] String-length of substring-before is giving me wrong number
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 1 Aug 2007 22:52:32 +0100
> Sorry, stupid question, but what is the best way make it 
> case-insensitive?

No easy way in XSLT 1.0. You can use the translate($x, 'abc...', 'ABC...')
trick for matching, but not for substring-before if you want the answer to
retain the original case.

Switch to XSLT 2.0 and the world is your oyster. You can then use
replace($in, '(^.*)xxx', '$1', 'i'),
or you can use substring-before with a case-blind collation if your vendor
offers one (Saxon does, of course).

Michael Kay
http://www.saxonica.com/

Current Thread