Multiple device types - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Multiple device types

Description:

A meta markup language. A set of rules for creating semantic tags to structure data ... Not pages of frames, but decks with cards. Images: WBMP, WAP specific ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 28
Provided by: ECS58
Category:
Tags: decks | device | multiple | types

less

Transcript and Presenter's Notes

Title: Multiple device types


1
Multiple device types
  • Web based services

2
Technologies
  • XML
  • XSL
  • ASP
  • JSP
  • WAP, WML
  • Java 2 Micro Edition
  • Visual Embedded Toolkits

3
Example Systems
  • Mobile Information Server - Microsoft
  • Cocoon APACHE project vendor neutral

4
What is XML
  • A meta markup language
  • A set of rules for creating semantic tags to
    structure data
  • It is made up of Documents, Elements and
    attributes

5
Example of an XML Document
ltcoursegt ltslide id 003gt lttitlegtExample of
an XML Documentlt/titlegt ltauthorgt John
Byrnelt/authorgt lt/slidegt lt/coursegt
6
Some rules
  • XML elements are made up of start and end tags
  • e.g. lttitlegtExample of an XML Documentlt/titlegt
  • An element can contain one or more attributes.
    These are name value pairs
  • e.g.an attribute of the slide element is id
    003
  • All elements must have an end tag
  • All elements must be cleanly nested
  • Values are quoted
  • Documents have a unique first element

An XML Document is an XML element that can but
might not include nested XML elements
7
Data Interchange
XML
XML is the Webs language for data interchange
(HTML for rendering) For example databases from
different vendors may exchange information using
XML
8
Building XML Applications
  • Step 1 Write a DTD
  • A Document Type Definition defines
  • the tags that can exist in your document.
  • The sequence of the tags
  • The attributes allowed
  • The values associated with attributes

9
Example DTD
lt?xml encoding"UTF-8"?gt lt!ELEMENT
address(person)gt lt!ELEMENT person
(name,e-mail)gt lt!ELEMENT name (surname,
first)gt lt!ELEMENT surname (PCDATA)gt lt!ELEMENT
first (PCDATA)gt lt!ELEMENT email (PCDATA)gt
10
About the sample
  • This DTD says that our address is composed of
    one or more people, where each person has a name,
    and optional e-mail address.
  • The name is composed of a surname name, and a
    first name. And the content of each of these is
    UTF-8 string data.

11
The XML Document
  • Step 2 is the production of a document
  • The Document is generated by filling in the
    template described by the DTD with appropriate
    values
  • The values for elements may various sources
    including database queries

12
Interpreting Documents
  • Step 3 Application Programmers Interfaces
    (APIs) can be Used to manipulate XML Documents
  • Two such APIs exist
  • The DOM (Document Object Model)
  • The SAX (Simple API for XML)

13
Displaying XML
  • Your browser can display XML ?
  • If not then transform the XML into something your
    browser can display (such as HTML) XSL
    Stylesheets can do this

Result
XML
XSL


14
Basic syntax of XML
  • In XML, your tags must be properly nested
  • In XML, standalone tags, called empty tags, must
    have a trailing slash before the closing
    angle-bracket.
  • An XML document must have a single root element,
    which surrounds all others.
  • In XML, attribute values must be quoted.
  • XML markup tags are case sensitive.
  • Whitespace is relevant between start and end
    tags.
  • XML is extensible and uses a Document Type
    Declaration (DTD) to define the allowable grammar
    rules for tags and attributes.

15
XSL introduction
  • Extensible Stylesheet Language
  • Has 2 parts
  • Formatting Objects
  • Transformation Rules (XSLT bit!)
  • It provides a presentation language for documents

16
XSLT
  • For tranforming XML to different targets use the
    XSL
  • Transformations
  • It can operate independently of XSL it can
    create
  • transformations without the use of the
    formatting
  • objects

17
XSL Processor
Link to stylesheet
XML file
HTML or (depends on Stylesheet used.
HTML or WML or .
XSL file
Result
18
Sample Stylesheet file extension .xsl
ltxslstylesheet xmlnsxsl "http//www.w3.org/1999
/XSL/Transform" version"1.0"gt
ltxsloutput method"html"/gt ltxsltemplate
match"/"gt lthtmlgt ltxslapply-templates
select"//book"/gt lt/xsltemplategt ltxsltemplate
match"book"gt This will appear in the result.
lt/xsltemplategt
19
XML files Located on server
Tomcat Servlet engine
Cocoon Handles XML
Servlets can use the Cocoon Parser and
manipulate XML documents
Browser requests UML file
20
Using IIS
xml
Server
xsl
Multiple devices (HTML WML)
21
If ( InStr(testmime,"wml"))Then
xmlDocument.load(Server.MapPath("index.xml")) xsl
Document.load(Server.MapPath("/stylesheets/wmlpage
.xsl")) Response.Write(xmlDocument.transformNod
e(xslDocument))
22
Else xmlDocument.load(Server.MapPath("/student/ja
b/index.xml")) xslDocument.load(Server.MapPat
h("/student/jab/stylesheets/webpage.xsl"))
Response.Write(xmlDocument.transformNode(xslDocume
nt)) End If
23
WAP
  • HTTP/HTML adjusted to small devices
  • Consists of a network architecture,a protocol
    stack and a Wireless Markup Language (WML)
  • For Internet connection a WAP-gateway is required
  • Specifications at http//www.wapforum.org

24
WAP - INTERNET
WEB SERVER
25

26

WML
  • WML based on XML and HTML.
  • Not pages of frames, but decks with cards.
  • Images WBMP, WAP specific
  • Generally all compiled to binary by WAP gateway
    Additional area of potential problems.

27

WMLScript
  • The WAP Javascript equivalent.
  • Located in separate files
  • Also compiled by WAP gateway
  • Allows automation of WML and phone functions.
Write a Comment
User Comments (0)
About PowerShow.com