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 :->

<test>
<test1>hello1</test1>
<test2>hello2</test2>
<test3>hello3</test3>
</test>

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

}

Recommended Answers

All 3 Replies

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

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

Thanks You for ur valuable reply..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.