You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Peter Kharchenko <pe...@interactivebusiness.com> on 2000/07/19 22:02:32 UTC
serializer problem in xalan 1.1 ?
Hi,
I am having a problem directing XML output through a serializer in a new version of Xalan. The same code works fine in the old version!
(1.0.1)
The new setup uses straight-out-of-tar.gz jar files of xalan 1.1 distribution. (xalan.jar and xerces.jar)
Am I doing something wrong or is there a major bug/incompatibility there ?
Here's the trivial test proggie : transform and output through a serializer:
-------------test.java----------
import org.xml.sax.SAXException;
import org.apache.xalan.xslt.*;
import org.apache.xml.serialize.*;
import java.io.*;
public class test
{
public static void main(String[] args)
throws java.io.IOException,
java.net.MalformedURLException,
org.xml.sax.SAXException
{
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
HTMLSerializer serializer= new HTMLSerializer(new OutputStreamWriter(System.out),new OutputFormat("HTML","UTF-8",true));
processor.process(new XSLTInputSource("foo.xml"),
new XSLTInputSource("foo.xsl"),
new XSLTResultTarget(serializer));
}
}
------------------------end of test.java-------------
and here's the exception that it generates instead of the output :
--------------exception---------
Exception in thread "main" java.lang.IllegalStateException: SER002 No writer supplied for serializer
at org.apache.xml.serialize.HTMLSerializer.startDocument(HTMLSerializer.java:458)
at org.apache.xalan.xslt.XSLTEngineImpl.flushPending(XSLTEngineImpl.java:3753)
at org.apache.xalan.xslt.XSLTEngineImpl$ResultTreeHandler.characters(XSLTEngineImpl.java:3901)
at org.apache.xalan.xslt.ElemValueOf.execute(ElemValueOf.java:174)
at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java:659)
at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java:659)
at org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement.java:1195)
at org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateElement.java:1057)
at org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java:772)
at org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:427)
at org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java:320)
at org.apache.xalan.xpath.XPath.locationPath(XPath.java:964)
at org.apache.xalan.xpath.XPath.execute(XPath.java:1385)
at org.apache.xalan.xpath.XPath.execute(XPath.java:1354)
at org.apache.xalan.xpath.XPath.execute(XPath.java:311)
at org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemplateElement.java:894)
at org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)
at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java:659)
at org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java:145)
at org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java:443)
at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:631)
at test.main(test.java:19)
-----------------end of the exception stacktrace----------
sorry if I am troubling you with an old question/problem. I couldn't seem to any info on that problem in release notes/faq/etc.
thanks,
-peter.