xquery math: functions in oxygen editor

Issues related to W3C XQuery.
cmcenearney
Posts: 6

xquery math: functions in oxygen editor

Thu Dec 01, 2011 7:09 pm

Hi,
Does anyone know how to use math: functions in Editor?

I've got Saxon-EE checked, along with "Enable Xquery 1.1 support" but no luck.

Running XML Editor 12.2, build 2011053115

Many thanks,
Colin
sorin_ristache
Posts: 4144

Re: xquery math: functions in oxygen editor

Mon Dec 05, 2011 6:18 pm

Hello,

Saxon has a limited set of mathematical functions available for XQuery processing. Please look at the following example of using the sin function:

Code: Select all

xquery version "1.0";
declare namespace math="http://www.w3.org/2005/xpath-functions/math";
<test>
   {math:sin(1)}
</test>



Regards,
Sorin
cmcenearney
Posts: 6

Re: xquery math: functions in oxygen editor

Mon Dec 05, 2011 6:53 pm

Thanks!

I was hoping to use math:pow, so that's too bad, but great to know about this resource.

And I guess creating a function for this is good for my brain anyway.

declare function local:exponentiate
($base as xs:double?, $power as xs:double?) as xs:double?
{
if ($power gt 1)
then $base * (local:exponentiate(($base),($power - 1)))
else $base
};
wvision70
Posts: 1

Re: xquery math: functions in oxygen editor

Thu Jan 24, 2013 9:59 pm

For the records : finally with XPath 3.0 the math:pow(x,n) function is supported in Oxygen using the Saxon 9.4 processor, as well as other trig math functions.

You can test it in the XPath toolbar.

http://www.w3.org/TR/xslt-30/

Best Regards,
Andy.

Return to “XQuery”

Who is online

Users browsing this forum: No registered users and 0 guests