XML and Java - Parsing XML using Java Tutorial

By: totheriver.com Viewed: 317238 times  Printer Friendly Format    


Parsing XML
If you are a beginner to XML using Java then this is the perfect sample to parse a XML file create Java Objects and manipulate them.

The idea here is to parse the employees.xml file with content as below

<?xml version="1.0" encoding="UTF-8"?>
<Personnel>
  <Employee type="permanent">
        <Name>Seagull</Name>
        <Id>3674</Id>
        <Age>34</Age>
   </Employee>
  <Employee type="contract">
        <Name>Robin</Name>
        <Id>3675</Id>
        <Age>25</Age>
    </Employee>
  <Employee type="permanent">
        <Name>Crow</Name>
        <Id>3676</Id>
        <Age>28</Age>
    </Employee>
</Personnel>

From the parsed content create a list of Employee objects and print it to the console. The output would be something like


Employee Details - Name:Seagull, Type:permanent, Id:3674, Age:34.
Employee Details - Name:Robin, Type:contract, Id:3675, Age:25.
Employee Details - Name:Crow, Type:permanent, Id:3676, Age:28.
We will start with a DOM parser to parse the xml file, create Employee value objects and add them to a list. To ensure we parsed the file correctly let's iterate through the list and print the employees data to the console. Later we will see how to implement the same using SAX parser.
In a real world situation you might get a xml file from a third party vendor which you need to parse and update your database.

Using DOM
    This program DomParserExample.java uses DOM API.

The steps are

  • Get a document builder using document builder factory and parse the xml file to create a DOM object
  • Get a list of employee elements from the DOM
  • For each employee element get the id, name, age and type. Create an employee value object and add it to the list.
  • At the end iterate through the list and print the employees to verify we parsed it right.

a) Getting a document builder

	private void parseXmlFile(){
		//get the factory
		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

		try {

			//Using factory get an instance of document builder
			DocumentBuilder db = dbf.newDocumentBuilder();

			//parse using builder to get DOM representation of the XML file
			dom = db.parse("employees.xml");


		}catch(ParserConfigurationException pce) {
			pce.printStackTrace();
		}catch(SAXException se) {
			se.printStackTrace();
		}catch(IOException ioe) {
			ioe.printStackTrace();
		}
	}

b) Get a list of employee elements
Get the rootElement from the DOM object.From the root element get all employee elements. Iterate through each employee element to load the data.


	private void parseDocument(){
		//get the root element
		Element docEle = dom.getDocumentElement();

		//get a nodelist of 
 elements
		NodeList nl = docEle.getElementsByTagName("Employee");
		if(nl != null && nl.getLength() > 0) {
			for(int i = 0 ; i < nl.getLength();i++) {

				//get the employee element
				Element el = (Element)nl.item(i);

				//get the Employee object
				Employee e = getEmployee(el);

				//add it to list
				myEmpls.add(e);
			}
		}
	}

c) Reading in data from each employee.


	/**
	 * I take an employee element and read the values in, create
	 * an Employee object and return it
	 */
	private Employee getEmployee(Element empEl) {

		//for each <employee> element get text or int values of
		//name ,id, age and name
		String name = getTextValue(empEl,"Name");
		int id = getIntValue(empEl,"Id");
		int age = getIntValue(empEl,"Age");

		String type = empEl.getAttribute("type");

		//Create a new Employee with the value read from the xml nodes
		Employee e = new Employee(name,id,age,type);

		return e;
	}


	/**
	 * I take a xml element and the tag name, look for the tag and get
	 * the text content
	 * i.e for <employee><name>John</name></employee> xml snippet if
	 * the Element points to employee node and tagName is 'name' I will return John
	 */
	private String getTextValue(Element ele, String tagName) {
		String textVal = null;
		NodeList nl = ele.getElementsByTagName(tagName);
		if(nl != null && nl.getLength() > 0) {
			Element el = (Element)nl.item(0);
			textVal = el.getFirstChild().getNodeValue();
		}

		return textVal;
	}


	/**
	 * Calls getTextValue and returns a int value
	 */
	private int getIntValue(Element ele, String tagName) {
		//in production application you would catch the exception
		return Integer.parseInt(getTextValue(ele,tagName));
	}

