[jdom-interest] JDom and Xalan
Christian Bjørnbak
bjornbak at iuas.dk
Mon Dec 18 07:29:20 PST 2000
Hi
I have a problem with JDom and Xalan.
I'm trying to use JDom to parse, manipulate a XML file and then send it to
Xalan to generate a HTML file.
I use the following code snippet:
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(new File("guiml3.xml"));
XSLTProcessor proc = XSLTProcessorFactory.getProcessor();
DOMOutputter dom = new DOMOutputter();
proc.process(new XSLTInputSource(dom.output(doc)), null, new
XSLTResultTarget(out));
It worked fine at first, but when I removed a section of the file the
following exception was returned:
java.lang.NoSuchMethodError
at
org.apache.xalan.xpath.xdom.XercesLiaison.getParentOfNode(XercesLiaison.java
:457)
at
org.apache.xalan.xpath.MutableNodeListImpl.isDOMNodeAfter(MutableNodeListImp
l.java:501)
at
org.apache.xalan.xpath.MutableNodeListImpl.isNodeAfter(MutableNodeListImpl.j
ava:483)
at
org.apache.xalan.xpath.MutableNodeListImpl.addNodeInDocOrder(MutableNodeList
Impl.java:403)
at
org.apache.xalan.xpath.MutableNodeListImpl.addNodeInDocOrder(MutableNodeList
Impl.java:456)
at
org.apache.xalan.xpath.MutableNodeListImpl.addNodesInDocOrder(MutableNodeLis
tImpl.java:240)
at
org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:530)
at
org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java
:321)
at org.apache.xalan.xpath.XPath.locationPath(XPath.java:964)
at org.apache.xalan.xpath.XPath.execute(XPath.java:1381)
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.ElemValueOf.execute(ElemValueOf.java:186)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemTemplateElement.childrenToString(ElemTemplateEleme
nt.java:721)
at org.apache.xalan.xslt.ElemComment.execute(ElemComment.java:114)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java:1199)
at
org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateEle
ment.java:1061)
at
org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java
:773)
at
org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:428)
at
org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java
:321)
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(ElemTemp
lateElement.java:896)
at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176
)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at org.apache.xalan.xslt.ElemChoose.execute(ElemChoose.java:132)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java:1199)
at
org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateEle
ment.java:1061)
at
org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java
:773)
at
org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:428)
at
org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java
:321)
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(ElemTemp
lateElement.java:896)
at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176
)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java:1199)
at
org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateEle
ment.java:1061)
at
org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java
:773)
at
org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:428)
at
org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java
:321)
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(ElemTemp
lateElement.java:896)
at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176
)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at org.apache.xalan.xslt.ElemIf.execute(ElemIf.java:137)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java:1199)
at
org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateEle
ment.java:1061)
at
org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java
:773)
at
org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:428)
at
org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java
:321)
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(ElemTemp
lateElement.java:896)
at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176
)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement
.java:1199)
at
org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateEle
ment.java:1061)
at
org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java
:773)
at
org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:428)
at
org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java
:321)
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(ElemTemp
lateElement.java:896)
at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176
)
at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen
t.java:661)
at org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java:145)
at
org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java:444)
at
org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:700)
at JDomServlet.doGet(JDomServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
at
org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:160)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
)
at java.lang.Thread.run(Unknown Source)
I know that's a Xalan Exception, but when I make Xalan process the file
directly (by chancing the input source to XSLInputSource("guiml3.xml")), it
works perfectly..
Can anyone help?
Thanks,
Christian Bjørnbak
More information about the jdom-interest
mailing list