On 2013-01-24 13:49, David Rudel wrote:
> Hi All,
> I have benefited greatly from the members in the XSL/Saxon communities,
> and I would like to contribute myself.
> I have recently worked up a primitive collection of functions designed
> to allow XSL to do vector analysis and linear algebra. It handles things
> like finding projections onto linear subspaces, cofactors, adjoints,
> determinants, and minors. It can also invert matrices and solve systems.
> I have in conjunction written up an implementation of a solver for doing
> robust non-linear regression for a data set. Notably, some dedicated
> statistical analysis software (e.g., R) does not have this capability.
> All of the above is written in XSL (i.e., not java). So "extension" is
> probably the wrong word to use for this, but I do think it is something
> that other people using XSL might find useful.
That sounds interesting!
When I tried to do some statistical analysis in XSLT (for hundreds of
stylesheets, calculating correlation coefficients for element names and
text() in matching patterns vs. the occurrence of certain namespace URIs
in these stylesheets), I ran into serious performance issues and
therefore never published the functions and templates that I wrote.
If I was serious about it, I’d rather use R or Julia than XSLT.
OTOH, if I had the time now, I’d switch over to XSLT 3 maps
(http://www.w3.org/TR/xslt-30/#map) instead of XML structures to
represent matrices. That might speed up things enormously, because,
among other things, numerical values don’t have to be cast to double
from text nodes / attribute values in intermediate XML structures.
Apart from the aforementioned maps, XSLT 3 has try/catch:
> I'm writing to ask two questions:
> A. Is there a way within XSL to communicate an error to someone running
> a script? For example, if someone tries to find the determinant of a
> non-square matrix, it would be nice to be able to communicate what type
> of error occurred.
And I’m almost sure that function objects, fold-left() et al.
might be nice for your library.
So I’d go for XSLT/Xpath 3 full throttle. Or maintain two versions, in
order to demonstrate how beautiful a language XSLT/XPath 3 has become,
even in comparison to the already-mostly-ok XSLT/XPath 2.
I’d go for github or Google code, so that others can submit bug reports,
> B. Once I have these written up for public consumption, what would be
> the best way to share them? Would it be possible to have them added to
> the EXSL project?
pull requests, and feedback.
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
saxon-help mailing list archived at http://saxon.markmail.org/