Re: [bdbxml] order by date

John Snelson <[email protected]> Tue, 09 Aug 2005 16:57:09 +0100
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
sarigiannis xaralampos wrote:
> declare function local:lalas($x as element()*) as element()*{ for $y  
> in  $x order by $y/date   ascending return
> 
> The strange is that the ordering is not made correctly .I tried the same 
> syntax to XmlSpy and it worked correctly .
> 
>  I attach the file over which the query is executed . Any suggestions 
> about what to change or what I do wrong ????

DB XML does not currently support schema typing of XML documents, so you 
will have to cast the "$y/date" clause to the correct type for it to 
sort it correctly:

for $y in $x order by xs:dateTime($y/date) ascending return $y

John

-- 
John Snelson, Berkeley DB XML Engineer
Sleepycat Software, Inc
http://www.sleepycat.com

Contracted to Sleepycat through Parthenon Computing Ltd
http://blog.parthcomp.com/dbxml


------------------------------------------
To remove yourself from this list, send an
email to [email protected]