-1

Hi i need to parse an xml file whose structure is as shown below in NSXMLParser,

<Root>
    <Ancor>
        <A1>,,,,,,,</A1>
        <A2>,,,,,,,</A2>
        <A3>,,,,,,,</A3>
        <subContent>
            <![CDATA[,,,,,,,,,,,,,,,,,,,]]?
        </subContent>
    </Ancor>

    <Main id="1">
        <Basic>,,,,,,,</Basic>
        <Info>
           <info1>,,,,,,</info1>
           <info2>,,,,,,</info2>
           <info3>,,,,,,</info3>
             <subInfo id="1">
               <subcontent1>,,,,,,</subcontent1>
                   <subcontent2>,,,,,,</subcontent2>
             </subInfo>
            <html>
              <![CDATA[,,,,,,,,,,,,,,,,]]>
            </html>
        </Info>
    </Mainid>
</Root>

Here inside main tags called Root n number of Main tags will come based on different different id,each Main tag contents i need to store and display in 1 page. Can anybody help with some snippets of code?,Any help is appreciated in advance , Thank You.

George
  • 352
  • 2
  • 5
  • 15
  • possible duplicate of [How to read in and parse an XML file on the iphone?](http://stackoverflow.com/questions/2097631/how-to-read-in-and-parse-an-xml-file-on-the-iphone) – jscs Sep 26 '11 at 17:55
  • also: [1](http://stackoverflow.com/questions/2237757/cocoa-objective-c-best-practice-to-parse-xml-document) [2](http://stackoverflow.com/questions/3729514/sending-and-receiving-xml-to-and-from-server-using-cocoa) [3](http://stackoverflow.com/questions/2964503/nsxmlparser-on-the-iphone-how-do-i-use-it-given-a-xml-file-newb-here) [4](http://stackoverflow.com/questions/3731453/parsing-xml-in-cocoa) [5](http://stackoverflow.com/questions/3731594/) [6](http://stackoverflow.com/questions/5274513/) [and so on...](http://stackoverflow.com/search?q=%5Bobjc%5D+xml+file+parse) – jscs Sep 26 '11 at 17:57

1 Answers1

1

xmlparser can detect the tags on its own .. all you need to do is compare the tags in delegates and get the values out... hope this helps..

Ankit Srivastava
  • 12,347
  • 11
  • 63
  • 115