Am Thu, 21 Jan 2010 12:01:45 +0100 schrieb Christian GrĂ¼n christian.gruen@gmail.com:
Hi Christian,
thanks for your interest!
An interesting one.. Could you provide us with a complete example (incl. a sample XML snippet) which demonstrates the behaviour? I just tried a small example query, which seems to be correctly evaluated by the XQJ API..
result = loadExp.executeQuery("for $i in (3,2,1) order by $i
return $i"); while(result.next()) { System.out.println(result.getInt()); }
I debugged my own implementation again and found that the "order by" problem is not caused by BaseX (XQJ), but was my own fault.
To put in a nutshell, the resulting XML is given to an JAXB unmarshaller, who unmarshals the XML to Java objects. The content is described as a Java Collection, but it seems that JAXB doesn't (?) care about the order in the the generated Collection. When I get the result Sequence as a String, the ordering is correct.
So there is no problem with ordering in BaseX (XQJ) at all ;-)
Bye, Marcus