I'm using a servlet to create HTML code with xsl and xml files as follows
TransformerFactory tFactory = TransformerFactory.newInstance();
// Get the XML input document and the stylesheet.
Source xmlSource = new StreamSource(new
URL("file:c:\\java\\test.xml").openStream());
Source xslSource = new StreamSource(new
URL("file:\\test.xsl").openStream());
// Generate the transformer.
Transformer transformer = tFactory.newTransformer(xslSource);
// Perform the transformation, sending the output to the response.
transformer.transform(xmlSource, new StreamResult(out));
and it works, but when i try to use xml as a object replacing the last line
with this one
// Document doc = ...
transformer.transform(new DOMSource(doc), new StreamResult(out));
the following runtime error appear:
java.lang.NoSuchMethodError: org.w3c.dom.Node: method
getNamespaceURI()Ljava/lang/String; not found
Thanks
Guido