0

I have an xml file below.

<?xml version="1.0" encoding="utf-8"?>
<Rows xmlns="">
    <Row>"
       <Column0 title="Count"></Column0>
       <Column1 title="Quantity"></Column1>
       <Column2 title="Amount"></Column2>
       <Column3 title="Sample Time 24 Hrs">12:25</Column3>
       <Column4 title="Sample Time AM/PM">12:25PM</Column4>
       <Column5 title="Sample Date"></Column5>
       <Column6 title="Sample Timestamp"></Column6>
       <Column7 title="Name"></Column7>
       <Column8 title="paidOrNot"></Column8>
    </Row>
    <Row>
       <Column0 title="Count">-2,147,483,648</Column0>
        <Column1 title="Quantity">3.5</Column1>
       <Column2 title="Amount">$43.5</Column2>
       <Column3 title="Sample Time 24 Hrs">12:25</Column3>
       <Column4 title="Sample Time AM/PM">11:59PM</Column4>
       <Column5 title="Sample Date">2012-07-20</Column5>
       <Column6 title="Sample Timestamp">2012-07-20 12:25</Column6>
       <Column7 title="Name">abcd</Column7>
       <Column8 title="paidOrNot">N</Column8>
    </Row>
    <Row>
       <Column0 title="Count">2,147,483,647</Column0>
       <Column1 title="Quantity">3.5</Column1>
       <Column2 title="Amount">$43.5</Column2>
       <Column3 title="Sample Time 24 Hrs">12:25</Column3>
       <Column4 title="Sample Time AM/PM">11:59PM</Column4>
       <Column5 title="Sample Date">2012-07-20</Column5>
       <Column6 title="Sample Timestamp">2012-07-20 12:25</Column6>
       <Column7 title="Name">abcd</Column7>
       <Column8 title="paidOrNot">N</Column8>
    </Row>
</Rows>

When I parse it, foundCharacters is called after didEndElement is called when element has start and end element but has no value in it. I was assuming that delegate methods executes in order of didStartElement, foundcharacters, didEndElement. But I am wrong I think. Any Ideas?

Thanks, Jignesh

NetDeveloper
  • 509
  • 1
  • 9
  • 20
  • 2
    In didStartElement you might initialize a String variable to hold the value, append to this value in foundCharacters, then use the value in didEndElement. – CSmith Aug 08 '12 at 20:58
  • Thanks Smith for the reply but how can I get element value in didStartElement? – NetDeveloper Aug 08 '12 at 21:02

1 Answers1

0

I didn't know NSXMLParser doesnot ignore whitespaces which was a problem in my case.

NetDeveloper
  • 509
  • 1
  • 9
  • 20