0
votes

I installed Saxon in macOS 10.15 via home-brew. Now when I try

net.sf.saxon.Transform

I get

zsh: command not found: net.sf.saxon.Transform

What am I doing wrong?

thanks, geb

1
Don't know about Macs but usually you need Java and the run java -jar saxon9he.jar -xsl:sheet.xsl -s:input.xml - Martin Honnen
It might be that the home-brew installation allows you to shorten java -jar saxon9he.jar to simply saxon so try whether saxon -xsl:sheet.xsl -s:input.xml also works and post that as an answer if it does. - Martin Honnen

1 Answers

1
votes

@MartinHonnen has already answered in a comment, but for the record, the command required is

 java -jar saxon9he.jar -xsl:sheet.xsl -s:input.xml

Note that this form only works when you don't need anything else on the classpath (for example, a library holding extension functions). Also the JAR file name has changed with the release of 10.0. A more general form might be

java -cp saxon-he-10.0.jar:my-other.jar net.sf.saxon.Transform -xsl:sheet.xsl -s:input.xml

In the -cp option, JAR files are separated by ":" on Mac and Linux, or by ";" on Windows.