1

I developed a set of XSLT-2.0 XML-to-XML transforms with Oxygen that include some simple xsl:functions. Now, I wish to run some functions on the nodes that are beyond what xsl:functions can reasonably do. To be more precise, I want to call an xsl:function extension in python that calls path-algorithms from the Python networkx library on node-sets.

Here's the problem:

How to get Python to run XSLT-2.0 transforms and call extension functions written in Python ?

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
  • If modules are not available, have Python call installed [external processors](https://stackoverflow.com/tags/xslt/info) with `subprocess` that can run XSLT 2.0. – Parfait Sep 26 '20 at 17:17
  • 2
    In Saxon/C we support user defined functions written in C++ and PHP, but it is not yet available for the python extension. I did look at this feature for Saxon/C 1.2 release, but it was not possible to include it at the time. We will look at implementing this feature request again for the next release. – ond1 Sep 27 '20 at 05:23
  • @ond1 it was surprising to note support for C++ and PHP but not Python, given the growing importance of the latter. I'm looking forward to support for Python UDF's lest I can unleash the imperative and declarative powers of Python and XPath/XSLT respectively. Meanwhile, I'm considering calling UDFs from a java library using a saxon pe to do the heavy lifting as a workaround. – sixdiamants Sep 27 '20 at 15:57
  • 1
    For many years Saxon/C supported only C++ and PHP languages. But in the last release we now provide a python extension. – ond1 Sep 27 '20 at 16:07

0 Answers0