Re: SAX, fopservlet and 0.20.2
J: Thanks - that clarifies it. The newer xalan did and, with the upgrade to the newer fop and the namespace fix, it is now working (although I had to rename my servlet from fop to fop.pdf to get the pdf output in IE). I now have to work on performance - my users don't like waiting 30min to and hour for their pdf reports. Thanks! -Lou J.Pietschmann [EMAIL PROTECTED] on 06/06/2002 16:00:59 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: SAX, fopservlet and 0.20.2 [EMAIL PROTECTED] wrote: I am now testing using the glossary xml/xsl files in the example directory, but with the same results. It works fine from the command line, but NPE whenever I introduce the SAXResult or SAXSource. I'm starting to think it might be something with me environment. Also, if I stream it to a file using StreamResult, I can then take the resultant fo and use the Fop command line utility on that and it is fine. It is possible that it is a problem involving undeclared namespaces. GGet a recent Xalan or get Saxon (http://saxon.sourceforge.net) at run your stylesheet: xalan -in foo.xml -xsl foo.xsl -out foo.fo The Xalan included in the FOP distribution sometimes throws NPEs by itself and sometimes passes null namespaces to FOP which cause NPEs, but the latter might be masked by serialisation and reparsing. A more recent Xalan will provide a proper error message. Sorry, the xml.apache.org stated you needed the sax api, not sax.jar - xalan should cover this? Not Xalan, Xerces (included in the FOP distribution. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: SAX, fopservlet and 0.20.2
OK, I take back some of what I previously said. I upgraded my xalan to 2.3.1 and that fixed the NPE when transforming the glossary example. I still consistently get the NPE on my own files from the servlet, but now I also get it from the command line. Being at a loss, per the xalan 2.3.1 instructions, I switched my xerces jar to xercesImpl.jar, but now I get the following: org.xml.sax.SAXParseException: The prefix fo for element fo:external-graphic is not bound. I am still using 0.20.2 fop so I am pretty confused on which jars I should be using. Anyone have any ideas? What jars should be in my path? -Lou [EMAIL PROTECTED] on 06/06/2002 07:51:09 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: SAX, fopservlet and 0.20.2 J: Thanks for the response. I am now testing using the glossary xml/xsl files in the example directory, but with the same results. It works fine from the command line, but NPE whenever I introduce the SAXResult or SAXSource. I'm starting to think it might be something with me environment. Also, if I stream it to a file using StreamResult, I can then take the resultant fo and use the Fop command line utility on that and it is fine. Sorry, the xml.apache.org stated you needed the sax api, not sax.jar - xalan should cover this? If 0.20.3 is stable, I would consider upgrading - it's just that I have all the jar files frozen for at least another month. Thanks, Lou J.Pietschmann [EMAIL PROTECTED] on 06/05/2002 20:04:01 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: SAX, fopservlet and 0.20.2 [EMAIL PROTECTED] wrote: I recently switched from a standalone FOP app to the servlet. The code compiles fine, but any lines that use SAX throw a transformer exception. Do your files work with the command line FOP? fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf If you get a NPE [ERROR]: null add the -d switch to get a stack trace. Also, I don't explicitly include the sax jar file - do I need to? I'm using xalan 2.0.0 and xerces 1.2.3. What sax jar file? You might also consider upgrading to 0.20.3. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: SAX, fopservlet and 0.20.2
OK, I thawed the jar files and upgraded to 20.3 (and rolled back my xalan and xerces changes) and that seems to do the trick. The fo issue was a bug in an included stylesheet that I fixed. -Lou [EMAIL PROTECTED] on 06/06/2002 11:50:26 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: SAX, fopservlet and 0.20.2 OK, I take back some of what I previously said. I upgraded my xalan to 2.3.1 and that fixed the NPE when transforming the glossary example. I still consistently get the NPE on my own files from the servlet, but now I also get it from the command line. Being at a loss, per the xalan 2.3.1 instructions, I switched my xerces jar to xercesImpl.jar, but now I get the following: org.xml.sax.SAXParseException: The prefix fo for element fo:external-graphic is not bound. I am still using 0.20.2 fop so I am pretty confused on which jars I should be using. Anyone have any ideas? What jars should be in my path? -Lou [EMAIL PROTECTED] on 06/06/2002 07:51:09 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: SAX, fopservlet and 0.20.2 J: Thanks for the response. I am now testing using the glossary xml/xsl files in the example directory, but with the same results. It works fine from the command line, but NPE whenever I introduce the SAXResult or SAXSource. I'm starting to think it might be something with me environment. Also, if I stream it to a file using StreamResult, I can then take the resultant fo and use the Fop command line utility on that and it is fine. Sorry, the xml.apache.org stated you needed the sax api, not sax.jar - xalan should cover this? If 0.20.3 is stable, I would consider upgrading - it's just that I have all the jar files frozen for at least another month. Thanks, Lou J.Pietschmann [EMAIL PROTECTED] on 06/05/2002 20:04:01 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: SAX, fopservlet and 0.20.2 [EMAIL PROTECTED] wrote: I recently switched from a standalone FOP app to the servlet. The code compiles fine, but any lines that use SAX throw a transformer exception. Do your files work with the command line FOP? fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf If you get a NPE [ERROR]: null add the -d switch to get a stack trace. Also, I don't explicitly include the sax jar file - do I need to? I'm using xalan 2.0.0 and xerces 1.2.3. What sax jar file? You might also consider upgrading to 0.20.3. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: SAX, fopservlet and 0.20.2
[EMAIL PROTECTED] wrote: I am now testing using the glossary xml/xsl files in the example directory, but with the same results. It works fine from the command line, but NPE whenever I introduce the SAXResult or SAXSource. I'm starting to think it might be something with me environment. Also, if I stream it to a file using StreamResult, I can then take the resultant fo and use the Fop command line utility on that and it is fine. It is possible that it is a problem involving undeclared namespaces. GGet a recent Xalan or get Saxon (http://saxon.sourceforge.net) at run your stylesheet: xalan -in foo.xml -xsl foo.xsl -out foo.fo The Xalan included in the FOP distribution sometimes throws NPEs by itself and sometimes passes null namespaces to FOP which cause NPEs, but the latter might be masked by serialisation and reparsing. A more recent Xalan will provide a proper error message. Sorry, the xml.apache.org stated you needed the sax api, not sax.jar - xalan should cover this? Not Xalan, Xerces (included in the FOP distribution. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
SAX, fopservlet and 0.20.2
I recently switched from a standalone FOP app to the servlet. The code compiles fine, but any lines that use SAX throw a transformer exception. For example. the following line driver.render(input.getParser(), input.getInputSource()); throws a NPE (input is XSLTInputHandler input = new XSLTInputHandler(new File(xmlParam), new File(xslParam));). I changed the code using some examples from this list, but again, any time I use SAX, it does not work. I have tried the following with no luck: transformer.transform(fileSource, new SAXResult(driver.getContentHandler() )); throws a NPE transformer.transform( new DOMSource( inputDoc ), new SAXResult(driver.getContentHandler() )); throws a transform exception with The markup in the document preceding the root element must be well-formed transformer.transform( new SAXSource( new InputSource ( new StringReader ( xml ) ) ), new SAXResult(driver.getContentHandler() )); throws a transform exception with The markup in the document preceding the root element must be well-formed.; Line#: 1; Column#: 1 transformer.transform(fileSource,streamResult); **this works** I tried changing the transformer factory from the following seemingly working line: Transformer transformer = transformerFactory.newTransformer(new javax.xml.transform.stream.StreamSource(xsl)); to Transformer transformer = transformerFactory.newTransformer(new javax.xml.transform.sax.SAXSource( new InputSource ( new StringReader ( xsl ) ) )); but this now throws a transform exception with The markup in the document preceding the root element must be well-formed The code is currently working with: XSLTransform.transform(xml, xsl, writer); but I really need the speed and efficiency increase of SAX. This led me to believe that me XSL was bad, but it looks OK to me: ?xml version=1.0 encoding=utf-8? !DOCTYPE xsl:stylesheet [ !ENTITY nl #xd;#xa; !ENTITY nbsp #160; ] xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:output method=xml indent=yes encoding=utf-8/ ... The XSL file also looks OK. I read some posts that their was a fix for nulls outside of the root causing a NPE, but I think it was fixed in 0.20.2. Is this not the case? Also, I don't explicitly include the sax jar file - do I need to? I'm using xalan 2.0.0 and xerces 1.2.3. Thanks for any help - this is driving me nuts. -Lou - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: SAX, fopservlet and 0.20.2
[EMAIL PROTECTED] wrote: I recently switched from a standalone FOP app to the servlet. The code compiles fine, but any lines that use SAX throw a transformer exception. Do your files work with the command line FOP? fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf If you get a NPE [ERROR]: null add the -d switch to get a stack trace. Also, I don't explicitly include the sax jar file - do I need to? I'm using xalan 2.0.0 and xerces 1.2.3. What sax jar file? You might also consider upgrading to 0.20.3. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]