[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Storing Transient DOM at RunTime



 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance ();
      DocumentBuilder db = dbf.newDocumentBuilder ();
      Document doc = db.newDocument ();
      Element root = doc.createElement ("dbAlias");
      root.setAttribute("name",str[1]);
      doc.appendChild (root);
    
      Element first  = doc.createElement("jdbcDbURL");
      first.appendChild(doc.createTextNode(str[2]));
      root.appendChild(first);
       	
      Element second  = doc.createElement("dbUser");
      second.appendChild(doc.createTextNode(str[3]));
      root.appendChild(second);
      
      Element third  = doc.createElement("dbPasswd");
      third.appendChild(doc.createTextNode(str[4]));
      root.appendChild(third);
    
    database.open(hostname, 3333, "oz", "air");
    parser =(PersistentDOMParser) new OzoneDOMParser(database);
   Document pDoc = parser.storeDocument(doc, "db.xml");

   where doc is Transient document 
I got the following Exception

java.io.ioException at com.sun.xml.tree.xmlDocument

Please Explain Is Anything wrong in creating a Transient DOM and storing it
using PersistentDOMParser s storeDocument(Document doc, String docname)
we can't use DOMFactory for creating Transient DOM because of several missing
packages?
Thanks

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1