Although easy to use, 4sg.xsl not a "point-and-click"-solution. There is no XML data file user interface. It must be edited with an editor like Notepad ++ (notepad-plus-plus.org, free) or XMLSpy (www.altova.com/xmlspy-xml-editor, commercial). The easiest attempt is to adapt an existing example.
Just download 4sg.html file or use it live on GitHub Pages. Select the XML data file to generate a SVG sankey diagram from. To use a XML example file you will have to download it in either case.
To run the XSLT script a processor that masters XSLT 3.0 is required. There are two of them: Saxon HE (www.saxonica.com, for Java or .NET, hosted free at Sourceforge, the commercial PE or EE version isn't required) and XMLSpy (www.altova.com/xmlspy-xml-editor, commercial). The script has been tested with both.
Because both the data source and the SVG target are each an XML file, XSLT is ideal as a tool for transformation. This language was designed for transforming XML files and is written in XML format itself. XSLT is a W3C standard, too.
With XMLSpy, the transformation for the displayed XML file is started by pressing the F10 key. The script file 4sg.xsl must be accessible for XMLSpy, ideally in the same directory. XMLSpy supports XSLT 3.0 since version 2018 to the extent required.
The easiest way to transform with Saxon is using a batch file, because Saxon is a command line tool. Saxon supports XSLT 3.0 since version 9.8. The program call differs for the .NET and Java version of Saxon.
The batch file for Saxon Java Saxon Java looks like this:
java net.sf.saxon.Transform -s:SimpleExample.xml -xsl:4sg.xsl -o:SimpleExample.svg
This batch file is used for Saxon .NET (which is no longer free):
Transform -s:SimpleExample.xml -xsl:4sg.xsl -o:SimpleExample.svg
The parameters have the following meaning:
-s = source file
-xsl = script file
-o = output file
The installation path must be accessible or be specified at the beginning of the command line. „SimpleExample.xml‟ is used here as the data file name.