d) Iterating and printing.


	private void printData(){

		System.out.println("No of Employees '" + myEmpls.size() + "'.");

		Iterator it = myEmpls.iterator();
		while(it.hasNext()) {
			System.out.println(it.next().toString());
		}
	}

Using SAX
This program SAXParserExample.java parses a XML document and prints it on the console.
Sax parsing is event based modelling.When a Sax parser parses a XML document and every time it encounters a tag it calls the corresponding tag handler methods

when it encounters a Start Tag it calls this method
    public void startElement(String uri,..

when it encounters a End Tag it calls this method
    public void endElement(String uri,...

Like the dom example this program also parses the xml file, creates a list of employees and prints it to the console. The steps involved are

  • Create a Sax parser and parse the xml
  • In the event handler create the employee object
  • Print out the data
Basically the class extends DefaultHandler to listen for call back events. And we register this handler with the Sax parser to notify us of call back events. We are only interested in start event, end event and character event.
In start event if the element is employee we create a new instant of employee object and if the element is Name/Id/Age we initialize the character buffer to get the text value.
In end event if the node is employee then we know we are at the end of the employee node and we add the Employee object to the list.If it is any other node like Name/Id/Age we call the corresponding methods like setName/SetId/setAge on the Employee object.
In character event we store the data in a temp string variable.

a) Create a Sax Parser and parse the xml


	private void parseDocument() {

		//get a factory
		SAXParserFactory spf = SAXParserFactory.newInstance();
		try {

			//get a new instance of parser
			SAXParser sp = spf.newSAXParser();

			//parse the file and also register this class for call backs
			sp.parse("employees.xml", this);

		}catch(SAXException se) {
			se.printStackTrace();
		}catch(ParserConfigurationException pce) {
			pce.printStackTrace();
		}catch (IOException ie) {
			ie.printStackTrace();
		}
	}

b) In the event handlers create the Employee object and call the corresponding setter methods.


	//Event Handlers
	public void startElement(String uri, String localName, String qName,
		Attributes attributes) throws SAXException {
		//reset
		tempVal = "";
		if(qName.equalsIgnoreCase("Employee")) {
			//create a new instance of employee
			tempEmp = new Employee();
			tempEmp.setType(attributes.getValue("type"));
		}
	}


	public void characters(char[] ch, int start, int length) throws SAXException {
		tempVal = new String(ch,start,length);
	}

	public void endElement(String uri, String localName,
		String qName) throws SAXException {

		if(qName.equalsIgnoreCase("Employee")) {
			//add it to the list
			myEmpls.add(tempEmp);

		}else if (qName.equalsIgnoreCase("Name")) {
			tempEmp.setName(tempVal);
		}else if (qName.equalsIgnoreCase("Id")) {
			tempEmp.setId(Integer.parseInt(tempVal));
		}else if (qName.equalsIgnoreCase("Age")) {
			tempEmp.setAge(Integer.parseInt(tempVal));
		}

	}

c) Iterating and printing.


	private void printData(){

		System.out.println("No of Employees '" + myEmpls.size() + "'.");

		Iterator it = myEmpls.iterator();
		while(it.hasNext()) {
			System.out.println(it.next().toString());
		}
	}

Generating XML
    The previous programs illustrated how to parse an existing XML file using both SAX and DOM Parsers.
But generating a XML file from scratch is a different story, for instance you might like to generate a xml file for the data extracted from a database.To keep the example simple this program XMLCreatorExample.java generates XML from a list preloaded with hard coded data. The output will be book.xml file with the following content.


<?xml version="1.0" encoding="UTF-8"?>
<Books>
    <Book Subject="Java 1.5">
        <Author>Kathy Sierra .. etc</Author>
        <Title>Head First Java</Title>
    </Book>
    <Book Subject="Java Architect">
        <Author>Kathy Sierra .. etc</Author>
        <Title>Head First Design Patterns</Title>
    </Book>
</Books>

