A presentation by Robin Upton (2009-03-12) ‏ latest version at www.altruists.org/ff4 Attribution – NonCommercial - ShareAlike www.altruists.org FF 4 :

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

PHP I.
Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
Advanced XSLT. Branching in XSLT XSLT is functional programming –The program evaluates a function –The function transforms one structure into another.
Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
CGI & HTML forms CGI Common Gateway Interface  A web server is only a pipe between user-agents  and content – it does not generate content.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
XSL XSLT and XPath 11-Apr-17.
DT228/3 Web Development WWW and Client server model.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
CSE 190: Internet E-Commerce Lecture 17: XML, XSL.
ASP.NET Programming with C# and SQL Server First Edition
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 1 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
Chapter 16 The World Wide Web. 2 The World Wide Web (Web) is an infrastructure of distributed information combined with software that uses networks as.
ECA 228 Internet/Intranet Design I Intro to XSL. ECA 228 Internet/Intranet Design I XSL basics W3C standards for stylesheets – CSS – XSL: Extensible Markup.
XSLT 1. C ONTENTS XSLT and uses XSLT example Simple XML How XSLT works? Template-match Value-of For-each and sort If Choose-when Apply-templates Where.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike FF106:
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
WORKING WITH XSLT AND XPATH
Altruistic Economics A presentation by Robin Upton, , for Dhaka University Computer Science Dept. Updated for 26C3 Here Be Dragons,
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
A presentation by Dr. Robin Upton ( ). Available for download at Attribution – NonCommercial - ShareAlike.
FF 1 : Modules A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike
A presentation by Robin Upton ( ) ‏ latest version at Attribution – NonCommercial - ShareAlike FF 404.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
Lecture 11 XSL Transformations (part 1: Introduction)
Website Development with PHP and MySQL Saving Data.
1 Welcome to CSC 301 Web Programming Charles Frank.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
1 Overview of XSL. 2 Outline We will use Roger Costello’s tutorial The purpose of this presentation is  To give a quick overview of XSL  To describe.
FF 12 : Clients A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike
Client-side & Server-side Scripting ©Richard L. Goldman August 5, 2003 Requires PowerPoint 2002 or later for full functionality.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
FF 11 : Hooks A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike
XSLT. XSLT stands for Extensible Stylesheet Language Transformations XSLT is used to transform XML documents into other kinds of documents. XSLT can produce.
XP New Perspectives on XML, 2 nd Edition Tutorial 7 1 TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
FF 17 : Processes A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
A presentation by Robin Upton ( ) ‏ Latest version at Attribution – NonCommercial - ShareAlike Recommended.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
General Architecture of Retrieval Systems 1Adrienn Skrop.
Session IV Chapter 14 – Chapter 14 – XSLThttp://
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Unit 4 Representing Web Data: XML
WWW and HTTP King Fahd University of Petroleum & Minerals
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Chapter 7 Representing Web Data: XML
Chapter 27 WWW and HTTP.
Lecture 5: Functions and Parameters
Intro to PHP.
Presentation transcript:

A presentation by Robin Upton ( ) ‏ latest version at Attribution – NonCommercial - ShareAlike FF 4 : Decentralised Programming with F 2 F Decentralised Programming v

(1)Decentralised Programming. WWW as Distributed Programming C C C C C C C S distributed.net = Distributed, Centralised Calculations are performed by many CPUs, but directed by a single authority. Friend2Friend.net = Distributed, Decentralised Each computers in F2F network has unique local data & instructions. None has special privilege. F F F F F F F Distributed programs may still be centrally controlled.

Sites: code data code data code data code data WWW as Distributed Programming Clients Send Data Websites have unique instructions and data stores... Clients send data to one site at a time Clients:

Clients Send Data. Servers Return Data Users input data through browsers and pass it to websites: decentralization

Servers Return Data Code ≠ Data Websites receive data, carry out instructions, return data to clients

Code ≠ Data 'Code' = XML = 'Data' function f2fError($text, $nodename='error')‏ { // Example of usual source code $err= new DOMDocument(); $errnode=$err->createElementNS(nsF2F, $nodename, $text); $err->appendChild($errnode); return $err; } to be processed by trusted code. Untrusted data is dynamically input... Most programming languages cannot treat data as code.

'Code' = XML = 'Data' (2) How to Program F2F In F2F, programs, instructions and data share a common format: XML F2F data streams can embed instructions, allowing for rich interaction. i.e. Sites can dynamically script other sites. F2F service, coded in XML arbitrary XML...

(2)How to Program F2F. Hello World Service F2F servers are XML virtual machines. Input, output & internal workings are XML. Although required, the namespace is omitted for brevity from this point on. All instructions to F2F servers take the form: etc.

Hello-World Service. Processing Service Requests We start by requesting the service: So this is implemented by the XSL template at hello.xslt The F2F server finds the matching service definition: Unique identifier Location on disk

Passing Arguments The XSL transforms it to an Output Document: The itself is the script’s Input Document: Hello World! Processing Service Requests Hello World!

Passing Arguments Nested Servicereqs Many languages pass a comma separated list of input parameters to a function: function browse($uri, $width, $height)‏ {...instructions here, in which $uri, $width and $height are replaced at run time by the values of the arguments given... } browse(“ 130, 500)‏ <!-- Transform here, which operates on the whole XML document --!> F2F passes an XML document:

Nested Servicereqs. Processing Directives browse(“ getwidth(), getheight())‏ By default, F2F starts with the deepest : Evaluation is usually from inside out: <!-- Transform here, which gets the width. --!> <!-- Transform here, which gets the height. --!> <!-- Transform here, which operates on the whole XML document --!>

Nested Servicereqs = Pipelined XML A may have extra attributes, called processing directives. Processing Directives XSL stylesheet Raw XML Output Post- processed XML Output Pre- processed Input: servicereq Raw Input: servicereq Pre-processing directives modify the input of the stylesheet. Mid-processing & Post-processing directives modify the output. For more details, see: FF6: Common Processing Directives

Tree-shaped Pipelines Nested items results in pipelining XML: Nested Servicereqs = Pipelined XML The interior outputs XML......which is fed into the exterior... XSL ex.1 XSL ex.2 XML pipelining is taking the input from one transform and feeding it into another:

Core Services The model allows trees of transforms. Tree-shaped Pipelines XSL 2B XSL 3 3b 3a XSL 2A 3c 2b XSL 1A XSL 1B 1a 2a22a1 1b

Saving Instructions About 80 hardcoded (non-XSLT) services extend the possibilities. e.g: Core Services Send/Receive Read/Write XML data Read/Write the F2F Server Read/Write Files to disk

Sending Instructions in the below will be interpreted -->...May contain instructions or data... //wherever.xml <servicereq Saving Instructions To write an XML file to disk: If the data above contained this would get interpreted first. //wherever.xml <servicereq To prevent descendants from being interpreted, add f2f:escaped=”!”:

Clientside Instructions <servicereq Sending Instructions Sending instructions to another server requires a different form of escaping: The f2f:sendescaped attribute is decreased by 1 whenever the data is sent, so: f2f:sendescaped =”1”- Run on friend's server f2f:sendescaped =”2”- Run on friend of a friend's server f2f:sendescaped =”3”- Run on friend of a friend of a friend's server...

Icon here XSLT Transform output here Will be transformed Summary Clientside Instructions Clients interpret, and elements......so XML can be used to script client interactivity.

Summary F2F scripts use XSLT, extended with about 80 extra core functions. Nested items pipeline XML data & instructions. A JS F2F client is available for Firefox. Recommended Follow-up: FF5: Service Request Processing Model F2F servers are general purpose XML virtual machines. F2F servers are designed to form decentralised networks....