how to parse using xml parser in iphone? - iphone

Am able to parse
< name>Walmart< /name>
using xml parser
but how to parse
*< s:image link="http://i.walmartimages.com/i/p/00/02/72/42/77/0002724277837_500X500.jpg"/>*
using xml parse in iphone.
Thanks in advance

There are various ways of doing this. My personal favorite is using Xpath via TFHpple. Xpath is clearly documented and easy to understand at W3schools. Sorry, I can't link to it. Spam filter prevents it.
I've used this approach for all sorts of things, and it is also great to note that you can use this library with HTML data as well.

I got the solution......
No need to go to parser libraries...
We can parse such tags using NSXMLParser with the help of attribute concepts....
thanks for you all for helping me....
cheers

Related

Post Data to a URL actionscript

I am having real trouble here. I am very new at Flash and have created a form that i then need to post the data to a URL. I have no clue how to do this and all i find online is information that include PHP.
Any help is appreciated and thank you in advance
which actionscript version are you using?
for actionscript2 you need to use LoadVars (sendAndLoad example here http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001161.html)
for actionscript3 you need to use URLRequest and URLLoader (example here http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html#includeExamplesSummary)
the actionscript3 reference is very horribly written and unreadable though, so you might want to check this post out http://labs.grupow.com/blog/2008/11/06/sending-variables-in-as3-aka-sendandload-in-as2

email header parser

I want to design an email header parser using c language.
I have the email header in text format, but i don't have any idea of how to
parse and extract information from it, and what is the relevent information
to be extracted.
If anybody have an idea of any programme please inform.
There are a lot of libraries in C++ that you could use or check out for clues, like these or mimetic.
I suggest you also check these out:
RFC2821 and RFC2822
One way to go about it is to use a regular expressions library. This is a good place to start: http://www.gnu.org/s/libc/manual/html_node/Regular-Expressions.html

Possible to parse this html with xpath?

I am working on gather sports statistics for a personal hobby project. I found this site with all the info I need:file:///Users/JohnJNichols4/Desktop/view-source%20cluster.leaguestat.com%20download.php%20client_code=ahl&file_path=daily-report%20daily-report.html
Am I able to parse this site with xpath? I only have experience (little experience) with cocoa and xcode, so I am writing this is objective c with a wrapper called hpple. My problem arises when I need to pull info from the tables. I have no idea how to go about this. The xpath expressions that I enter are all wrong. Can anyone show me how one might parse the standings in the first table? The function I am using is:
NSArray *elements = [xpathParser search:#"xpath stuff goes here"];
Thanks a lot!
EDIT URL
Sorry guys, I put up the local URL by mistake. Here is the right one: http://cluster.leaguestat.com/download.php?client_code=ahl&file_path=daily-report/daily-report.html
If you want to treat it as XML, you can, but it'll have to be properly formed, which isn't always the case with HTML. I'd recommend using the TouchXML library, it has great xpath support and a fair amount of documentation and examples.
http://foobarpig.com/iphone/touchxml-installation-guide.html

NSXMLDocument replacement on iPhone?

I have seen how an NSXMLDocument can parse an html document and provide easy methods for returning parts of the html structure.
Is there a similar method that can be used for the iPhone, as NSXMLDocument is not available?
Have you seen TouchXML?
http://code.google.com/p/touchcode/wiki/TouchXML
You might try this small document class which simply uses NSXMLParser:
https://github.com/nfarina/xmldocument
Also see this blog post:
http://notes.bikemonkey.org/post/47351363/googles-nsxmldocument-replacement-for-iphone
Google has written a replacement for some NSXML stuff for iPhone.

Example of ASIHTTPRequest with TouchXML

I am currently using NSXMLParser mathods to parse my data something like this :
But I found some good option as TouchXML .
I googled for some good example or tutorial
But I can't understand the XPathquery format and the parsing loops as done in this example
or this question
I just want to know how to parse a simple xml document like this :
<ElementsArray>
<ElementObject>
<element1></element1>
<element2></element1>
<ElementObject>
.
.
.
<ElementArray>
so can anyone give me example code or a link will also be useful.
The coolest part of using TouchXML is that you can use the Apple documentation for NSXML and simply replace the NS with C. So an NSXMLDocument is a CXMLDocument and an NSXMLNode is a CXMLNode, and so on. Just look at the Tree-Based XML Programming Guide from Apple for sample code and you should get a pretty good idea of how to use TouchXML with your XML documents. The section Querying an XML Document should give you what you need to use XPath effectively.