FastStringBuffer type comparison error

nzblue_fish
nzblue_fish's picture
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 09/30/2009
Points: 1165

Hi mashers,

If you are doing a lot of work that involves using XPath sequences in your emml, watch out for a string type comparison error that you might get when say using <if> to compare a value in a sequence with a string literal.

I've been doing a bit of work using sequences and had this error come up a couple of times recently: Cannot compare java:net.sf.saxon.om.FastStringBuffer to xs:string when doing something like this in a script:

<if condition="$fieldNameSeq[1] =''">

It's easy to get around and if you are coding for safety you might want to cast the sequence item as a string before doing the comparison (e.g. <if condition="xs:string($fieldNameSeq[1]) =''"> )

Cheers,

Innes

 

0
Your rating: None