Blog Archives

How to create XML file in Java


package com.test; import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; public class CreateXMLInJava { public static void main(String argv[]) { CreateXMLInJava createXml = new

Tagged with: , , , , ,
Posted in JAVA, XML

XML Parsing Example using DOM in Java


package com.test; import java.io.StringReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.CharacterData; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; public class XMLParsing {   public static void main(String arg[]) throws Exception{ String xmlRecords = “<data><employee><name>A</name>” + “<title>Manager</title></employee></data>”;    

Tagged with: ,
Posted in JAVA

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 678 other followers

Calendar
July 2018
M T W T F S S
« Mar    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
Mallikarjun Gunda

This is Mallikarjun Gunda, I am working as a software professional. Blogging is my Passion. This blog contains the posts on Java related technologies and programming languages. I am happy to share my knowledge through the blogs.

Blog Stats
  • 266,119 hits
IndiBlogger
malliktalksjava.wordpress.c...
70/100