1 Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COT 6930 Advanced Internet Programming Dr. Roy Levow Day 2.

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

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Introduction to Ajax.
Inside an XSLT Processor Michael Kay, ICL 19 May 2000.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
JavaScript and AJAX Jonathan Foss University of Warwick
UFCE8V-20-3 Information Systems Development 3 (SHAPE HK) Lecture 12 Extensible Stylesheet Language Transformations : XSLT.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
9. AJAX & RIA. 2 Motto: O! call back yesterday, bid time return. — William Shakespeare.
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
The Document Object Model (DOM) & Asynchronous Javascript And XML (AJAX) : an introduction UFCEKG-20-2 : Data, Schemas and Applications.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
JavaScript & jQuery the missing manual Chapter 11
1 Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COT 6930 Advanced Internet Programming Dr. Roy Levow Day 1.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
HTML DOM.  The HTML DOM defines a standard way for accessing and manipulating HTML documents.  The DOM presents an HTML document as a tree- structure.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
CIS 451: XSL Dr. Ralph Westfall February, Problems With XML no formatting capabilities contra formatting tags like, etc. in HTML CSS can be used.
Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
WORKING WITH XSLT AND XPATH
XP New Perspectives on XML, 2 nd Edition Tutorial 10 1 WORKING WITH THE DOCUMENT OBJECT MODEL TUTORIAL 10.
JavaScript & DOM Client-side scripting. JavaScript JavaScript is a tool to automate client side (which is implemented using HTML so far) JavaSript syntax.
D2L Notes Be sure to submit your link in the dropbox provided on D2L You can just upload an empty text file if a file upload is required Do not use D2L.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards.
Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 4 - XML.
Working with the XML Document Object Model ©NIITeXtensible Markup Language/Lesson 7/Slide 1 of 44 Objectives In this lesson, you will learn to: *Identify.
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 34 - Case Study: Active Server Pages and XML Outline 34.1 Introduction 34.2 Setup and Message.
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
5.2 DOM (Document Object Model). 2 Motto: To write it, it took three months; to conceive it three minutes; to collect the data in it — all my life. —F.
1 Dr Alexiei Dingli XML Technologies XML Advanced.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
Extensible Stylesheet Language Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University XSL-FO XSLT.
XML Part 2 Josh Steele CS 6704, Spring XML Part 2 XSL/XSLT –Structure Revisited –Definition –Example –Components XML’s Linking Languages XML’s Uses.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Lecture 11 XSL Transformations (part 1: Introduction)
Javascript II DOM & JSON. In an effort to create increasingly interactive experiences on the web, programmers wanted access to the functionality of browsers.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 2 – Ajax Fundamentals.
XP New Perspectives on XML, 2 nd Edition Tutorial 8 1 TUTORIAL 8 CREATING ELEMENT GROUPS.
1 Dr Alexiei Dingli XML Technologies SAX and DOM.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
>> PHP: Insert Query & Form Processing. Insert Query Step 1: Define Form Variables Step 2: Make DB Connection Step 3: Error Handling Step 4: Define the.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
Unit 3 — Advanced Internet Technologies Lesson 11 — Introduction to XSL.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
CSE3201/CSE4500 Information Retrieval Systems XSLT – Part 2.
Summer 2007 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 1 – Introducing Ajax.
AJAX. Overview of Ajax Ajax is not an API or a programming language Ajax aims to provide more responsive web applications In normal request/response HTTP.
1 XMLXSL(T) and CSS NOEA/PQC (rev. fen) 2007 Stylesheets CSS:Cascading Style Sheets XSL(T):eXtended Stylesheet Language (Transformations)
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
JQUERY AND AJAX
1 XSL Transformations (XSLT). 2 XSLT XSLT is a language for transforming XML documents into XHTML documents or to other XML documents. XSLT uses XPath.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
Session IV Chapter 14 – Chapter 14 – XSLThttp://
Unit 4 Representing Web Data: XML
Not a Language but a series of techniques
Applied Online Programming
AJAX.
Chapter 7 Representing Web Data: XML
CSE 154 Lecture 22: AJAX.
In this session, you will learn to:
Unit 6 - XML Transformations
Presentation transcript:

1 Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COT 6930 Advanced Internet Programming Dr. Roy Levow Day 2

Advanced Internet Programming – Fall Day 2 Syllabus AJAX Patterns XML Technologies XML XPath XSLT Self-Study JSON

Advanced Internet Programming – Fall AJAX Patterns Communication Control Predictive Fetch Preload anticipated next item Example: Predictive FetchPredictive Fetch Example: Multi-stage DownlaodMulti-stage Downlaod Submission Throttling Send data to server progressively Incremental form validation is an example Example: Submission ThrottlingSubmission Throttling

Advanced Internet Programming – Fall AJAX Patterns (cont.) Periodic Refresh Keep view up-to-date with changing data ESPN scoreboard Gmail Example: Periodic RefreshPeriodic Refresh Fallback Patterns Cancel Pending Try Again

Advanced Internet Programming – Fall Predictive Fetch – Page Preloading Example: Predictive FetchPredictive Fetch Basic Operation of php file No parameters: deliver first page, full html Page parameter specifies page to deliver DataOnly parameter specifies whether to deliver page data only as div (true) or normal html page (not present or false) CSS controls display of pages and page number list through class set by JavaScript

