Project

Profile

Help

DOMSource and DOMResult problems with 8.4

Added by Anonymous about 19 years ago

Legacy ID: #3167800 Legacy Poster: Timo Lukumaa (timomass)

Hello everybody, I'm trying to use Saxon 8.4 in an Axis web service to make an xquery xml transformation. It's a message style web service, so I get an array of (org.w3c.dom.)Elements to my service method. I'm trying to use the first element of the array as a DOMSource for the xquery transformation. I'm having two problems (at least :) First, I'm getting a null pointer exceptions when trying to use DOMSource. For example, this works fine: sqc.buildDocument(new StreamSource(new File("C:/temp/sample.xml"))) but this doesn't: DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new File("C:/temp/sample.xml")); DOMSource domSource = new DOMSource(document); DocumentInfo documentInfo = sqc.buildDocument(domSource); sqc.buildDocument throws a null pointer exception. The same also happens when I'm trying to use an element from my service method as input. The element isn't null and it's the root element. Any ideas? Second problem comes when I'm trying to use DOMResult in XQueryExpression.run(): DOMResult domResult = new DOMResult(); exp.run(dynamicContext, domResult, props); this throws java.lang.IllegalArgumentException: Unknown type of result: class javax.xml.transform.dom.DOMResult. Any suggestions? Would there be some other way to do this not using DOMSource?


Replies (1)

RE: DOMSource and DOMResult problems with 8.4 - Added by Anonymous about 19 years ago

Legacy ID: #3168351 Legacy Poster: Timo Lukumaa (timomass)

Oh crap. I had forgotten to put all necessary saxon8-.jars to classpath. So, problem solved. Usually just sleeping a night and starting again fresh in the morning helps :)

    (1-1/1)

    Please register to reply