Lecture 17. Side remark: for-each equivalence again Second-hand cars Item Model Engine Size Price </ thead>

Slides:



Advertisements
Similar presentations
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
Advertisements

XSLT 11-Apr-17.
XSL eXtensible Stylesheet Language. What is XSL? XSL is a language that allows one to describe a browser how to process an XML file. XSL can convert an.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
XSLT (eXtensible Stylesheet Language Transformation) 1.
Introduction to XSLT. What is XML? Design Goals of XML XML Format XML Declaration ElementsAttributes.
XML and XSL Transforming your XML documents with eXtensible Stylesheet Language Transformations [Optional Lecture]
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
Lecture 16. the xsl:variable element The format of the xsl:variable element is or or It tells the XSLT processor to –instantiate the variable with the.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
Some HTTP Examples. A utility which shows all data from incoming requests is here: It is.
Lecture 10. Back to the table example We can now return to considering in detail the first XSLT style-sheet we saw –The one which, when applied to the.
Rendering XML documents with XSL The most powerful approaches to rendering XML documents involve using XSL (eXtensible Stylesheet Language) XSL enables.
XSL Transformations (XSLT) Meghasyam Bokam April’1 st, 2002.
Recycled from Gill Windall’s notes
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
Lecture 15. Repetition In essence, repetition is already built into the default processing provided by every XSLT processor –the default processing for.
1 Copyright (c) [2000]. Roger L. Costello. All Rights Reserved. Using XSLT and XPath to Transform XML Documents Roger L. Costello XML Technologies.
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
XML - XSLT © 2012 t he University of Greenwich 1 XML Processing with XSLT Kevin McManus
Lecture 17. Side remark: for-each equivalence again Second-hand cars Item Model Engine Size Price
Python and Web Programming
Lecture 12. Default Processing in XSLT The default processing in XSLT is to process the XPath root node The default processing for various node types.
CS 4408 Lecture 9. XSLT instruction elements We have seen that a template can contain non-XSLT text, canned text that it inserts into the result tree.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
MC 365 – Software Engineering Presented by: John Ristuccia Shawn Posts Ndi Sampson XSLT Introduction BCi.
More on XSLT. More on XSLT variables Earlier we saw two ways to associate a value with a variable  A variable whose value is the empty string, for example.
XSLT XSLT: eXtensible Stylesheet Language for Transformations - a language for transforming XML documents into any text- based format (e.g. HTML, plain.
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.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
WORKING WITH XSLT AND XPATH
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
Transforming XML Part II XML Document Transformation with XSLT John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel:
USING PERL FOR CGI PROGRAMMING
Java CGI Lecture notes by Theodoros Anagnostopoulos.
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 "
XSLT part of XSL (Extensible Stylesheet Language) –includes also XPath and XSL Formatting Objects used to transform an XML document into: –another XML.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Transforming Documents „a how-to of transforming xml documents“ Lecture on Walter Kriha.
Lecture 11 XSL Transformations (part 1: Introduction)
XSLT Introduction. XSLT is the transformation part of XSL An XSLT file contains rules which are applied against and XML file to produce an output Outputs.
Website Development with PHP and MySQL Saving Data.
1 Chapter 9 – Cookies, Sessions, FTP, and More spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
1 Copyright (c) [2000]. Roger L. Costello. All Rights Reserved. Using XSLT and XPath to Transform XML Documents Roger L. Costello XML Technologies.
XSLT. XSLT stands for Extensible Stylesheet Language Transformations XSLT is used to transform XML documents into other kinds of documents. XSLT can produce.
Martin Kruliš by Martin Kruliš (v1.1)1.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall XML Transformation: XSLT Semantic Web - Fall 2005 Computer.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML Schema – XSLT Week 8 Web site:
XML - XSLT © 2015 University of Greenwich 1 XML Processing with XSLT e Xtensible Stylesheet Language Transforms Dr Kevin McManus
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
Web Services Essentials. What is a web service? web service: software functionality that can be invoked through the internet using common protocols like.
CH 15 XSL Transformations 1. Objective What is XSL? Overview of XSL transformations Understanding XSL templates Computing the value of a node with xsl:value-of.
1 XSLT XSLT (extensible stylesheet language – transforms ) is another language to process XML documents. Originally intended as a presentation language:
XSLT: The XML transformation language
XML Introduction Bill Jerome.
Unit 4 Representing Web Data: XML
Creating an XSLT Style Sheet for Formatting Data
Chapter 7 Representing Web Data: XML
XML Data Introduction, Well-formed XML.
Applying eXtensible Style Sheets (XSL)
XML WITH CSS.
WHAT IS XSLT?.
Presentation transcript:

Lecture 17

Side remark: for-each equivalence again Second-hand cars Item Model Engine Size Price </ thead>

Conditional processing In essence, conditional processing is already provided by the select and match attributes However, XSLT also provides two construct for explicitly specifying conditional processing: the xsl:if element and xsl:choose element The xsl:if element

Example usage of the xsl:if element Second-hand cars Item Model Engine Size Price =2500">Too expensive

Conditional processing (contd.) Format of the xsl:choose element Format of the xsl:when and xsl:otherwise elements

Example usage of the xsl:choose element Second-hand cars Item Model Engine Size Price = 2500">Too expensive

Calling templates by name Second-hand cars Item Model Engine Size Price Unlike xsl:apply-templates, xsl:call-template does not change the current node or the current node list

Passing parameter values to named templates Second-hand cars Item Model Engine Size Price

A note on generating XML from PHP

The Usual situation in PHP By default, a PHP programmer does not have to generate headers for the HTTP responses that his programs generate –The PHP run-time system does this for him –It assumes that he is generating HTML Thus, the headers it generates include the following Content-Type: text/html

Example PHP program The text that is generated look like XML But the header that will precede this text in the response message will be Content-Type: text/html Thus, the browser will treat the response body as if it were a HTML file and will simply ignore the unrecognizable tags

Corrected PHP program The header that will precede this text in the response message will be Content-Type: application/xml The browser will treat the response body as if it were an XML file

Server-side use of XSL stylesheets

Example PHP program The program below applies the stylesheet in carStyleSheet.xsl to the XML file in cars.xml and sends the resultant output to the browser which sent a HTTP request to the PHP program <?php $parser = xslt_create(); $html = xslt_process($parser, 'cars.xml','carStyleSheet.xsl'); xslt_free($parser); echo $html; ?>