People have indeed used the extension functions that vendors provide (such as functions in java: namespace)
I have seen people write xslt functions and embed them.
The cleanest way is to use a simple web service. E.g
document(" http://localhost/maths?get-sin=0.6")
returning a single element with the result. More appealing if the calculations are complex or cacheable of course. That is cross platform.
For assertion purposes, it may be that rather than testing
sin(X) > 0.5
it might better to test with arcsin 0.5
X > -30 and X < 30
or whatever. Do the lookup at coding time.
cheers
Rick
Hi Folks,
Suppose my Schematron assertions need to do some math calculations – cosine, sine, tangent, etc.
I am using XPath 2.0 in my Schematron assertions. But XPath 2.0 doesn’t support functions for cosine, sine, tangent, etc.
What is the recommended way to extend Schematron?
/Roger