-2
<tickettypes>
    <eventid>8</eventid>
    <eventname>air</eventname>
    <tablename>tbl_tickets</tablename>
    <ticketid>1</ticketid>
    <name>Platinum</name>
    <price>200.00</price>
    <printable>Y</printable>
    <ticketid>2</ticketid>
    <name>Gold</name>
    <price>150.00</price>
    <printable>Y</printable>
    <ticketid>3</ticketid>
    <name>Silver</name>
    <price>100.00</price>
    <printable>Y</printable>
    <ticketid>4</ticketid>
    <name>Test</name>
    <price>50.00</price>
    <printable>Y</printable>
     <surveys>
    <surveyid>0</surveyid>
    <surveyname>No Survey entered</surveyname>
    <surveyid>1</surveyid>
    <surveyname>Advertisement</surveyname>
    <surveyid>2</surveyid>
    <surveyname>Friends</surveyname>
    <surveyid>3</surveyid>
    <surveyname>Web Reference</surveyname>
    <surveyid>4</surveyid>
    <surveyname>News Paper</surveyname>
    <surveyid>5</surveyid>
    <surveyname>portals</surveyname>
    </surveys>
</tickettypes>

can any one please help me how to parse the following xml file

Bart Kiers
  • 166,582
  • 36
  • 299
  • 288
SURYA KARUTURI
  • 119
  • 4
  • 16

2 Answers2

2

The best way to read XML in Android is to use the Simple XML Framework. If you want a step by step guide then you should take a look at the blog post on the topic that I wrote. If you knew simple then this would take you all of ten minutes to write the code that can parse it.

Robert Massaioli
  • 13,379
  • 7
  • 57
  • 73
1

There are quite a few examples of this online; the first page of a Google search "parse xml in java" was filled with examples.

http://www.java-samples.com/showtutorial.php?tutorialid=152

http://www.totheriver.com/learn/xml/xmltutorial.html

http://www.developerfusion.com/code/2064/a-simple-way-to-read-an-xml-file-in-java/

Suroot
  • 4,315
  • 1
  • 22
  • 28