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
xquery math: functions in oxygen editor
-
- Posts: 4144
- Joined: Fri Mar 28, 2003 2:12 pm
Re: xquery math: functions in oxygen editor
Hello,
Saxon has a limited set of mathematical functions available for XQuery processing. Please look at the following example of using the sin function:
Regards,
Sorin
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
-
- Posts: 6
- Joined: Thu Dec 01, 2011 6:44 pm
Re: xquery math: functions in oxygen editor
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
};
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
};
Re: xquery math: functions in oxygen editor
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.
You can test it in the XPath toolbar.
http://www.w3.org/TR/xslt-30/
Best Regards,
Andy.