iPhone: xml parser for ajax - iphone

I'm developing an app for iPhone. I'm trying to parse an xml made with ajax, with a tag named response. The parser I've been using is TBXML, which performs pretty ok with any XML, but the ones made with ajax!
Is there another parser that can do this?

What do you mean for "xml made with ajax". the response should be the same. Or maybe do you get a json response? In that case you could use TouchJSON

Related

XML generation from data in core data iphone

I am going to make an application and in that I want to store user's input in XML file and then parse it to another user,So I am confuse How can I do it, and which XML method should I use? NSXML parser,libxml,touchXML or KissXML?
I think this link will help you to choose best type of xml parser.
How To Choose The Best XML Parser for Your iPhone Project
Thank You

How to create XML String in iPhone to use in web-service requests?

I want to create XML string to be sent to server through web-service. How do I do it natively in iPhone? Or do I have to use any third party library?
I was not able to download GDATA for iPhone. Any else available? Or any other way to do it?
Please help,
Thanks in advance.
You can create XML file with StringWithFormat method or Some of XML parser allow write XML as well. Please refer link of Parser for writing XML
http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project
You can use JSON parser also....
You may want to refer to SBJSON Framework which is frequently used for objective-C, I have used this framework in may of my iOS Apps.
You may get a reference about it from these links:
https://github.com/stig/json-framework
http://stig.github.com/json-framework/
Example Code: Also here is an example on, How to parse JSON with SBJSON Parser:
How to parse JSON into Objective C - SBJSON
http://jasarien.com/?p=428

parsing xml to json in iphone

Am writing one small application to parse from XML to JSON object for iphone. can anyone tell me the availability of open source library present to do the parsing usnig objective-c.
There are plenty of open source solutions in objective-c to deal with JSON :
JSONKit : https://github.com/johnezang/JSONKit
SBJson (aka json-framework) : https://github.com/stig/json-framework
YAJL Framework : https://github.com/gabriel/yajl-objc
To deal with xml, you can use the default NSXMLParser class or some other solutions like some code I've posted here (DOM parser) :
NSXMLParser retrieving wrong data from XML tags
You can also check this page which will give you a good overview of available solutions for XML parsing (and an explaination of differences between SAX and DOM parsers) : http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project
Well there is a json parser available for objective c on github. Its very simple to use. You may have to write some additional code to provide input to the parser.
I use NSPropertyListSerialization from Apple to turn a Plist XML into a dictionary. Then we just need to find something to go from dictionary to JSON.
The json-framework looks like a nice JSON generator.

Processing Non-Well-Formed HTML with DOM

I have got a HTML which has obtained from a web site's source code. Im sending data with post method from my page to the web site, and the response is source code. I need some text in the source.
The document is non-well-formed. So, i can not use DOM, and i can not separate tag and data with DOM.
How can i separate tag and data, and how can i get the only data?
I'm using PHP.
Thanks.
I found something about getting data from html source code. I said in question, im using PHP.
I will use preg_match_all function and regular expression. Hopefully, i can overcome ;)
Thx to all who interested ;)

How parse html string in iphone

i m using php file for using data in my application,
in this file i post data on the server and if i get the data from the server
then it is in html formate.
so problem is that i have a string with html tags how i use data in that string.
how i extract data from html string.
Use NSXMLParser class. it works for HTML too. There are three useful delegate methods.
If your HTML out put is some simple data - may be you can write some simple NSString parser your self like 'markhunte' mentioned, if you have large complex data in HTML then you have to go for some open source parsers.
Cocoa does not provide HTML parser, Forum discussion claims in some case XML parser itself work for you, but I never go it working for my data.
In my case I had very simple TAG which I had handled using my own parser using NSString.
I have used the code from --> Flatten-html-content-ie-strip-tags-cocoaobjective-c.
There are also examples of its use on SO.
Just use NSScanner, it is great for searching in between tags that are permanent. If you post some page code I help you set up the scanner.