The steps involved are
  • Load Data
  • Get an instance of Document object using document builder factory
  • Create the root element Books
  • For each item in the list create a Book element and attach it to Books element
  • Serialize DOM to FileOutputStream to generate the xml file "book.xml".

a) Load Data.



	/**
	 * Add a list of books to the list
	 * In a production system you might populate the list from a DB
	 */
	private void loadData(){

		myData.add(new Book("Head First Java",
			"Kathy Sierra .. etc","Java 1.5"));

		myData.add(new Book("Head First Design Patterns",
			"Kathy Sierra .. etc","Java Architect"));
	}

c) Getting an instance of DOM.

	/**
	 * Using JAXP in implementation independent manner create a document object
	 * using which we create a xml tree in memory
	 */
	private void createDocument() {

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

		//create an instance of DOM
		dom = db.newDocument();

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

	}

c) Create the root element Books.



	/**
	 * The real workhorse which creates the XML structure
	 */
	private void createDOMTree(){

		//create the root element 

		Element rootEle = dom.createElement("Books");
		dom.appendChild(rootEle);

		//No enhanced for
		Iterator it  = myData.iterator();
		while(it.hasNext()) {
			Book b = (Book)it.next();
			//For each Book object  create 
 element and attach it to root
			Element bookEle = createBookElement(b);
			rootEle.appendChild(bookEle);
		}

	}

d) Creating a book element.

	/**
	 * Helper method which creates a XML element 

	 * @param b The book for which we need to create an xml representation
	 * @return XML element snippet representing a book
	 */
	private Element createBookElement(Book b){

		Element bookEle = dom.createElement("Book");
		bookEle.setAttribute("Subject", b.getSubject());

		//create author element and author text node and attach it to bookElement
		Element authEle = dom.createElement("Author");
		Text authText = dom.createTextNode(b.getAuthor());
		authEle.appendChild(authText);
		bookEle.appendChild(authEle);

		//create title element and title text node and attach it to bookElement
		Element titleEle = dom.createElement("Title");
		Text titleText = dom.createTextNode(b.getTitle());
		titleEle.appendChild(titleText);
		bookEle.appendChild(titleEle);

		return bookEle;

	}

e) Serialize DOM to FileOutputStream to generate the xml file "book.xml".


	/**
	 * This method uses Xerces specific classes
	 * prints the XML document to file.
     */
	private void printToFile(){

		try
		{
			//print
			OutputFormat format = new OutputFormat(dom);
			format.setIndenting(true);

			//to generate output to console use this serializer
			//XMLSerializer serializer = new XMLSerializer(System.out, format);


			//to generate a file output use fileoutputstream instead of system.out
			XMLSerializer serializer = new XMLSerializer(
			new FileOutputStream(new File("book.xml")), format);

			serializer.serialize(dom);

		} catch(IOException ie) {
		    ie.printStackTrace();
		}
	}

Note:
The Xerces internal classes OutputFormat and XMLSerializer are in different packages.

In JDK 1.5 with built in Xerces parser they are under
com.sun.org.apache.xml.internal.serialize.OutputFormat
com.sun.org.apache.xml.internal.serialize.XMLSerializer

In Xerces 2.7.1 which we are using to run these examples they are under
org.apache.xml.serialize.XMLSerializer
org.apache.xml.serialize.OutputFormat
We are using Xerces 2.7.1 with JDK 1.4 and JDK 1.3 as the default parser with JDK 1.4 is Crimson and there is no built in parser with JDK 1.3.
Also please remember it is not advisable to use parser implementation specific classes like OutputFormat and XMLSerializer as they are only available in Xerces and if you switch to another parser in the future you may have to rewrite.

Instructions to run these programs

The instructions to compile and run these programs varies based on the JDK that you are using. This is due to the way the XML parser is bundled with various Java distributions.These instructions are for Windows OS.For Unix or Linux OS you just need to change the folder paths accordingly.

Using JDK 1.5

Xerces parser is bundled with the JDK 1.5 distribution.So you need not download the parser separately.

Running DOMParserExample

  1. Download DomParserExample.java, Employee.java, employees.xml to c:\xercesTest
  2. Go to command prompt and type
    cd c:\xercesTest
  3. To compile, type
    javac -classpath . DomParserExample.java
  4. To run, type
    java -classpath . DomParserExample
