[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: Migrating XSLT (2.0) from appliance to Java?

Subject: Re: Re: Migrating XSLT (2.0) from appliance to Java?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 22 Aug 2023 12:30:55 -0000
Re:  Re: Migrating XSLT (2.0) from appliance to Java?
On 22.08.2023 14:22, ohaya ohaya@xxxxxxxxx wrote:

public class Main {

public static void main(String args[]) throws Exception {
StreamSource source = new StreamSource(args[0]);
StreamSource stylesource = new StreamSource(args[1]);

TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(stylesource);

StreamResult result = new StreamResult(System.out);
transformer.transform(source, result);


When I try to run the XSLT that we ended up with back in February
2023, I am getting an error:

"[root@dlwoas01 jl]# java Main X.xml X.xsl
ERROR: 'Could not compile stylesheet'
FATAL ERROR: 'Error checking type of the expression 'funcall(tokenize,
[step("self", -1), literal-expr(:)])'.'
:Error checking type of the expression 'funcall(tokenize,
[step("self", -1), literal-expr(:)])'.
I suspect/guess that the problem is that the Java 1.8 only supports
XSLT 1.0, but I don't know if it is allowable to ask about this type
of thing here in this list, so I wanted to ask that first?

You can use Saxon HE (currently supported latest versions are 11.5 and
12.3 (e.g.
https://github.com/Saxonica/Saxon-HE/releases/tag/SaxonHE12-3, also on
Maven) from Saxonica to have XSLT 3.0 (which supports all of XSLT 2, of
course) with Java. Putting Saxon on the classpath for your code above
should suffice.

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.