student.xsl
- XSLT transformation file
StudentUtil.adjustName
- java method used in XSLT
input.xml
- input source
XsltTransformation
- class with main method
Journal
, Student
- java presentation of XML structure
mvn clean package
java -jar ./target/xslt-java-0.0.1-SNAPSHOT-jar-with-dependencies.jar
- Add
StudentUtil
compiled class to the classpath - Add
saxon.jar
to the classpath - You can use a jar file compiled by maven command
mvn clean package
java -cp "./target/xslt-java-0.0.1-SNAPSHOT-jar-with-dependencies.jar" net.sf.saxon.Transform ./src/main/resources/input.xml ./src/main/resources/student.xsl
Running JAVA inside the XSLT is possible only with Saxon-PE or Saxon-EE versions.
So you can buy a license or request a trial one at https://www.saxonica.com/download/download.xml
Received license file saxon-license.lic
put to the resources folder src/main/resources
For testing purposes you also may use Saxon version 9 but not from the official repository.
Check pom.xml
for more details.