XSLT Transformation Not Applying When Using Saxon-HE with Java - Unexpected Output
I'm upgrading from an older version and I've tried everything I can think of but I'm currently trying to apply an XSLT transformation using Saxon-HE 10.6 in Java, but I'm working with an unexpected output where the transformation doesn't seem to take effect... My XML document is well-formed, but the output does not reflect the expected transformation as defined in my XSLT. Here's the relevant portion of my code: ```java import net.sf.saxon.s9api.*; public class XSLTTransformer { public static void main(String[] args) { try { Processor processor = new Processor(false); XsltCompiler compiler = processor.newXsltCompiler(); XsltExecutable executable = compiler.compile(new StreamSource("stylesheet.xsl")); XsltTransformer transformer = executable.load(); transformer.setSource(new StreamSource("input.xml")); transformer.setDestination(new Serializer(System.out)); transformer.transform(); } catch (SaxonApiException e) { e.printStackTrace(); } } } ``` The XSLT stylesheet is relatively straightforward, designed to map elements from the input XML to a new structure. However, the output I receive is just the original XML without any transformations applied. I checked the console for exceptions, but there are none indicating a failure in the transformation process. I’ve tried simplifying the XSLT to just copy the root element, but I still get the same output. Additionally, I confirmed that the file paths for both the XML and XSLT are correct and accessible. Is there something I might be missing in the setup, or could it be a configuration scenario with Saxon? Any assistance would be greatly appreciated. Thanks for taking the time to read this! This is happening in both development and production on CentOS. I'd really appreciate any guidance on this.