Inserting XML namespace using DOM Parser
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sharada_Vittal
Posted On:   Monday, November 12, 2007 10:52 AM

Hi, I need to generate an xml file using DOM Parser. What api's should I use to generate these 2 lines in my xml file? <?xml version="1.0" encoding="utf-8" standalone="no"?> Here is my code - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { //get an instance of builder DocumentBuilder db = dbf.newDocumentBuilder(); //create an instance of DOM Document dom = db.newDocument(); Element rootEle = dom.createElement("xyzElement"); }catch(ParserConfigurationException pce) { //dump it System.out.println(&   More>>

Hi,

I need to generate an xml file using DOM Parser. What api's should I use to generate these 2 lines in my xml file?



<?xml version="1.0" encoding="utf-8" standalone="no"?>






Here is my code -

			

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
//get an instance of builder
DocumentBuilder db = dbf.newDocumentBuilder();

//create an instance of DOM
Document dom = db.newDocument();
Element rootEle = dom.createElement("xyzElement");



}catch(ParserConfigurationException pce) {
//dump it
System.out.println("Error while trying to instantiate DocumentBuilder " + pce);
System.exit(1);
}
   <<Less
About | Sitemap | Contact