How to parse xml from the server to our html page for a telephone application

I am new to webdevelopment and I want to parse xml from a web server not from a local server as possible. I have tried a lot googled. Please help me. I need to parse this url "http://twitter.com/statuses/public_timeline.xml"

+4
source share
2 answers

You can use the jQuery plugin ( http://jquery.com/ ) on the HTML page as an entry in a script tag called the jquery ajax () function to hit the url, and you can use the jquery parseXML () and find () function to analyze the data XML like this -

<html> <head> <script src="js/jquery-1.4.2.js" type="text/javascript" charset="utf-8"></script> <script> function onBodyLoad(){ $.ajax({ url:'http://twitter.com/statuses/public_timeline.xml', dataType:"xml", contentType:'application/xml', timeout:10000, type:'POST', success:function(data) { alert(data); var xmlDoc = $.parseXML( data ), $xml = $( xmlDoc ), $title = $xml.find( "title" ); /* append "RSS Title" to #someElement */ $( "#someElement" ).append( $title.text() ); /* change the title to "XML Title" */ $title.text( "XML Title" ); /* append "XML Title" to #anotherElement */ $( "#anotherElement" ).append( $title.text() ); }, error:function(XMLHttpRequest,textStatus, errorThrown) { alert("Error status :"+textStatus); alert("Error type :"+errorThrown); alert("Error message :"+XMLHttpRequest.responseXML); }}); } </script> </head> <body onload="onBodyLoad()"> <p id="someElement"></p> <p id="anotherElement"></p> </body> </html> 
+3
source

This is called a syndication signal.

http://dotnetslackers.com/articles/aspnet/How-to-create-a-syndication-feed-for-your-website.aspx

you can use the help at the above URL and also use the ASP.NET shell for the Twitter API.

-2
source

All Articles