Running SAXParserExample
  1. Download SAXParserExample.java, Employee.java, employees.xml to c:\xercesTest
  2. Go to command prompt and type
    cd c:\xercesTest
  3. To compile, type
    javac -classpath . SAXParserExample.java
  4. To run,type
    java -classpath . SAXParserExample
Running XMLCreatorExample
  1. Download XMLCreatorExample.java, Book.java to c:\xercesTest
  2. Go to command prompt and type
    cd c:\xercesTest
  3. To compile, type
    javac -classpath . XMLCreatorExample.java
  4. To run, type
    java -classpath . XMLCreatorExample

 



Most Viewed Articles (in Java )

Latest Articles (in Java)

Comment on this tutorial

Subscribe to Tutorials

Related Tutorials

Archived Comments

1. This tutorial is really good for beginners.It help
View Tutorial          By: Prabhat Kumar at 2007-04-09 05:02:02

2. Great one on java-xml binding..
View Tutorial          By: Ranadeep Roy at 2008-07-03 23:15:22

3. This tutorial is really fantastic.It helped me a l
View Tutorial          By: Rakesh Verma at 2008-06-25 13:25:23

4. great work
View Tutorial          By: Dinesh557 at 2008-09-25 00:27:59

5. This tutorial is good for beginners. If you provid
View Tutorial          By: Sateesh Bobby at 2008-12-09 23:56:18

6. It was really helpful.... i cleared my lab test wi
View Tutorial          By: kishore at 2009-01-21 22:30:08

7. This tutorial is very nice for beginners.
View Tutorial          By: Wakil Ahamad at 2009-02-07 05:58:31

8. Hai,
I have stil problem with generate XML

View Tutorial          By: Priyan at 2009-04-06 12:08:42

9. i found this tutorial very useful... i need to kno
View Tutorial          By: Anonymous at 2009-04-14 21:09:20

10. very good tutorial
View Tutorial          By: Anonymous at 2009-06-13 01:14:25

11. This tutorial is very much useful for me to develo
View Tutorial          By: R. Lawrance at 2009-07-26 22:03:15

12. grt tutorial
View Tutorial          By: sss at 2009-08-30 03:33:13

13. i am getting the following error:
cannot fi

View Tutorial          By: santhosh at 2009-09-24 09:13:57

14. Good one.. great for beginners..
View Tutorial          By: varun at 2009-09-29 14:18:04

15. Great help
View Tutorial          By: Rajeshvar at 2009-11-04 08:43:09

16. Good for Beginners
View Tutorial          By: Srinivasula Reddy at 2009-11-05 02:04:25

17. I really thanks to you for providing wonderful inf
View Tutorial          By: Chandra Sekhar Puli at 2009-11-07 04:03:44

18. I really thanks to you for providing wonderful inf
View Tutorial          By: Chandra Sekhar Puli at 2009-11-07 04:05:07

19. I went befly through this, it is woderful, usefull
View Tutorial          By: Mallikarjuna.N at 2009-11-28 11:41:58

20. This example is very good and useful. I request yo
View Tutorial          By: Ambarisha Malladi at 2010-02-10 22:50:38

21. Wow Such a good tutorial. It really really make me
View Tutorial          By: Anonymous at 2010-02-19 05:53:11

22. Very Useful tutorial for beginners.. Thanx
View Tutorial          By: Rohini at 2010-02-23 23:16:16

23. The code is really helpfull...
reading or w

View Tutorial          By: sharda at 2010-03-11 03:28:02

24. Very good example with explaination and sample cod
View Tutorial          By: plenitude at 2010-04-15 23:55:02

25. This tutorial is really fantastic.It helped me a l
View Tutorial          By: LakshmiNaryana Gorantla at 2010-04-19 23:35:45

26. This tutorial is really fantastic.It helped me a l
View Tutorial          By: LakshmiNaryana Gorantla at 2010-04-19 23:40:31

27. Buenisimo tutorial, este rebuena la cosa
Gr

View Tutorial          By: Popoca at 2010-04-20 15:50:29

