954,148 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Xml Parsing using Sax

Hi friends,

please help me to solve this.

i need to read the elements from xml file.I am using sax api.

My xml looks like this :->

hello1hello2hello3

In my startElement(...){

elementName.equals("test"){

//I need to get all the elements inside the test element.ie test1,test2,test2.with out going to the endElement.Is there any method to solve thses problem

}

sarath.koiloth
Light Poster
30 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
 

Nevermind. Totally misread, I was assuming you were trying with regex.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

Unless you are parsing XML streams, you would find it simpler to use the DOM parser, which uses a Document model instead of the event-driven stream parsing of SAX.

Info on using both types of parsers is here:
http://java.sun.com/xml/tutorial_intro.html

Ezzaral
Posting Genius
Moderator
15,985 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

Thanks You for ur valuable reply..

sarath.koiloth
Light Poster
30 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You