For those, who are interested in solution.
Seems like, at least to me, that Calc do not provide “out of the box” solution to work with XSLT 2.0. While creating new XML Filter, it is possible to check option The filter needs XSLT 2.0 processor
, but it is not just enough to proceed with XSLT 2.0. In fact, enabling this option only tells Calc that transformation file has some XSLT 2.0 specific contents, which native Calc instruments can not handle anyway.
Luckily, there is an xslt2-transformer extension, which can provide the functionality needed. But, while Install Instructions calmly state that all we need to do is just to download extension and add downloaded OXT file via Extension Manager
, a bit of nightmare for common Windows user begins. The extension page offers some kind of a quest “try to find download link”, which leads to the github project page with extension’s source code. But, there is no desired .OXT
file though, only some “no-extension” and text files. “Hello, big real world!” and congrats, we just made our first step out of the Windows sandbox.
Remark, many thanks to @mikekaganski. New xslt2-transformer release now comes with prebuilt and ready to use xslt2-transformer.oxt
file, so for the most Windows OS users there is no need for these woodoo’ish things mentioned below anymore. Those, who are interested in building extension by themselves for educational or any other reason, are welcome to read further.
Before we can use this extension, we need to build it, literally. In the real world, to rise a building, you need materials, blueprints and workers. To build an extension, you need the source code (aka materials), makefile, which defines how building shall proceed (aka blueprint) and environment, which is capable and knows how to use makefile and to actually execute building procedure (aka workers). Ok, we have downloaded the source code, makefile is inside, what about an environment for Windows OS? I used Cygwin, probably CMake and Visual Studio can handle it too. As for Cygwin, zip
extension shall be installed in order to run makefile successfully. Cygwin installation instructions.
Before building extension, slight adjustment shall be made in Makefile, open it with any text editor and change XCLASSPATH := external/saxon9.jar:$(CLASSPATH)
line to XCLASSPATH := external/saxon9.jar;C:/Path/to/LO/installation/LibreOffice/program/classes/*$(CLASSPATH)
Adjust the link according to your LO path. After Cygwin is installed, run Cygwin Terminal, navigate to folder, where xslt2-transformer
extension is downloaded (type cd c:/path/to/folder
) and type make
.
Possible error can be in jar -cfm
instruction on line 30 of a makefile. Cygwin adds /cygdrive/
prefix to absolute path, which points to non existing location and results in incorrect path for instruction. If so, just hardcode path in this line jar -cfm C:/path/to/extension/xslt2-transformer-master/build/ext/xslt2-transformer.jar C:/path/to/extension/xslt2-transformer-master/Manifest com
If the building completes successfully, you will find newly created build
folder in the extension’s directory and desired xslt2-transformer.oxt
file inside.
All to do left is to navigate to Tools -> Extension Manager
, add xslt2-transformer.oxt
file and voila. Now Calc is capable to handle XSLT 2.0 specific content. Worth noting, extension needs Java/JRE to be installed on your machine (once again, thanks to @mikekaganski for pointing out)
P.S> Probably, using and adjusting makefiles, compiling and building from sources is an easy daily routine, for me as windows-only user it was the path of learning and struggling.