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

run time error "TransformerFactoryConfigurationError"

Subject: run time error "TransformerFactoryConfigurationError"
From: Yongxia Yan <yyan@xxxxxxxxx>
Date: Thu, 25 Mar 2004 10:20:14 -0700
transformerfactoryconfigurationerror
All,

I am newbie to xml and tried to run the examples on apache site. I installed the following jars to my box:
xalan.jar/xml-apis.jar/xercesImpl.jar and set my classpath according. The compile is ok, but got a run time error.

Any idea?

Thanks.

Yongxia

-----------------------------------------------------------------Error-------------------------------------------------

Exception in thread "main" javax.xml.transform.TransformerFactoryConfigurationError: Provider
org.apache.xalan.xsltc.trax.TransformerFactoryImpl not found
        at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:100)
        at JAXPTransletMultipleTransformations.main(JAXPTransletMultipleTransformations.java:71)



-----------------------------------------------------------------Code-------------------------------------------------
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import java.util.Properties;

import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;


/**
 * Using the TrAX/JAXP 1.1 interface to compile a translet and use it
 * to perform multiple transformations. The translet implements
 * the Templates interface. If you want to use the translet to perform a
 * single transformation, see JAXPTransletOneTransformation.java.
 *
 *
 * @author Donald Leslie
 */
public class JAXPTransletMultipleTransformations
{
 static void doTransform(Templates translet, String xmlInURI, String htmlOutURI)
        throws TransformerException, FileNotFoundException
  {
    // For each transformation, instantiate a new Transformer, and perform
    // the transformation from a StreamSource to a StreamResult;
    Transformer transformer = translet.newTransformer();
    transformer.transform( new StreamSource(xmlInURI),
                           new StreamResult(new FileOutputStream(htmlOutURI)));
  }

  public static void main(String argv[])
  {
    // Set the TransformerFactory system property to generate and use translets.
    // Note: To make this sample more flexible, load properties from a properties file.
    // The setting for the Xalan Transformer is "org.apache.xalan.processor.TransformerFactoryImpl"
    String key = "javax.xml.transform.TransformerFactory";
    String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
    Properties props = System.getProperties();
    props.put(key, value);

    System.setProperties(props);

    String xslInURI = "todo.xsl";

    try
    {
      // Instantiate the TransformerFactory, and use it along with a SteamSource
      // XSL stylesheet to create a translet as a Templates object.
      TransformerFactory tFactory = TransformerFactory.newInstance();
      Templates translet = tFactory.newTemplates(new StreamSource(xslInURI));

      // Perform each transformation
      doTransform(translet, "todo.xml", "todo.html");
      System.out.println("Produced todo.html");

      doTransform(translet, "todotoo.xml", "todotoo.html");
      System.out.println("Produced todotoo.html");
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
}

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.