[xquery-talk] get-duration

Craig Stanton xquery at stanton.co.nz
Tue May 30 23:05:28 PDT 2006


Hello all,
	I am totally new to XQuery stuff and not surprisingly I have hit my  
first road block. I'm trying to manipulate some time date, that comes  
formatted like this "20060530212800". I've worked out a way to  
substring that into its constituent parts and then plastering them  
back like this "2006-05-30T21:28:00". Now that I have dateTime  
objects I'd like to work out the difference between them. I've found  
get-duration() but I can't work out how to use it in my query.

I thought I could declare a name space like this

declare namespace op ="http://www.w3.org/2001/12/xquery-operators";

And then use the function like this

let $dur := op:get-duration($startTime, $endTime)

But it complains about the function not being defined in this  
context. I've searched all over the web for what I am missing, but I  
can't find the right syntax. Can someone point out my (probably  
blindingly obvious) mistake?

Cheers,
	Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xquery.com/pipermail/talk/attachments/20060530/d4c00098/attachment.htm


More information about the talk mailing list