Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


creating xml file

From: Seetha Rama Krishna <ram_kurra@-----.--.-->
To: xml-dev <xml-dev@-----.---.--->
Date: 6/2/2006 12:23:00 PM
Hello Techies,
            I am trying to create xml file using DOM.
         Here is my code.
  
  
  public static void main(String[] args) {
          // TODO Auto-generated method stub
          try {
              DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
              DocumentBuilder db = fact.newDocumentBuilder();
              Document doc = db.newDocument();
              Element root = null;
              root = doc.createElement(application);
              doc.appendChild(root);
     
         Element aid = doc.createElement(application_Id);
              root.appendChild(aid);
              System.out.println("applicationId is added");
              Text t = doc.createTextNode("application");
              t.setNodeValue("test");
              aid.appendChild(t);
              Text t1 = doc.createTextNode("ruleSet_Name");
              t1.setNodeValue("1");
              aid.appendChild(t1);
              
          } catch (ParserConfigurationException pce) {
 
             // TODO: handle exception
              System.out.println("ParserException" + pce.getMessage());
          }
  
      }
  
  
         I want to store it with name  application.xml   .  How can I do this one. Can u guys  help me out
  
  


regards,
ramu Send instant messages to your online friends http://in.messenger.yahoo.com 

 Stay connected with your friends even when away from PC.  Link: http://in.mobile.yahoo.com/new/messenger/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent