Presentation is loading. Please wait.

Presentation is loading. Please wait.

WML/HTML and XML Multiplatform Applications. Agenda XML – History and purpose What have HTML, WML and XML got to do with each other Why useful for multiplatform.

Similar presentations


Presentation on theme: "WML/HTML and XML Multiplatform Applications. Agenda XML – History and purpose What have HTML, WML and XML got to do with each other Why useful for multiplatform."— Presentation transcript:

1 WML/HTML and XML Multiplatform Applications

2 Agenda XML – History and purpose What have HTML, WML and XML got to do with each other Why useful for multiplatform development XML and DTD XML and XSLT HTML, XML and XHTML Exercises in XML

3 XML - History XML - Extensible Markup Language Designed to allow the transmission of data rather than data and associated formatting (like HTML) A variant of SGML Standard Generalized Markup Language (ISO 8879:1985) ISO 8879:1985ISO 8879:1985 An international open standard language Designed by the W3C and approved in 1998

4 Why XML? Designed as a metalanguage Tags can be created and defined by a user (unlike HTML) Designed to make data interchange between systems easier Not designed to replace HTML! Is a lot stricter than HTML in terms of syntax and execution

5 A metalanguage? You define what is held in the file not how it is displayed You can define your own language for use in an application e.g. WML for WAP Separates the data from the presentation layer Allows multiple applications to access and process the same data Can you see where this is heading?

6 XML code <mail><to>Patrick</to><from>Mick</from><heading>Meeting</heading> Don't forget we need to meet tonight Don't forget we need to meet tonight </mail>

7 XML <collection> Greatest Hits Greatest Hits Five Five UK UK Telstar Telstar 4.99 4.99 2003 2003..</collection>

8 The plan Datasource in XML DB XML Conversion XSLT ??? HTML WML

9 XML and DTD DTD - Document Type Definition Similar to a CSS but describes the data structure not the format of the file A XML file can be syntactically correct but is not a valid XML file until it has been validated against a DTD These are the rules for the document to adhere to

10 DTD 2 - example <!DOCTYPE mail [ ]><mail><to>Patrick</to><from>Mick</from><heading>Meeting</heading> Don't forget we need to meet tonight Don't forget we need to meet tonight </mail> Document type is mail Has 4 elements to, from, heading and body The elements are of type PCTYPE

11 XML and XSLT XML is to XSLT as HTML is to XSLT (nearly!) XSLT stands for eXtensible Stylesheet Language (XSL) Transformations It can turn an XML document into XHTML, WML or whatever you want Became a W3c standard in Nov 1999

12 XSLT Can use either or in Doctype Combines the XML with formatting to present the information to the user Taking the XML example we used earlier we can combine it with XSLT

13 XML <collection> Greatest Hits Greatest Hits Five Five UK UK Telstar Telstar 4.99 4.99 2003 2003.</collection>

14 XSLT file <html><body> My CD Collection My CD Collection Title Artist Title Artist </tr> <tr> </tr></xsl:for-each></table></body></html>

15 XML + XLST Produces this in a browser My CD Collection TitleArtist Greatest HitsFive

16 What have HTML, WML and XML got to do with each other? Well not much and a lot! HTML allows you to wrap data and it’s presentation system into one page e.g. Hello Hello Format Content Format XML just presents the data but in a structured way leaving the application to process it e.g. <to>Dave</to><from>Mick</from>

17 XHTML Extensible Hypertext Mark-up Language Designed to replace HTML Pretty similar to html v4.01 XHTML 1.0 became an official W3C Recommendation January 26, 2000 Allows HTML browser and XML apps to read XHTML doc Cleaner HTML that applies XML rules to it

18 XHTML - 2 So no missing tags All lowercase tags use style sheets to form pages where possible Insert a space in final tags for current browsers to understand i.e. Insert a space in final tags for current browsers to understand i.e. All name tags are now id tags All XHTML documents must have a DOCTYPE declaration

19 XHTML - 3 3 types of Doctype Strict, Transitional, and Frameset Strict – use HTML for data and CSS for styling Transitional – Uses HTYML styling as well as for Data – for non CSS browsers Frameset – from frames based rendering Look at W3schools conversion at http://www.w3schools.com/xhtml/default.asp http://www.w3schools.com/xhtml/default.asp Or the HTML tidy tool to help you convert your current HTML at http://tidy.sourceforge.net/ http://tidy.sourceforge.net/

20 Exercises in XML Like you to look at the online tutorial at http://www.w3schools.com/xml/default.asp And for XSLT http://www.w3schools.com/xsl/xsl_language s.asp http://www.w3schools.com/xsl/xsl_language s.asp And for DTD http://www.w3schools.com/dtd/default.asp But what do I code in

21 Tools You can use Dreamweaver MX Or the (free) Altova XMLSpy (available from http://www.altova.com/support_freexmlspy home.asp) http://www.altova.com/support_freexmlspy home.asp http://www.altova.com/support_freexmlspy home.asp Or a text editor and the online Tryit coder at http://www.w3schools.com/xml/tryit.asp?fil ename=note http://www.w3schools.com/xml/tryit.asp?fil ename=note http://www.w3schools.com/xml/tryit.asp?fil ename=note


Download ppt "WML/HTML and XML Multiplatform Applications. Agenda XML – History and purpose What have HTML, WML and XML got to do with each other Why useful for multiplatform."

Similar presentations


Ads by Google