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

Problem transforming a xml document

Subject: Problem transforming a xml document
From: Carlos Barroso <est-c-barroso@xxxxxxxxxxxxx>
Date: Fri, 14 Mar 2003 10:29:04 -0000
bytearrayoutputstream xml
PLEASE HELP!

I'm having problems transforming a XML file. Here is the class
source code. It's only a few lines:

//---------------------- CODE -------------------------

// ** import's **

public class GenerateHTML {
  public String process(String xmlString, String xslFile) throws
TransformerConfigurationException, TransformerException, DocumentException,
SAXException {

    ByteArrayOutputStream result = new ByteArrayOutputStream();

    SAXReader reader = new SAXReader("org.apache.xerces.parsers.SAXParser");
    Document document = reader.read(new InputSource(new
StringReader(xmlString)));

    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(new StreamSource(new
File(xslFile)));

    DocumentSource source = new DocumentSource(document);
    transformer.transform(source, new StreamResult(result));

    return(result.toString());
  }
}
//---------------------- END CODE -------------------------


I've tested the two parameters ("xmlString" and "xslFile") and they have the
information that I want.
I'm using this class inside a bean and every time I try to transform the
generated XML (which is valid! I tested it with XML Spy 5) it keeps giving
me the following error:

--------
javax.xml.transform.TransformerFactoryConfigurationError: Provider null
could not be instantiated: java.lang.NullPointerException
	at javax.xml.transform.TransformerFactory.newInstance(Unknown
Source)
( ... )
--------

I can't figure out what the problem is!? I've never had this problem before.

Can someone help me please.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2011 All Rights Reserved.