[jdom-interest] XSLT transformation

Mika Haapakorpi mika.haapakorpi at sensor-sc.fi
Tue Jun 19 08:05:55 PDT 2001


I try to do xslt conversion using following code:
    
                InputStream xsl = this.getClass().getClassLoader()
                    .getResourceAsStream("com/nokia/cn/dccp/service/test/dcotest.xsl");
                    
                System.out.println("xsl: " + xsl);
                    
                // xsl transform XML -> XHTML:
                Transformer transformer = TransformerFactory.newInstance()
                    .newTransformer(new StreamSource(xsl));
              
                JDOMResult out = new JDOMResult();
                
                transformer.transform(
                    new JDOMSource(new Document(response.getElement("dcos"))), out);
                
                // write to outputstream as XHTML:
                outputter.output(out.getDocument(), res.getOutputStream());

and i get exception:

javax.xml.transform.TransformerException: java.util.EmptyStackException
        at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1212)
        at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)
        at java.lang.Thread.run(Thread.java:484)
---------
java.util.EmptyStackException
        at java.util.Stack.peek(Stack.java:82)
        at org.jdom.input.SAXHandler.characters(SAXHandler.java:483)
        at org.xml.sax.helpers.XMLFilterImpl.characters(XMLFilterImpl.java:614)
        at org.apache.xalan.transformer.ResultTreeHandler.characters(ResultTreeHandler.java:446)
        at org.apache.xalan.templates.ElemTextLiteral.execute(ElemTextLiteral.java:233)
        at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:495)
        at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2154)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2097)
        at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2029)
        at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1189)
        at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)
        at java.lang.Thread.run(Thread.java:484)

??

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20010619/09fdd8a8/attachment.htm


More information about the jdom-interest mailing list