From: Pierrick B. <pie...@fr...> - 2007-11-12 07:07:05
|
Hi, Alister Pillow a écrit : > I've had a look at the XQTS tests for string-join. They look > surprisingly useless! Yes :-) That's why we haven't spotted the issue. I suggest to replace the code in org.exist.query.functions.FunStringJoin by something like this : String sep = args[1].getStringValue(); if(sep.length() == 0) sep = null; StringBuffer out = new StringBuffer(); Item next; boolean gotOne = false; for(SequenceIterator i = args[0].iterate(); i.hasNext(); ) { next = i.nextItem(); if(gotOne && sep != null) out.append(sep); out.append(next.getStringValue()); gotOne = true; } (not even sure we should nullify sep). I will commit this tonight, after running the test suite. Cheers, p.b. |