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
Related
I just implemented my first XmlParser object (MyParserObj) that relies on the NSXMLParser object.
This parser is embedded inside a tableviewController (MyTableViewController) and it starts parsing at MyTableViewController's viewDidLoad method.
Ok.This is working just fine.It's a small Xml file though! I was wondering if I should choose a different approach when dealing with big Xml files? Will memory suffer when parsing large xml documents?
UPDATE
The real point I want to understand is the flow of the process:
I placed few breakpoints now and it looks like this:
the app first encounters ( inside MyTableViewController's viewDidLoad method )the [MyParserObj parseXMLFileAtURL:path] and starts parsing the Xml document;
The app finishes parsing the whole Xml Document (parserDidEndDocument..);
The tableviewController starts populating its tableView Cells (cellForRowAtIndexPath..);
Apart from choosing a XmlParser (Between those you suggested) that is more or less time/memory consuming are the above steps going to be the same?
If positive, is it correct to think of starting populating the cells as soon as The Parser is done with that specific element?How do I do that?
thanks
Luca
Jim Dovey create a nice blog post about parsing big XML files.
http://blog.alanquatermain.me/2009/04/06/aqxmlparser-equals-equals-big-memory-win/ here Jim describes his one XML parser wich user les memory then other parser.
So if you need to parse large XML files I would suggest you have a look het the open source XML parser AQXMLParser which is the parser create in the blog post.
On iPhone devices, you don't have the NSXMLDocument available on MAC which reads the whole XML document into memory. There are many XML Parser classes available, and you can find them in the link below.
http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project
This tutorial on Ray Wenderlich is what u need to read to know which xml reader is best for your app.
For my own applications, I use SMXMLDocument, you can read about it here:
http://nfarina.com/post/2843708636/a-lightweight-xml-parser-for-ios
for big data, i suggest u json instead of xml, see here a tutorial
http://www.readwriteweb.com/hack/2010/11/json-vs-xml.php
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
in my current project i need to create one xml file and send it to server.
i searched many sites a got information about some API like
NSXML (now its deprecated)
http://onlinefreecomputertutorials.blogspot.in/2011/07/how-to-read-and-write-xml-documents.html
GDATAXML (now its deprecated)
http://www.raywenderlich.com/725/how-to-read-and-write-xml-documents-with-gdataxml
please if is there any API i can use to create xml or you have any idea just share with me or any link for tutorial to create xml in objective c.
thanks for any help.
Use TCMXMLWriter. It's a small XML library with a very nice syntax.
I am trying to do following task. I know we can read XML in iOS using a parser, but can we locally update the same XML?
1) Read XML from local resource folder.
2) Update XML. Locally change value of a tag.
Thanks for your help.
If you just need to read the XML you can use the native NSXMLParser. If you need to change the XML you can use TouchXML. You can get a good tutorial on how to use TouchXML here. Also interesting discussion of the various options here.
I'm using an NSXMLParser to read data out of a XML, but how can I make my iPhone App storing data into this specific XML.
The case is that I want to create an app to display available dates and one that administrates this dates, whether they are available or not (I'm using an UISwitch to handle this).
Thanks for your answers,
btype.
If you have small amount of data, you can save them in a plist.
See Property List Programming Guide
There's a github project that let's you create XML DOM objects. You can save your XML to your documents folder on the phone.
https://github.com/arashpayan/apxml/