Re: fn:substring test case difference: SAXON vs EXIST
Pierrick Brihaye <pierrick.brihaye <at> free.fr>
2006-08-01 18:48:25 GMT
Hi,
Jonas Lundberg a écrit :
> I believe that the Saxon output is the correct one here (although I am
> not sure).
Do you yhink the 100% XQTS compliant XQuery processor could be wrong ?
Well, my current version is patched with the enclosed patch. It works in
your case. Not sure it does for every one though ; this function is
trickier than it looks like at first glance.
Cheers,
p.b.
Index: C:/eclipse/workspace/eXist-svn/src/org/exist/xquery/functions/FunSubstring.java
===================================================================
---
C:/eclipse/workspace/eXist-svn/src/org/exist/xquery/functions/FunSubstring.java (revision 3938)
+++
C:/eclipse/workspace/eXist-svn/src/org/exist/xquery/functions/FunSubstring.java (working copy)
<at> <at> -120,7 +120,7 <at> <at>
if (lengthValue.isNaN())
result = StringValue.EMPTY_STRING;
else if (((NumericValue)lengthValue.plus(startValue)).isInfinite() ||
- ((NumericValue)lengthValue.plus(startValue)).getInt() >= string.length()) {
+ ((NumericValue)lengthValue.plus(startValue)).getInt() > string.length()) {
if (start < 0)
start = 0;
result = new StringValue(string.substring(start));
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open