nsxmlparser

Core Data with NSXMLParser on iPhone saving object incorrectly

Hey Folks, I'm new to Objective-C, XCode and iPhone development in general and I'm having some issues with Core Data and NSXMLParser. Having followed Apples' tutorials SeismicXML (for NSXMLParser) and the Core Data on iPhone tutorial I've ran into an issue when assigning values to my Managed Object Models' entities properties. To expl...

NSXMLParser ignores element named <id>

Hi there, I'm using Wordpress's XML-RPC framework in my project. Now I have a situation where in the XML response there is a tag named which contains user data and by the time the response has been parsed and returned as some array format, that tag and it's value are gone. I have traced this down to NSXMLParser's parse method. Anyone ...

NSXMLParser Question

I'm writing a RSS feeder and using the NSXMLParser to parse an XML page for me. Everything works well. This is the code that handles the asynchronously connection: static NSString *feedURLString = @"http://www.example.com/data.xml"; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:feedURLString]]; feed = [[[NSU...

NSXMLParser init with XML in NSString format

Hi I just ran into this one and couldn't seem to get any clear answer from the documentation. Im retrieving some XML through a HTTPS connection. I do all sorts of authentication etc. so I have a set of classes that deals with this in a nice threaded way. The result is an NSString that goes something like: <response> //some XML formatt...

XML parses with extra whitespace

Hi I have an XML file that looks like this: <?xml version="1.0"?> <categories> <category id="1"> <category_name>Banks</category_name> </category> <category id="4"> <category_name>Restaurants</category_name> </category> </categories> The [xmlParser parse] method returns TRUE without errors. But when i print out...

NSXMLParser initWithContentsOfURL timeout

How can I set a timeout when I am parsing a feed using initWithContentsOfURL. Sometimes our feeds return a blank response and then it will just try to parse the feed forever. I want to set a timeout of 30 seconds or so that will pop up a UIAlertView and then try and reparse the feed. NSURL *feedURL = [[NSURL alloc] initWithString:...

Memory leak in NSMutableDictionary, NSArray in NSXMLParser

I'm suffering from a bad memory leak parsing one of my xml documents. I'm using the NSXMLParser to iterate each node (album in the xml sample below), then iterate each photo node and add the result to an NSArray. I have 2 retained properties, which store two values on each loop. These values are added to a NSMutableDictionary object a...

Objective-C Delegates: Have another class I call that parses XML. Need to know when its done externally

Hi guys, I have a class that calls another class to parse (NSXMLParse) from a URL. Now I would like for the class calling this one to know when it has finished, so that I can populate the UI. I am guessing a delegate would be the way to go but ive never worked with one and would need some guidance as to how this would be wired. Thanks ...

iPhone Parse Local XML File

I have an iPhone app that does XML parsing from a URL. I have a sample.xml file in my Resources directory (in XCode) that I'd like to use for testing. How do I reference this file in code? I've tried @"sample.xml" as the URL and it doesn't appear to be able to find it. ...

Make NSXMLParser skip an Element

Hi, I'm using NSXMLParser on an iPhone App to parse HTML Files for a RSS or Atom Feed Link. Everything works fine until the parser find a <script> element that includes Javascript code without the CDATA Declaration, this causes a Parse Error. Is possible to tell the parser to skip all the elements named <script>? ...

Objective-C libraries for XML Parsing

Hi all, I would like to know some libraries in objective-C for xml parsing. I think it is a very common need, but I found limited resources for handling this task: Google Code projects: TouchCode (TouchXML) NSXMLParser What is your best solution to work with XML in objective-C language? Please advice. What is the solution that you ...

NSXMLParser - Parsing special chars in XML

Hi, I'm currently learn iphone app programming. Its an xml parsing app. In XML, I have an entry as follows: <text box-opacity="0.75" boxrcolor="1.0" boxgcolor="1.0" boxbcolor="1.0" boxalpha="0.75" textrcolor="0.00" textgcolor="0.00" textbcolor="0.00" textalpha="1.0" show-box="true"> Once upon a fliegen über time, there was an old...

Simple way to parse XML to an tableview Objective C

For an iPhone application I need to request data from an online database. I choice to use for an restful web service. Main reason because it will connect to an JAVA server. I did find a useful wrapper that helps me to get the data but now I need a good workaround to play with the data. The output is XML. If it is better to use JSON or s...

How to use NSXMLParser to parse parent-child elements that have the same name

Hi everyone, Does anyone have some idea how to parse the following xml using event-driven model NSXMLParser class? <Node> <name> Main </name> <Node> <name> Child 1 </name> </Node> <Node> <name> Child 2 </name> </Node> </Node> I want to collect all three names from this xml file, is it possible, or I have to change ...

Parsing XML for iPhone (aMule downloads/ search results)

I am currently working on a software to control aMule status of my server through the iPhone, i created a socket that spits out xml which should be parsed out, but because NSXMLParser is event-drive, i'm having problems in understanding how this could work... I thought of this type of XML structure, if you have ideas of a better way to s...

How to log nsxmlparser

I'm parsing an xml from an url, by rssParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL]; [rssParser parse] How to NSLog it so as to see the xml in console??? If i use NSLog ("%@",rssParser); i'm showed wit 'XMLParser x 4d562' in the console ...

Check if an XML document is empty using NSXMLParser

Im writing an iPhone app which retrieves data from a web service as XML. If no data is found by the web service, it returns an empty document like <?xml version="1.0"?> <root_element/> This data is being parsed and then added to an array and subsequently a table view. In my -numberOfRowsInSection I have return [self.array count]; Bu...

strings invalidated after parser finished, iphone

I've parsed an xml and stored the parsed data on strings which are property declared, retained and synthesized, the values are getting into these strings during parsing, but are being invalidated after the parser finish parsing. I'm not able to access them from another IBAction method, where i get EXEC BAD ACCESS error, which, from my ex...

NSXMLParser ownership on data

Hi, I init my NSXMLParser with a mutable data, that I get from the internet. I wonder whether the parser releases it on its deallocation or I have to release it after the parsing? Thanks ...

Pattern for XML Parsing in iPhone..

I have a web service which returns certain "models" of which are all defined by a class in objective-c. Calls to RESTful methods will return either a singular model XML or a list of model XML elements. <widget> <a>foo</a> </widget> or <widgets> <widget> <a>foo</a> </widget> .... <widget> <a>foo</a> </widget> </widget...