Hi there,
Perhaps someone can help me. I was looking into using XSLTC as my XSL transformer with Cocoon 2.0.3. I found some instructions on the Cocoon Wiki site (http://outerthought.net/wiki/Wiki.jsp?page=XSLTC), and followed them carefully, but when I tried out the transformer with a dirt simple pipeline (generate from a simple xml file, transform with XSLTC, serialize to XML), I got NPEs as follows:
ERROR (2002-11-25) 10:03.15:031 [sitemap] (/BMGReports/ProjX/test.xml) HttpProcessor[8080][4]/PipelineNode: Error while processing pipeline at file:/C:/tomcat-4.1.12/webapps/BMGReports/ProjX/subsitemap.xmap:62:20 org.apache.cocoon.ProcessingException: Exception during processing of file:/C:/tomcat-4.1.12/webapps/BMGReports/transforms/test.xsl: java.lang.NullPointerException at org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStreamSource.java:211) at org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:268) at org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:239) at org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java:298) . . . java.lang.NullPointerException at org.apache.xalan.xsltc.compiler.Parser.getQName(Parser.java:303) at org.apache.xalan.xsltc.compiler.Parser.makeInstance(Parser.java:818) at org.apache.xalan.xsltc.compiler.Parser.startElement(Parser.java:1100) at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:454) . . . ERROR (2002-11-25) 10:03.15:109 [sitemap] (/BMGReports/ProjX/test.xml) HttpProcessor[8080][4]/PipelineNode: error notifier barfs org.apache.cocoon.ProcessingException: Exception during processing of file:/C:/tomcat-4.1.12/webapps/BMGReports/transforms/system/error2html.xsl: java.lang.NullPointerException at org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStreamSource.java:211) at org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:268) at org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:239) at org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java:298) . . .
I like the “barfs” error. In any case, it looks like the XSLTC processor isn’t set up properly, and when I have my error pipe transform the error, that fails, too. Here’s my XML and XSL files:
test.xsl: <?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="test"> <xsl:copy-of select="." /> </xsl:template>
</xsl:stylesheet>
test.xml: <?xml version="1.0" encoding="UTF-8"?> <test> <stuff>Test</stuff> </test>
My pipe looks like this:
<map:match pattern="test.xml"> <map:generate src="" /> <map:transform type="xslt-xsltc" src="" /> <map:serialize type="xml" /> </map:match>
I have Xalan (2.3.1) running side by side with XSLTC, as indicated in the how-to on the wiki site. I’m running on Tomcat 4.1.12 standalone at the moment. Xerces is the parser. The pipe works fine with straight Xalan.
So, I’m curious. Does anyone have any insight into why XSLTC may or may not work the way I have it set up, which is how it’s described on the wiki site? And did I hear that there were some issues with XSLTC that make its integration with Cocoon less than ideal? Is there a reason I should avoid using it with Cocoon 2.0.3 in its current form, given that I’m looking for performance improvements which may help me out with scalability?
Thanks in advance for any advice, Tyson Nunemacher |
- Re: Using XSLTC with Cocoon Tyson Nunemacher
- Re: Using XSLTC with Cocoon Brian Johnson
- Re: Using XSLTC with Cocoon Tyson Nunemacher