XML in the Mozilla Architecture - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

XML in the Mozilla Architecture

Description:

Front end or Chrome. drawn using GUI toolkits. platform specific. Web page ... The layout engine also rendered the chrome? 5. Specification for. the user interface ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 15
Provided by: shalabhch
Category:

less

Transcript and Presenter's Notes

Title: XML in the Mozilla Architecture


1
XML in the Mozilla Architecture
Shalabh Chaturvedi Persistent Systems Pvt
Ltd Pune shalabh_at_pspl.co.in
2
Outline
  • What is Mozilla?
  • XUL (XML Based User Interface Language)
  • RDF (Resource Description Format)
  • XUL Templates - Mixing XUL and RDF
  • Possibilities

3
Mozilla Story
1998
1999
2000
4
Mozilla Design
  • Front end or Chrome
  • drawn using GUI toolkits
  • platform specific
  • Web page
  • drawn by a layout engine

A web browser
Bitter truth maintaining front ends on multiple
platforms is painful
  • What if
  • Code could be written only once?
  • Creating GUIs could be as simple as web pages?
  • The layout engine also rendered the chrome?

5
What is XUL ?
Specification for the user interface
gecko
The layout engine
A Graphical User Interface
6
XUL Elements
ltmenubargt, ltmenugt, ltmenupopupgt, ltmenuitemgt
lttabcontrolgt, lttabgt, lttabpanelgt, lttabboxgt
(many more)
  • Elements exist for all common UI widgets
  • Look and feel can be changed using CSS
  • Not yet a W3C Specification

7
RDF
Resource Description Framework
  • Defines a data model for describing resources
  • Suited to particular kind of information
  • Data Model
  • Resources
  • Properties
  • Statements
  • XML Serialization Syntax

8
RDF Data Model
Three statements about a resource Tintin
Tintin
colourOfHair
hasPet
brown
Snowy
hasFriends
rdftype
rdfseq
Capt Haddock
Prof Calculus
Thomson
9
Combining XUL and RDF
RDF in Mozilla
  • RDF datasource collection of RDF statements
  • Within mozilla all data is represented as RDF
    datasources

XUL
  • Defines the user interface

XUL Templates
  • Pull data from RDF datasources into XUL elements
  • Generate XUL elements dynamically

10
The Big Picture
Datasource (collection of rdf statements)
XUL (with templates)
mozilla
Dynamic Content
11
XUL Templates
Template
Content produced
  • A
  • lttemplategt
  • ltrulegt
  • ltconditionsgt
  • ltactiongt
  • B
  • C uri?x
  • D
  • A
  • B
  • C (1)
  • C (2)
  • C (3)
  • D

Note A, B, C and D are XUL elements
12
XUL Template Example
ltmenu datasources"tintin.rdf"
ref"urntintin"gt lttemplategt ltrulegt
ltconditionsgt ltcontent uri"?uri"
/gt lttriple subject"?uri"
predicate"http//my.homepage.com/tintinha
sFriends" object"?friends" /gt
ltmember container"?friends"
child"?friend" /gt lttriple
subject"?friend"
predicate"http//my.homepage.com/tintinname"
object"?name" /gt
lt/conditionsgt ltactiongt
ltmenupopupgt ltmenuitem
uri"?friend" value"?name" /gt
lt/menupopupgt lt/actiongt lt/rulegt
lt/templategt lt/menugt
13
Possibilities
  • Cross platform distributed applications
  • The big XML advantage - interoperability
  • Examples existing today
  • Mozilla web browser, mail client, editor
  • XMLTerm (terminal)
  • MozInvaders (space invaders game)
  • ZopeStudio (management console)
  • many more...

14
References
  • Mozilla and applications
  • http//www.mozilla.org/
  • http//dmoz.org/ (search for XUL)
  • http//www.mozdev.org/
  • XUL
  • http//www.mozilla.org/docs/
  • http//www.mozilla.org/xpfe/xulref/
  • RDF
  • http//www.w3.org/RDF/
  • http//www.mozilla.org/rdf/doc/
  • http//entwickler.com/mozine/doc/rdf-slides/

15
RDF-XML Example
lt?xml version"1.0"?gt ltrdfRDF
xmlnsrdf"http//www.w3.org/1999/02/22-rdf-syntax
-ns" xmlnsmy"http//my.homepage.com/tintin
gt ltrdfDescription about"urntintin"gt
ltmyhasFriendsgt ltrdfSeqgt
ltrdfligtltrdfDescription mynameCapt Haddock"
/gtlt/rdfligt ltrdfligtltrdfDescription
mynameThomson" /gtlt/rdfligt
ltrdfligtltrdfDescription mynameProf Calculus"
/gtlt/rdfligt lt/rdfSeqgt
lt/nchasFriendsgt lt/rdfDescriptiongt lt/rdfRDFgt
16
More about XUL
  • Easy and fast development
  • Scriptable using DOM
  • Overlays
  • Templates for dynamic content
  • XBL for extensibility
  • Cross platform
Write a Comment
User Comments (0)
About PowerShow.com