nsxmlparser

iPhone - is it possible to delete an xml file at server after parsing it

hi guys, im currently parsing an xml file that is hosted on another PC via hosting a Apache http server which works fine. Now is it possible to code it in such a way that the iPhone deletes the xml file on that pc? im currently using a NSMutableURLRequest and setting it to an NSData. NSError * error; NSURLResponse * response; NSMuta...

NSXMLParser. How to parse KVC-plist-thingamajig-like XML?

So, basically I want to make objects "Songs" from iTunes Library.xml The problem is that XML-file looks more like .plist Here is an example: <key>56</key> <dict> <key>Track ID</key><integer>56</integer> <key>Name</key><string>apple-ipad-video</string> <key>Kind</key><string>QuickTime Movie</string> <k...

Code reuse when parsing XML using NSXMLParser (iPhone dev)

In an iphone application that I am building, I am parsing XML in a number of view controllers when they are loaded by a user. Every time I do this, I am doing the following: establishing an NSURLConnection (in viewDidLoad) storing the data retrieved and error handling (connection delegate methods) creating an NSXMLParser parsing the ...

NSXMLParser crashing on faulty xmls, no correct error handling?

Hi Anyone else experiencing crashes deep down in the iPhone libraries when NSXMLParser parses an xml containing errors? I thought it was supposed to call: (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError but instead it crashes the entire app somewhere inside _xmlRaiseError. Is anyone else experiencing thi...

iPhone NSXMLParser (Error 9)

Hi, i try to parse within my iPhone SDK 4 http://de.news.search.yahoo.com/news/rss?p=iphone&amp;ei=UTF-8&amp;fl=0&amp;x=wrt there are some german umlaute <description><![CDATA[Mehr als die Hälfte der Belegschaft des weltweit größten]]></description> As I read in another forum as long they are wrapped in CDATA it should be fine. But...

NSXMLParser and memory management issues

I've been trying to implement NSXMLParser and so far I've had memory issues, performance issues or it doesn't work. I worked originally from a example off the net and it leaked a heap of memory. I released the objects properly but found that there was a performance hit because I would alloc and then release each object for each element....

NSXMLParser memory leak on ios 4.0 - **NOT** NSCFString

Hello, I'm getting a weird leak in my NSXMLParser after it's done and released from memory. It comes up with NSMapTable alloc leak. Here's my stack: 0 libSystem.B.dylib calloc 1 libobjc.A.dylib _internal_class_createInstanceFromZone 2 libobjc.A.dylib class_createInstance 3 Foundation NSAllocateObject 4 Foundation +[NSM...

Issues with leaking XMLParser

I've been trying for some time now to get xml parser working leak free and efficient but so far unsuccessful. I've removed additional fields as they are all the same. - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary...

Help solving NSXMLParser error 39 : NSXMLParserAttributeNotStartedError

I've been searching for about two hours now trying to find out what this error is and how to solve it. Apple's documents gladly says NSXMLParserAttributeNotStartedError Attribute is not started. Available in Mac OS X v10.3 and later. Declared in NSXMLParser.h. but fails to provide any help whatsoever. Can anyone help me out h...

When to release a webservice communication object

I've asked this before but never got a clear answer, I think perhaps I was asking the wrong questions or maybe not clarifying my question so I'll try again. I have an app that needs to retrieve menu items, product details etc. from a server. I have the data retriever / parser as a separate object that I create when needed. I release it ...

How to get a DTD's public and system IDs with NSXMLParser

I'm trying to retrieve the public and system IDs for a DTD in an XML document via NSXMLParser. While NSXMLParser in principal offers publicID and systemID selectors they don't seem to work for me. The doctype tag looks like this: <!DOCTYPE Article PUBLIC "-//SoftQuad Software//DTD Journalist v2.0 20000501//EN" "file:///C:/Program%20File...

UITabelView reloaded from NSXMLParser (iphone SDK 4.0)

I am creating application that simply reads data from an XML file and displays it in a table view. I created a "refresh" button when clicked i want it to redownload the xml file and display it again however it seems to crash my application if there is a XML file already downloaded. - (BOOL)application:(UIApplication *)application did...

Why NSURLConnection blocks my UI? [Solved]

I've been reading several threads and questions about this issue but I didn't find the solution. I have some asynchronous calls performed with [NSURLConnection connectionWithRequest:anURLRequest delegate:self]; The problem is that I want the interface to be operative but it is blocked until the connection is finished. Is this solve...

AQXMLParser unable to parse byte-array?

I've a general question, I've been using NSXMLParser to parse a pretty large XML file containing byte array's of images sent from a web service to the iPhone. I tried switching to AQXMLParser to bring down the memory footprint however now I'm unable to decode my byte arrays in the same way. When parsing the URL I use foundCharacters t...

Parsing XML with encoding="windows-1252.

The following is my XML file. i am parsing it with NSXMLParser. But parsing methods have not been called. Any Solution ? Thanks. <?xml version="1.0" encoding="windows-1252"?> <typelokale> <post> <deptid>1</deptid> <department>Kontor</department> </post> <post> <deptid>2</deptid> <department>Butikk/Servering</dep...

Why is NSXMLParser picking up this whitespace in the foundCharacters method?

Hello. I'm learning to use the NSXMLParser API for the iOS platform and so far it's very easy to use. I'm having a small problem, however, in the foundCharacters method. As I understand it, it shouldn't pick up any whitespace since the foundIgnorableWhitespace method is supposed to catch that, but it looks like it is. Here's the my c...

What's the best approach for parsing XML/'screen scraping' in iOS? UIWebview or NSXMLParser?

I am creating an iOS app that needs to get some data from a web page. My first though was to use NSXMLParser initWithContentsOfURL: and parse the HTML with the NSXMLParser delegate. However this approach seems like it could quickly become painful (if, for example, the HTML changed I would have to rewrite the parsing code which could be a...

extract channel titel from RSS feed using NSXMLParser

Hi, how can I extract the titel of a RSS channel while not getting in conflict with the title element of a news item? If an element was found: - (void)parser:(NSXMLParser *) parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict { ...

What's the best way/library to parse and work with XML in Xcode

My teacher recommended TBXML so I used it, but I've noticed there are others such as the built-in NSXMLParser. Whatcha say? ...

Better illustrating error message for NSXMLParser

Hi, Now the user only get a error message like "Error code 5". NSString *errorString = [NSString stringWithFormat:@"Error code %i", [parseError code]]; UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error loading content" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [errorAlert show...