19

I am using two different versions of ColdFusion, ColdFusion 9 and ColdFusion 10, and there are different XSLT Processors in both.

ColdFusion 9 is using Apache Xalan while ColdFusion 10 is using Saxon.

So, is it possible to change the XSLT Processor?

Or

Can we use javax.xml.transform.TransformerFactory class to switch to different processor?

Miguel-F
  • 13,450
  • 6
  • 38
  • 63
Abhishekh Gupta
  • 6,206
  • 4
  • 18
  • 46
  • 10
    I think you answered your own question. I found reference in the ColdFusion 10 release notes that you can use `-Djavax.xml.transform.TransformerFactory=` to specify the parser to use. It is under known issue number 3167776 on [the release notes page](https://helpx.adobe.com/coldfusion/release-note/coldfusion-10-release-notes.html). It mentions for use with WebLogic but I don't know why it wouldn't work for other platforms. – Miguel-F May 14 '15 at 14:26
  • 1
    I think Miguel's answer should have been an answer. But a warning to anybody finding this question : Saxon 9 which ships with ColdFusion 10 is broken under java 1.8. Fixed with [Saxon 9.5](https://saxonica.plan.io/issues/1944#note-3) – andrew lorien Oct 05 '17 at 06:44

1 Answers1

1

You can exchange (also in coldfusion) the XSLT processor implementation by setting the following property:

javax.xml.transform.TransformerFactory=qualified.name.of.TransformerFactoryImpl

... e.g. via (-D) JVM Parameter.

TransformerFactory Javadoc:

... The system property that determines which Factory implementation to create is named javax.xml.transform.TransformerFactory. This property names a concrete subclass of the TransformerFactory abstract class. If the property is not defined, a platform default is be used.

xerx593
  • 12,237
  • 5
  • 33
  • 64