On the weekend I stumbled over http://rosettacode.org website.
It presents solutions to the same task (currently 638) in as many different programming languages as possible,
It presents solutions to the same task (currently 638) in as many different programming languages as possible,
These are the "XSLT" related language categories (out of 487 !):
I read somewhere that matrix multiplication is not a problem normally needed to be be computed in a stylesheet.
While this may be true, it was one of the 638 current tasks without a XSLT solution:
So I did give it a try, and posted my pure XSLT 1.0 solution there:
http://rosettacode.org/wiki/Matrix_multiplication#XSLT_1.0
http://rosettacode.org/wiki/Matrix_multiplication#XSLT_1.0
You can try the solution in your browser, just open this XML input file and you get the matrix product displayed:
(do "View Page Source" to see both input matrices)
The solution can be reduced in number of lines of XSLT by using EXSLT functions.
But XSLT 1.0 processors xalan and xsltproc do have problems with <func:function ...>.
Besides DataPower XSLT processor (compiler) there is another XSLT 1.0 processor being able to process XSLT 1.0 + EXSLT.
But XSLT 1.0 processors xalan and xsltproc do have problems with <func:function ...>.
Besides DataPower XSLT processor (compiler) there is another XSLT 1.0 processor being able to process XSLT 1.0 + EXSLT.
It is a very old version of SAXON (version 6.5.5, download here), before SAXON became a XSLT 2.0 processor.
While saxon6.5.5 does not know about DataPower extension functions, it might be useful to process stylesheets without.
With this input file
saxon6.5.5 and DataPower both produce the matrix product:
This is stylesheet matmul.xsl being referenced by the input <?xmlstylesheet ...?> declaration allowing SAXON "a" parameter:
