0

I have an xml which i want to parse it , i succesed to do this but i have a question about the structure of this xml .

<BIBLEBOOK bnumber="1" bname="Genesis" bsname="Gen">
    <CHAPTER cnumber="1">
      <VERS vnumber="1">At the first God made the heaven and the earth.</VERS>
      <VERS vnumber="2">And the earth was waste and without form; and it was dark on the face of the deep: and the Spirit of God was moving on the face of the waters.</VERS>

How can i get the value for bname ?

This is how i parse the xml:

 NSString *xmlString = [[NSBundle mainBundle] pathForResource:@"basic_english" ofType:@"xml"];
    NSData *xmlData = [NSData dataWithContentsOfFile:xmlString];

    NSString* dataStr  = [[NSString alloc] initWithData:xmlData encoding:NSUTF8StringEncoding];
    NSDictionary *xmlDoc = [NSDictionary dictionaryWithXMLString:dataStr];
Adina Marin
  • 663
  • 1
  • 4
  • 15

1 Answers1

0

Try this. Hope it will help you.

NSString *bname = [xmlDoc valueForKey:@"_bname"];
Vishnuvardhan
  • 5,081
  • 1
  • 17
  • 33