<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I try to do xslt conversion using following
code:</FONT></DIV>
<DIV><FONT face=Arial size=2> </FONT></DIV>
<DIV><FONT face=Arial size=2>
InputStream xsl =
this.getClass().getClassLoader()<BR>
.getResourceAsStream("com/nokia/cn/dccp/service/test/dcotest.xsl");<BR>
<BR>
System.out.println("xsl: " +
xsl);<BR>
<BR>
// xsl transform XML ->
XHTML:<BR>
Transformer transformer =
TransformerFactory.newInstance()<BR>
.newTransformer(new
StreamSource(xsl));<BR>
<BR>
JDOMResult out = new
JDOMResult();<BR>
<BR>
transformer.transform(<BR>
new JDOMSource(new Document(response.getElement("dcos"))),
out);<BR>
<BR>
// write to outputstream as
XHTML:<BR>
outputter.output(out.getDocument(), res.getOutputStream());</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>and i get exception:</FONT></DIV>
<DIV><FONT face=Arial size=2><BR>javax.xml.transform.TransformerException:
java.util.EmptyStackException<BR> at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1212)<BR>
at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)<BR>
at
java.lang.Thread.run(Thread.java:484)<BR>---------<BR>java.util.EmptyStackException<BR>
at
java.util.Stack.peek(Stack.java:82)<BR>
at
org.jdom.input.SAXHandler.characters(SAXHandler.java:483)<BR>
at
org.xml.sax.helpers.XMLFilterImpl.characters(XMLFilterImpl.java:614)<BR>
at
org.apache.xalan.transformer.ResultTreeHandler.characters(ResultTreeHandler.java:446)<BR>
at
org.apache.xalan.templates.ElemTextLiteral.execute(ElemTextLiteral.java:233)<BR>
at
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:495)<BR>
at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)<BR>
at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2154)<BR>
at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2097)<BR>
at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2029)<BR>
at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1189)<BR>
at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)<BR>
at java.lang.Thread.run(Thread.java:484)<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>??<BR></DIV></FONT></BODY></HTML>