28. Thanks to the author, it was really a good tutoria
View Tutorial          By: Ashok Kumar at 2010-04-29 05:54:47

29. Thanks a lot :-) It is very informative
View Tutorial          By: praveen at 2010-05-03 22:17:19

30. Highly appreciatable.Excellent Docs.
View Tutorial          By: Debi P Naik at 2010-05-04 05:55:45

31. This article was surely very veryyy helpful ... Th
View Tutorial          By: Winnie at 2010-06-09 04:42:32

32. really a gud work for xml parsing readers
View Tutorial          By: shreya at 2010-07-02 02:35:04

33. instead of this u can use shine pattern

View Tutorial          By: omid at 2010-07-02 13:50:54

34. Hi
Gr8 work......!!!!
thanks...!!!

View Tutorial          By: Antim Jain at 2010-07-12 23:44:14

35. thankyou so much..!!!
i think self explanat

View Tutorial          By: Akash at 2010-07-29 07:08:22

36. Thanks to you for providing such a wonderful infor
View Tutorial          By: Tara Patra at 2010-08-30 07:22:44

37. This is really a tremendous tutorials for the begi
View Tutorial          By: Raghvendra Dwivedi at 2010-09-01 10:22:42

38. really a big salute for this notes
View Tutorial          By: SUNDARARAJ VELUSAMY at 2010-09-14 23:39:48

39. really a big salute for this notes
View Tutorial          By: SUNDARARAJ VELUSAMY at 2010-09-15 19:46:09

40. Good explanation on how to parse.

Y

View Tutorial          By: Sravan at 2010-10-05 05:16:39

41. It is a good tutorial but I think the "Instru
View Tutorial          By: Jaypee at 2010-10-10 22:40:50

42. Perfect parser example for beginners.


View Tutorial          By: GS at 2010-10-13 02:29:58

43. I've been struggling with this for a while now. Th
View Tutorial          By: Deb at 2010-10-14 11:36:33

44. Many thanks for this tutorial. Exactly what I was
View Tutorial          By: Fedor Emelianenko at 2010-10-28 08:01:17

45. I have modified this example a bit and I'm using a
View Tutorial          By: Lee Murray at 2010-11-02 03:41:56

46. good idea
View Tutorial          By: RURU at 2010-11-17 02:21:40

47. This is a great tutorial. I have a slight problem,
View Tutorial          By: Vix at 2010-11-22 13:42:03

48. Hi,
Its good but you can make it more bette

View Tutorial          By: vishakha sharma at 2010-12-15 06:13:56

49. Hi,
Its good but you can make it more bette

View Tutorial          By: vishakha sharma at 2010-12-15 06:14:52

50. very good to start with. really helpful. Thanks fo
View Tutorial          By: Muralidhar Yaragalla at 2010-12-24 02:42:08

51. thanks it usefull
View Tutorial          By: sherief at 2011-02-03 03:38:49

52. I just hope everyone who writes on the internet is
View Tutorial          By: Alok Chandna at 2011-02-23 07:16:10

53. This is very useful example for beginners.

View Tutorial          By: Amresh at 2011-02-28 22:20:11

54. It is an excellent article. Please keep up the goo
View Tutorial          By: sanjay at 2011-03-09 03:17:45

55. Excellent article
View Tutorial          By: JJ at 2011-03-21 13:42:35

56. Good article..
View Tutorial          By: Sudarshan at 2011-03-28 02:57:53

57. This is good for beginners.
View Tutorial          By: sathish at 2011-04-05 11:37:30

58. this site and document good for the starter. Thank
View Tutorial          By: davit off at 2011-04-17 06:57:02

59. I want to parse a xml content some think like bel
View Tutorial          By: sagar at 2011-04-20 00:59:06

60. great work..keep it up.
View Tutorial          By: faizaan at 2011-04-29 12:23:39

61. fantastic explaination about XML parsers
View Tutorial          By: smitha at 2011-05-15 04:53:00

62. Very usefull tutorial, but I've got a question:
View Tutorial          By: Wolfgang Marcos at 2011-05-16 11:12:19

63. As a beggnar, i find it varry varry usefuull.... P
View Tutorial          By: Rameeza at 2011-05-17 03:14:50

