Here is the method. Create an mutable array to store the contents of xml. In the delegate methods do the following.
Up vote 0 down vote favorite share g+ share fb share tw.
I have problems regarding the output of the XMLReader , which should be able to parse any SOAP-Result into an NSDictionary. When I go through the results I get the following: Key: soapEnvelope, Value: {the rest of the xml-file to the end, with all tags, but it seems to be a long string} What am I doing wrong here since I expected to get a NSDictionary with all of my XML-Tags as a key? Edit: Since I´m working and trying to understand this since days, I may be totally in the wrong direction, so if possible... here´s my XML: 1 90 14 352 352 90 14 352 352 Juhu!
When I want to have Lets say NoOfObjectsDetected in an int - what exactly do I have to do? (It´s stupid, I know... but I´m lost atm... thx) iphone soap xml-parsing xmlreader link|improve this question edited Jul 29 '11 at 12:18 asked Jul 29 '11 at 9:38Schwennz33.
Here is the method. Create an mutable array to store the contents of xml. In the delegate methods do the following: nsmutablearray noOfObjetcsArray; nsstring elementNameStr; -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)atributeDict { if (elementName isEqualToString:@"NoOfObjectsDetected") { noOfObjetcsArray =nsmutablearray alloc initwithcapacity:0; elementNameStr = elementName; } } -(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if (elementNameStr isEqualToString:@"NoOfObjectsDetected") { noOfObjetcsArray addObject:string; } } when parsing is complete you will get the contents in the array.
Since you want it as an int value, wherever you use this value jus give: noOfObjetcsArray objectAtIndex:0 intValue this will convert string to int value. Thats the way you can get teh value. Try it.
All the best :) }.
Thats it! Thanks! – Schwennz Sep 9 '11 at 9:20.
Self. ElementsValues setObject:self. CurrentElementValue forKey:elementName; Here elementsValues is type of NSMutableDictionary.
CurrentElementsValue is the value of current tag. And elementName is current tag. Free to ask questions if this is not clear.
Since I´m working and trying to understand this since days, I may be totally in the wrong direction, so if possible... here´s my code: – Schwennz Jul 29 '11 at 12:16 Sorry, Edited above for the xml – Schwennz Jul 29 '11 at 12:21 First you need to read tutorial about xml parsing.stackoverflow.com/questions/2005... – Harsh Jul 29 '11 at 12:38 icodeblog.com/2008/11/03/… – Harsh Jul 29 '11 at 12:40 I did. A couple of times. Still lost.
– Schwennz Jul 29 '11 at 13:16.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.