开发者

How to Parse my nested xml?

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 appreciate开发者_JAVA百科d in advance , Thank You.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