I am receiving an exception when I try to generate a PDF in a Servlet using FOP under JBoss4.0.1SP1 (and JBoss4.0.3SP1) in a Redhat linux 2.1 OS.
 
I am running the same code under  a Suse linux and Win XP OS without any errors using JBoss.
 
Here's the Exception:
2006-03-02 15:17:21,969 INFO  [STDOUT] 15:17:21,958 ERROR [PDFServlet] Error gen
erating PDF file
javax.xml.transform.TransformerConfigurationException: javax.xml.transform.Trans
formerException: org.xml.sax.SAXException : Missing or incorrect XSLT Namespace.
        at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(Transf
ormerFactoryImpl.java:807)
        at com.kroger.accounting.ad.reports.PDFReport.generate(PDFReport.java :96
)
        at com.kroger.accounting.ad.view.reports.PDFServlet.generateReport(PDFSe
rvlet.java:80)
        at com.kroger.accounting.ad.view.reports.PDFServlet.doGet(PDFServlet.jav
a:70)
 
 
Code snippet (last line is where the exception is generated):

 public OutputStream generate() throws Exception {
  InputStream xslInputStream = null;

  log.info("PDFReport.generate(): url ="" + xslUrl + ">");
  
  if (xslUrl != null) {
   xslInputStream = xslUrl.openStream();
  } else {
   xslInputStream = new FileInputStream(xslFile);
  }


  // transform xml + xsl => xslt
  TransformerFactory tf = TransformerFactory.newInstance();
  log.info("PDFReport source url for TransformerFactory: " + tf.getClass().getProtectionDomain().getCodeSource());
  Templates xslTemplate = tf.newTemplates(new StreamSource(xslInputStream));

 

XSL Snippet (with Namespaces defined):

<?

xml version="1.0" encoding ="UTF-8"?>

<

xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo ="http://www.w3.org/1999/XSL/Format">

<xsl:attribute-set name="table" ><xsl:attribute name= "font-size">8pt</xsl:attribute> </xsl:attribute-set><xsl:template match="/">

<fo:root xmlns:fo=" http://www.w3.org/1999/XSL/Format">

 

The xsl doesn't use anything but the fo and xsl prefixes.

Can anyone tell me what the environment change is that could cause the creationn of a new template to fail with the above exception?

 

Thanks,
John

[EMAIL PROTECTED]

Reply via email to