64. XML Parsing - Simplified.
Thanks.

View Tutorial          By: Piyush at 2011-05-19 22:56:23

65. Hello all,Actually i want xml parser in blackberry
View Tutorial          By: arun at 2011-06-01 06:17:16

66. very nice tutorial.
Thanks..

View Tutorial          By: Ramar at 2011-06-16 08:16:14

67. very helpful & gud tutorial...
thanks..

View Tutorial          By: Narpinder Sharma at 2011-06-27 03:12:20

68. xml response is :

<?xml version=

View Tutorial          By: Madhu at 2011-06-29 09:47:51

69. Very nice tutorial.It helped me a lot cos i am a b
View Tutorial          By: Fara at 2011-07-01 10:53:44

70. thnks 4 giving us nice tutorial, any one need more
View Tutorial          By: kamran ul haq at 2011-07-05 15:45:03

71. very helpful.
View Tutorial          By: arjun at 2011-07-19 03:19:44

72. bo mast...
View Tutorial          By: Ankit at 2011-07-30 04:49:19

73. hello,thanx its really great
View Tutorial          By: sadhana at 2011-08-05 09:35:00

74. Why you have installed virus on your website..Not
View Tutorial          By: youspammer at 2011-08-22 11:54:53

75. Thank you for this. I am a beg and this is making
View Tutorial          By: mac at 2011-08-23 13:47:15

76. You save my time. Thanks a lot
View Tutorial          By: Rangalal at 2011-09-09 11:05:47

77. Very helpful stuff. Might I just add that you didn
View Tutorial          By: Donovan Aces at 2011-09-12 06:08:20

78. A wonderful tutorial to learn XML Processing with
View Tutorial          By: Madhan at 2011-09-13 19:37:08

79. to Donovan Aces #61, thank you, I am new to java &
View Tutorial          By: Joe at 2011-09-14 22:40:19

80. i have a question..i need to parse an xml file wit
View Tutorial          By: meltd0wn at 2011-09-30 08:36:51

81. Its a good tutorial to xml beginners ,it gives mo
View Tutorial          By: venkateswarlu amaresam at 2011-10-03 10:53:04

82. Thanks
View Tutorial          By: Yesw at 2011-10-20 10:36:32

83. Thanks this is a great tutorial.
View Tutorial          By: akmit at 2011-10-21 00:32:20

84. Realy good one
View Tutorial          By: Sabir at 2011-10-25 12:08:43

85. Really very nice and step by step explanation hel
View Tutorial          By: sabarish at 2011-11-08 06:47:49

86. Nice basics. Very helpful
View Tutorial          By: Gorav at 2011-11-11 12:46:28

87. where do i download the DOM and SAX jar?
View Tutorial          By: David at 2011-11-11 03:04:11

88. nice one ...
View Tutorial          By: vamsi at 2011-11-11 06:41:25

89. The SAX Parser code has a problem for files of gre
View Tutorial          By: Mark Nelson at 2011-11-14 20:16:41

90. Many thanks for this tutorial - it has saved me so
View Tutorial          By: Ehsan at 2011-11-20 23:11:16

91. Many thanks for this tutorial - it has saved me so
View Tutorial          By: Ehsan at 2011-11-20 23:12:21

92. clearly explained the pgm logic....
thnx...

View Tutorial          By: Akshaya at 2011-11-24 04:12:36

93. import javax.xml.parsers.DocumentBuilder;
i

View Tutorial          By: Shane P at 2011-12-05 11:27:38

94. the DomParserExample.java shows MAlformedURLExcept
View Tutorial          By: dipesh at 2011-12-09 09:53:46

95. Thanks for the clear explanation..
Really h

View Tutorial          By: Swj at 2011-12-30 05:55:26

96. Which one is fast in parsing XML?
View Tutorial          By: Developer at 2011-12-30 09:27:37

97. Hi all

I am using getAttribute but

View Tutorial          By: Suvarna at 2012-01-12 06:56:55

98. Excellent tutorial thank you very much.

View Tutorial          By: Edd at 2012-01-15 10:49:00

