140 likes | 275 Views
Example XML Applications/Languages. Objectives. To Review uses of XML To investigate some Language applications of XML XHTML RSS WML Web Services. XML Uses and Languages. Uses XML can Separate Data from HTML XML is Used to Exchange Data and Share Data XML and B2B
E N D
Objectives • To Review uses of XML • To investigate some Language applications of XML • XHTML • RSS • WML • Web Services
XML Uses and Languages • Uses • XML can Separate Data from HTML • XML is Used to Exchange Data and Share Data • XML and B2B • XML Can be Used to Create New Languages • XML Applications/Languages • XHTML • Rich Site Summary - RSS • Wireless Markup Language (WML) • Web Services (SOAP, REST) • EBusiness XML (ebXML)
XML for Data Transfer/Exchange • XML can be use to store data (database) • Can be used to exchange/share data • Need to parse XML document • Bit by bit – SAX • Create DOM object – DOM • Can parse at client or Server • SimpleXML uses DOM • Demo CDData
XML for RSS • Really Simple Syndication • Can share headlines and content • Can be updated automatically • Personalisation of different sites • Avoids having to continually check sites • News Feeds – See BBC • Companies • Calendars
RSS Syntax • Demo RSSTut.xml • Channel : Title, link, description • Item : Title, link, description • Demo : RSSTut + Stylesheet
RSS Examples • Accessing RSS Data –Demo bbcNewsdata and bbsNewsData code • Using Style sheets fragments - demo • Demo bbctransrss.php and bbcrssframent.xslt • Aggregators • Blogger - http://www.blogger.com • Yahoo - www.yahoo.co.uk - Demo
XML for Wireless Markup Language • WML for devices that implement WAP • Based on internet standards • WML is an XML document (validator) <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.1//EN" "http://www.phone.com/dtd/wml11.dtd" ><wml> <card id="main" title="First Card"> <p mode="wrap">This is a sample WML page.</p> </card></wml>
Gateways • WML Stored on server – accessed via WAP Gateway • Translates into suitable form for mobiles.
WML Decks and Cards • WML pages are called DECKS - Demo hello.wml • Constructed as a set of CARDS • Related to each other with links. • Page accessed all the cards in the page are downloaded from the WAP server. • Navigation - inside the phone - without any extra access trips to the server • Demo ‘hello.wm’ and ‘select.wml’ • BBC – WAP Demo http://www.bbc.co.uk/mobile/web/emulator.shtml
XML for Web Services • Designed to support interoperable machine-to-machine interaction over a network • Transported using http using REST or SOAP/WSDL • Most major sites offer some web services • Amazon, ebay, yahoo, payPal
XML Web Services : REST • Representational State Transfer • Like html forms – GET & POST • Response is XML document • Simple and popular • Demo -http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Madonna&results=1 • Demo – Using Yahoo Rest
XML Web Services : SOAP • Simple Object Access Protocol • Requests sent by post – encapsulated in a SOAP envelop • Uses WSDL to describe web services • Xmethods • Amazon - http://www.amazon.com/gp/aws/landing.html
Advantages of Web Services • Interoperability between various software applications running on disparate platforms. • Web services use open standards and protocols. • By utilizing HTTP, web services can work through many common firewall security measures. • Allow software and services from different companies and locations to be combined easily to provide an integrated service.