Advanced Internet Programming – Fall Page Preloading - 2 JavaScript Verifies that XMLHttpRequest is supported If not, does normal page loads Sets display class for current page number Waits 5 seconds and then requests data only for next page until all pages are loaded Loads page into hidden div

Advanced Internet Programming – Fall Page Preloading - 3 On page number click If current page, do nothing Else check if page is preloaded If not, load the next page normally If preloaded, update div class to display correct page and update page number class

Advanced Internet Programming – Fall Page Preloading – Function Summary getURLForPage() from location showPage() make page visible and fix page number display loadNextPage() Create request object first time Abort any pending request After loading, wait onload function Fix up display Fix links if XMLHttpRequest is supported

Advanced Internet Programming – Fall Multistage Download Load basic content in original page Design issue: What is basic? Then download extra content Not loaded if no XMLHttpRequest Example: Multi-stage DownlaodMulti-stage Downlaod

Advanced Internet Programming – Fall Submission Throttling Collect DataUser idle? Time to send Send DataMore Data? No Yes No Yes Done

Advanced Internet Programming – Fall Submission Throttling Incremental Form Validation Use standard form So it will work even without XMLHttpRequest Validate selected fields as they are entered User name must be unique address must be valid Date must be valid

Advanced Internet Programming – Fall Incremental Form Validation validateField() used for all fields Identify field from event target Pass data and field id to server php to check Example: Submission ThrottlingSubmission Throttling Single filed example Complete form example

Advanced Internet Programming – Fall Periodic Refresh Check for changes periodically Refresh when changes are present Note headers to suppress caching page header(“Cache-control: No-Cache); header(“Pragma: No-Cache); Can also avoid cache hit by changing query string, say by adding datetime Load into div and them make visible

Advanced Internet Programming – Fall Fall Back – Cancel Pending Requests Most common in periodic refresh To handle errors Need to handle several conditions Disable requests when page is not active Error code return Failure to contact server Example: Cancel PendingCancel Pending

Advanced Internet Programming – Fall Fallback Patterns – Try Again When request fails may wish to try again Be sure not to try forever Example: Try AgainTry Again

Advanced Internet Programming – Fall XML, XPath, XSLT XML support generally limited to IE and Firefox XML in IE Microsoft.XmlDom in IE4.0 MSXML ActiveX in IE 5.0+ But only on Windows; not on MAC Text uses createDocument() for cross-IE compatability XML DOM object created from string

Advanced Internet Programming – Fall XML DOM Navigation DOM object properties childNodes, firstChild, lastChild, parentNode, nextSibling, previousSibling, nodeName, nodeType, nodeValue text, attributes xml ownerDocument – root node Navigate tree with these functions

Advanced Internet Programming – Fall IE XML DOM Navigation Examples Examples: IE DOMIE DOM DOM creation Get Elements by Tag Name Create Node Insert Node Remove Child Replace Child

Advanced Internet Programming – Fall IE XML DOM Error Handling Creates and propagates exception object parseError parseError object provides details errorCode, reason filePos, line, linePos srcText url

Advanced Internet Programming – Fall XML DOM in Firefox Uses createDocument() method to generate DOM object Empty From string From url load() method loads from a url String version of XML subtree is produced by XMLSerializer object

Advanced Internet Programming – Fall XML DOM in Firefox - 2 Error handling Firefox produces an error document Not the error object of IE It can be parsed to get the same information

Advanced Internet Programming – Fall Firefox XML DOM - 3 Examples: Firefox DOMFirefox DOM DOM Dreation DOM Parser Get text Serialize Error handling

Advanced Internet Programming – Fall Cross-Browser XML Requires library to create standard calls for operations Text provides zXml library zXmlDom.createDocument() Examples: Cross-Browser DOMCross-Browser DOM Processing Book List

Advanced Internet Programming – Fall XML Namespaces XML uses namespace concept to resolve naming conflicts between documents from different sources Tag name has form ns:tagName Declared as xmlsn:ns-prefix=“nsURI” URI has same syntax as URL but need not be real address Should be unique Declarations in root tag of document

Advanced Internet Programming – Fall XPath XPath expressions Context node is partial path from which selection begins book/author – this parent-child sequence Selection pattern specifies which nodes to include Expressions have own syntax and can be quite complex

Advanced Internet Programming – Fall XPath in IE and Firefox IE uses two functions selectSingleNode() selectNodes() Examples: IE XPathIE XPath Firefox uses two objects XPathEvaluator XPathResult Examples: Firefox XPathFirefox XPath

Advanced Internet Programming – Fall Cross-Browser XPath Use zXml library Same functions as IE Examples: Cross-Browser XPathCross-Browser XPath

Advanced Internet Programming – Fall XSL Transformations Transformation is done with xsl:stylesheet with XML specific elements xsl:template to select XMLnodes to process xsl:variable to select attributes from nodes Examples: XSLTXSLT

Advanced Internet Programming – Fall XSLT in IE Browser becomes an issue when DOM is used in conjunction with XSLT Must create ActiveX XSLTemplate object Create processor object from template object transform() method does transformation Result is output property of processor Examples: XSLT in IEXSLT in IE

Advanced Internet Programming – Fall Cross-Browser XSLT Requires library Text provides this in zXml Syntax similar to Firefox Example: Best Picks RevisitedBest Picks Revisited

Advanced Internet Programming – Fall XSLT in Firefox First load XML and XSL into DOM objects Create XSLTProcessor Import XSL stylesheet Transform XmlDOM document or fragment Examples: XSL in FirefoxXSL in Firefox