Error in writing Document object to the XML file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baskarpr
    New Member
    • Oct 2006
    • 33

    Error in writing Document object to the XML file

    I am trying to write a Document object to XML file using FileOutputStrea m. But I am getting the following runtime error. ( No other compilation error).

    Exception in thread "main" java.lang.Class NotFoundExcepti on: org.apache.xerc es.dom.DOMImple mentationSource Impl

    Here is my code, I try to write in XML file.

    //doc is Document object returning from a method.
    DOMImplementati onRegistry registry = DOMImplementati onRegistry.newI nstance();
    DOMImplementati on impl = registry.getDOM Implementation( "XML 1.0 LS 3.0");
    if (impl != null) {
    DOMImplementati onLS implls = (DOMImplementat ionLS) impl;
    LSSerializer serializer = implls.createLS Serializer();
    LSOutput output = implls.createLS Output();
    output.setByteS tream(new FileOutputStrea m("new_baskar.x ml"));
    serializer.writ e(doc, output);
    }

    Where the so and so class is gone ?
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Try this:


    Does putting that declaration before it help at all?

    Comment

    Working...