[xsl] TransformerException / NullPointerException in portlet

Subject: [xsl] TransformerException / NullPointerException in portlet
From: David Q Levitt <dqlevitt@xxxxxxxxxx>
Date: Fri, 25 Oct 2002 18:36:22 -0400

I'm trying to do an Xalan XSLT Transformation inside a portlet in order to
transform an XML DOM Element (which I've received from a web service) into
html to display.  When the last line in the following code gets executed -
which doesn't do the transform but merely creates the transformer - I'm
getting this Exception:

java.lang.NullPointerException at
 at com.mycompany.portlets.dql.HelloWorld.service

here's the code:

 InputStream xsltStream =
 xsltStreamSource = new StreamSource(xsltStream);
 TransformerFactory tFactory = TransformerFactory.newInstance();
 try {
      Transformer transformer = tFactory.newTransformer(xsltStreamSource);
      outputString = "transformer created";
catch (TransformerConfigurationException tce) {
       PrintWriter writer = response.getWriter();

I verified that the XSL file is being read properly and converted into an
InputStream.  I even went so far as to hardcode the XSL into my portlet and
read it in from a StringReader - same result.

Many thanks for any help offered.

- Dave Levitt

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

Current Thread