how to create XML Doc in ios - iphone

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.

Related

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

How can I parse and update local XML in iOS?

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.

how to integrate generated web services stubs file into Xcode

I am doing a project where iphone or ipad is a client side..
problem here is using WSDL file we have generated stubs using a software...
the generated stubs are in the format .h and .m file
but how to run this file in xcode or integrate with the xcode....
I am not getting any links or tutorial to do so please suggest me how to do.
Thank u
Depends on a software that you have used to generate proxy classes from wsdl. We have successfully used http://code.google.com/p/wsdl2objc/, and just added generated files to project (project->add existing files). Bear in mind that those are just proxy classes, project structure and code to consume the webservice you have to write on your own.
Its depend upon the type of web service are generated. If its XML outputted web service , then you need to use nsxmlparser to parse the XML web-service.And if its outputted as JSON then you had to use JSON parser etc. Therefore its depends upon type of your web-service is, then you can use suitable parser to parse the web service. There are several links available on internet.

iPhone HTML Parsing using TouchXML and tidy

I'm trying to parse HTML using TouchXML. However, it seems that the data I want to parse (I do not control the source, it's downloaded from the internet) is partially malformed - I get various errors during the parse. Therefore, it seems that I should be using the inbuilt tidy support to fix the HTML but I cannot seem to find any documentation or information on how to enable it or link libtidy successfully into my project.
If anyone has any information on how to do this, it'd be much appreciated. Alternatively if there's another tool I could be using to do this - do tell me!
Actually, you can both link to the framework and include the headers, without needing to download the source.
Link to the existing framework libtidy.dylib
Add /usr/include/tidy to HEADER_SEARCH_PATHS
Turns out that although the framework can be linked in to an xcode project, the headers are missing. I have got around this by downloading the HTML Tidy Source (src and include directory) and added them in to compile as part of my xcode project.

Tutorial or sample code for parsing xml file using libxml2 in IPhone Application

I just want a tutorial demonstrating the parsing of XML File using libXml2 in Iphone . I found tutorials on TouchXMLand other but not the same for Libxml2
Please help if u can.
Apple has an example iPhone project that parses some simple XML using both NSXMLParser and libxml2 SAX2. You can find the project here:
http://developer.apple.com/iphone/library/samplecode/XMLPerformance/Introduction/Intro.html
Although this isn't exactly a tutorial, it is working code. It runs in the simulator out of the box. Because it accomplishes the same task twice, you should be able to compare the libxml2 code to the NSXMLParser code to figure out what's going on.
Not even these?
I recommend TBXML. I use it everytime I need to parse a XML File. It's really easy to use. ;-)
See here: TBXML Homepage
A good sample is:
http://bill.dudney.net/roller/objc/entry/libxml2_push_parsing