Is op:divide-dayTimeDuration function implemented?
Sunday, 16 January 2011 · 3 messages
JC
Jan Vlčinský (CAD)16 Jan 2011 13:08 #
Hi
I am trying to use function op:divide-dayTimeDuration as declared at http://www.w3.org/TR/xquery-operators/#func-divide-dayTimeDuration <http://www.w3.org/TR/xquery-operators/#func-divide-dayTimeDuration>BaseX tells me either unknown namespace op, or unknown function.
Is this supported by BaseX, or I shall find my own implementation written in XQuery?
Jan
CG
Christian Grün16 Jan 2011 13:16 #
Hi Jan,
all XQuery functions which use the "op" prefix are part of other XQuery expressions and cannot be explicitly called. In your example, you can use the "div" operator to get the expected result. Example:
xs:dayTimeDuration("P1DT2H30M10.5S") div 1.5Hope this helps,
Christian
Quoted text · Jan Vlčinský (CAD) · 16 lines
On Sun, Jan 16, 2011 at 1:08 PM, Jan Vlčinský (CAD) <jan.vlcinsky at cad-programs.com> wrote: > Hi > I am trying to use function op:divide-dayTimeDuration as declared > at http://www.w3.org/TR/xquery-operators/#func-divide-dayTimeDuration > BaseX tells me either unknown namespace op, or unknown function. > Is this supported by BaseX, or I shall find my own implementation written in > XQuery? > Jan > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
JC
Jan Vlčinský (CAD)16 Jan 2011 13:24 #
Thanks Christian
Meantime (quite short one) I found the answer
let $tsta := xs:dateTime("2011-01-15T12:00:00Z")
let $tsto := xs:dateTime("2011-01-17T14:40:00Z")
let $dur := $tsto - $tsta
return $dur div 2And as usual, you were faster in reaction, then I.
Have a nice Sunday.
Jan
2011/1/16 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 31 lines
> Hi Jan, > > all XQuery functions which use the "op" prefix are part of other > XQuery expressions and cannot be explicitly called. In your example, > you can use the "div" operator to get the expected result. Example: > > xs:dayTimeDuration("P1DT2H30M10.5S") div 1.5 > > Hope this helps, > Christian > > > > On Sun, Jan 16, 2011 at 1:08 PM, Jan Vlčinský (CAD) > <jan.vlcinsky at cad-programs.com> wrote: > > Hi > > I am trying to use function op:divide-dayTimeDuration as declared > > at http://www.w3.org/TR/xquery-operators/#func-divide-dayTimeDuration > > BaseX tells me either unknown namespace op, or unknown function. > > Is this supported by BaseX, or I shall find my own implementation written > in > > XQuery? > > Jan > > > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > > > >
--
*Ing. Jan Vlčinský*
CAD programy
Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic
tel: +420-597 602 024; mob: +420-608 979 040
skype: janvlcinsky; GoogleTalk: jan.vlcinsky at gmail.com
http://cz.linkedin.com/in/vlcinsky
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery