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

Missing or incorrect XSLT Namespace

Subject: Missing or incorrect XSLT Namespace
From: "John Quinn" <Jquinn@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 6 Apr 2006 15:59:34 -0400
missing or incorrect xslt namespace
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 WITH NO ERRORS
using the same versions of JBoss.

Here's the Exception:

2006-03-02 15:17:21,969 INFO  [STDOUT] 15:17:21,958 ERROR [PDFServlet] Error
generating PDF file
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException: org.xml.sax.SAXException : Missing
or incorrect XSLT Namespace.
      at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates
(TransformerFactoryImpl.java:807)
      at
com.kroger.accounting.ad.reports.PDFReport.generate(PDFReport.java:96)
      at com.kroger.accounting.ad.view.reports.PDFServlet.generateReport
(PDFServlet.java:80)
      at com.kroger.accounting.ad.view.reports.PDFServlet.doGet(
PDFServlet.java: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
  log.info("PDFReport xslInputStream: " + xslInputStream);
  TransformerFactory tf = TransformerFactory.newInstance();
  log.info("PDFReport code source for TransformerFactory: " +
tf.getClass().getProtectionDomain().getCodeSource());
  log.info("PDFReport package for TransformerFactory: " +
tf.getClass().getPackage());
  Templates xslTemplate = tf.newTemplates(new StreamSource(xslInputStream));
  Transformer xslt = xslTemplate.newTransformer();


The xsl has the namespaces in it.  Of course it would have to in order to
work in the XP and SUSE linux environments.


First portion of XSL 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">

<!-- defines the layout master -->

<fo:layout-master-set>

I can send the full xsl, but it, of course, is large.

I also removed xml_apis.jar from the war file since JBoss had it in it's
endorsed library,

I have run out of ideas, someone suggested using saxon, however, I have
found a lot of problems with folks trying to use saxon with FOP, and I'm not
sure  which versions of saxon are best for using with FOP.


Any idea appreciated,
Thanks,
John

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.