99. Many thanks for this tutorial...Too good
View Tutorial          By: Sachidananda at 2012-03-29 10:31:33

100. Very useful, concept is very clear... Many thanks
View Tutorial          By: Kamali at 2012-04-25 08:45:44

101. Very helpful.
View Tutorial          By: Krishna at 2012-06-14 10:25:00

102. where i can find jar files?
please tell me

View Tutorial          By: chandu at 2012-06-17 14:14:28

103. Very helpful!!
View Tutorial          By: mahesh at 2012-07-12 06:24:50

104. Good tutorial for XML parsers , thanks author
View Tutorial          By: Raju Surarapu at 2012-07-16 13:35:48

105. Awesome tutorial
View Tutorial          By: Anonymous at 2012-12-13 06:50:36

106. Hi there is a good blog on working with xml files
View Tutorial          By: Imad Eddin at 2012-12-21 19:49:15

107. Thanks alot that was quite helpful!
View Tutorial          By: Doaa at 2013-01-09 09:37:35

108. Bravo!!
View Tutorial          By: se7en at 2013-01-09 12:45:09

109. Hi
here is a useful link for reading XML i

View Tutorial          By: Imad Eddin at 2013-01-20 16:30:07

110. Hi mate,
When I compile the DomParserExampl

View Tutorial          By: Suresh Kumar D at 2013-06-25 07:06:19

111. This is the helpful Site for beginner....!!!!!!!!!
View Tutorial          By: Anup at 2013-07-26 13:40:49

112. Where should I put the xml file ???
View Tutorial          By: Marya at 2014-03-21 15:57:40

113. Where should I put the xml file ??????????
View Tutorial          By: Marya at 2014-03-21 16:01:13

114. Great tutorial
View Tutorial          By: Stephen at 2014-07-21 12:08:32

115. how to read any xml file or i want to a universal
View Tutorial          By: shankar lal at 2014-09-29 12:40:20

116. You may add STAX parser example also to complete t
View Tutorial          By: Satyam Jaiswal at 2014-11-25 05:48:59

117. really helpfull :) thanks
View Tutorial          By: Jagan at 2014-12-09 10:16:56

118. Hi All,

Can any one please let me k

View Tutorial          By: Deepak at 2015-03-19 15:24:40

119. Nice tutorial, I got how it's done, but the differ
View Tutorial          By: FriendlyNoob at 2015-07-20 17:27:08

120. how to extract specific tags from xml file having
View Tutorial          By: shree at 2016-02-04 06:46:58

121. I m getting error in void function in very first l
View Tutorial          By: ayush` at 2016-10-12 06:19:01

122. Ruslpaisy
View Tutorial          By: Ruslpaisy at 2017-01-15 00:11:40

123. I must say you have hi quality articles here.

View Tutorial          By: 89Audra at 2017-03-27 23:47:07

124. I see your website needs some fresh & unique a
View Tutorial          By: KZYJaxongiab at 2017-04-12 20:10:50

125. anietumuoceyo
View Tutorial          By: anietumuoceyo at 2017-04-23 03:37:56

126. uahaxalimahe
View Tutorial          By: uahaxalimahe at 2017-04-23 03:41:00

127. irajasamikny
View Tutorial          By: irajasamikny at 2017-04-23 03:55:06

128. uyeyideyeb
View Tutorial          By: uyeyideyeb at 2017-04-23 04:13:54

129. alejela
View Tutorial          By: alejela at 2017-04-23 04:16:46

130. irutaribir
View Tutorial          By: irutaribir at 2017-04-23 04:22:41

131. Hi admin it was hard to find this post in google.
View Tutorial          By: DoraBee at 2017-06-06 01:02:51

132. My brother recommended I would posseibly like this
View Tutorial          By: sensuality models barcelona at 2017-08-12 17:02:12

133. esiqohiokole
View Tutorial          By: esiqohiokole at 2017-08-27 19:36:22

134. eweridnoc
View Tutorial          By: eweridnoc at 2017-08-27 19:44:58

135. Thanx a lot.You save my time!!!.
View Tutorial          By: Thiraj Senevirathne at 2017-09-13 16:32:01