views:

39

answers:

1

Hi,

I am new to XML parsing. I am parsing the following XML. There are tutorials for if XML has unique attributes but this XML has repeating attributes.

<?xml version="1.0" encoding="utf-8"?>
<start>
    <Period periodType="A" fYear="2005" endCalYear="2005" endMonth="3">
        <ConsEstimate type="High">
            <ConsValue dateType="CURR">-8.9919</ConsValue>
        </ConsEstimate>
        <ConsEstimate type="Low">
            <ConsValue dateType="CURR">-13.1581</ConsValue>
        </ConsEstimate>
    </Period>
    < Period periodType="A" fYear="2006" endCalYear="2006" endMonth="3">
        <ConsEstimate type="High">
            <ConsValue dateType="CURR">-100.000</ConsValue>
        </ConsEstimate>
        <ConsEstimate type="Low">
            <ConsValue dateType="CURR">-13.1581</ConsValue>
        </ConsEstimate>
    </Period>
</start>

I need to fetch the low and high values based on the years 2005 and 2006.

+1  A: 

I agree with SB's comment, if you wan't to handle xml-datastructurse, you should know at least the basic stuff.

A good tutorial i can reccomend is ww3 schools XML Tutorial

once you did that, you should know that there are several ways to parse xml files. For flatfiles i recommend to use the TBXML Library, it is really fast and easy to handle within your code.

samsam
hi, i want to know which delegate method i have to use through NSXmlparser?
Mikhail Naimy
well i think the answer you expect is not "per-se" available. i recommend the following links for you for further information : http://codesofa.com/blog/archive/2008/07/23/make-nsxmlparser-your-friend.html and http://developer.apple.com/mac/library/documentation/cocoa/reference/NSXMLParserDelegate_Protocol/Reference/Reference.html
samsam