XSLT Tag - Cold Fusion XML XSL Resources
CFX_XSLT Tag Reference

CFX_XSLT Is a ColdFusion Java CFX tag for executing XSL Transformations. The tag takes either a string of XSL or a file pointing to XSL, and a string of XML or a file pointing to XML and applies the transformation.
All Attributes
Attribute Name Required Data Type Notes
XSL yes if XSLFILE is not specified string A string containing an XSL Style Sheet
XSLFILE yes if XSL is not specified file path A file containing an XSL Style Sheet
XML yes if XMLFILE is not specified string A string of XML content
XMLFILE yes if XML is not specified file path A file of XML content
OUTPUT no variable name The name of the output variable, default is CFX_XSLT.result


Install Instructions
CFX_XMLParser Install Instructions

If you are running Windows NT/2000 you should run Setup.exe ON YOUR WEB SERVER

If you are running any Other Platform please follow the instructions below...

1) Read And agree to License.txt

2) Copy CFX_XSLT.jar and xalan.jar to CFUSION/Java/Classes

3) Get a JVM, If you have not done so already goto http://java.sun.com/products/ and download the Java 2 Standard Edition JRE (Java Runtime Environment), install it.

4) Log into your ColdFusion Administrator, click on "Java" from the menu on the left.

5) If there is not already a value (There shouldn't be unless you already installed it) Enter the path to your Java Virtual Machine "JVM". The default on windows is c:\program files\JavaSoft\JRE\1.3\bin\hotspot\jvm.dll or /usr/java/jdk1.3/hotspot/libjvm.so

If you cannot find the locations try: Start -> Find -> jvm.dll (Windows)
$> find / | fgrep libjvm.so (UNIX)

6) In the classpath setting (Still in the Java Settings of CF Administrator) add the following value to the classpath c:\cfusion\java\classes\CFX_XSLT.jar;c:\cfusion\java\classes\xalan.jar;c:\cfusion\java\classes\xerces.jar; You only need to add xerces.jar if you have not already installed CFX_XMLParser

If there are other values in this setting, seperate with a semi-colin (;) for windows, and with a colin (:) for UNIX.

Click "Apply"

10) Click on "CFX Tags" from the left menu. Enter in CFX_XSLT in the text box, and select "Java" for tag type, click add.

11) Under Class Name put: CFX_XSLT and enter a description, the supplied description is "Java Based XSL Transformer by CFDEV.COM"

Click "Apply"

12) Restart ColdFusion.

See: ColdFusion Java Setting for linux for additional linux help.

XSLT Plugability Layer
The JAXP XSLT API allows developers to write API independent code to access XSLT Transformers. The CFX_XSLT tag is written entirely independed of the XSLT processor used (Apache Xalan is included with the tag) so that you can easily interchange processors. This is accomplished through the use of Abstract Factories, you can specify the TransformerFactory by changing the value of the Java System variable javax.xml.transform.TransformerFactory If you want to change from the xalan processor first remove xalan.jar from you class path. The environment variable can be set in several ways.
Typically XSLT vendors will include the property in the Jar file if you see a file inside the JAR called META-INF/services/javax.xml.transform.TransformerFactory then just add the JAR to your class path and your ready to go.
Another way is to create a file called lib/jaxp.properties that sits in the JVM home directory. Set the contents of the file to be equal to your TransformerFactory eg javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
And a third way is to put it in the ColdFusion Administrator under System Options.

Product Home Page: www.cfdev.com/xml ColdFusion XML XSL Resource Center
Copyright © CFDEV.COM 2001