Is op:divide-dayTimeDuration function implemented?
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
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 > >
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 > > > > >
Written for BaseX 6. BaseX may have changed since: please check the current documentation.