I am trying to write a Document object to XML file using FileOutputStream. But I am getting the following runtime error. ( No other compilation error).
Exception in thread "main" java.lang.ClassNotFoundException: org.apache.xerces.dom.DOMImplementationSourceImpl
Here is my code, I try to write in XML file.
//doc is Document object returning from a method.
DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
DOMImplementation impl = registry.getDOMImplementation("XML 1.0 LS 3.0");
if (impl != null) {
DOMImplementationLS implls = (DOMImplementationLS) impl;
LSSerializer serializer = implls.createLSSerializer();
LSOutput output = implls.createLSOutput();
output.setByteStream(new FileOutputStream("new_baskar.xml"));
serializer.write(doc, output);
}
Where the so and so class is gone ?