XSLT programming examples Jaana Holvikivi Metropolia.

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

CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
 2001 Prentice Hall, Inc. All rights reserved. 1.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
XSLT (eXtensible Stylesheet Language Transformation) 1.
XSL XSLT and XPath 11-Apr-17.
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
+ XSL eXtensible Stylesheet Language. + 2 XML Lecture Adapted from the work of Prof Mark Baker ACET, University of Reading.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
XML Unit 6 October 31. XML, review XML is used to markup data Used to describe information Uses tags like HTML –But all tags are user-defined –Must be.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
eXtensible Stylesheet Language
Rendering XML documents with XSL The most powerful approaches to rendering XML documents involve using XSL (eXtensible Stylesheet Language) XSL enables.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
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.
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.
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.
10/06/041 XSLT: crash course or Programming Language Design Principle XSLT-intro.ppt 10, Jun, 2004.
XML – Extensible Markup Language XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
CSE3201/CSE4500 Information Retrieval Systems
XSL XML Stylesheet Langauage. XPath Notation for addressing elements in an XML document /xyz - selects the root element /xyz/abc - selects all elements.
Introduction technology XSL. 04/11/2005 Script of the presentation Introduction the XSL The XSL standard Tools for edition of codes XSL Necessary resources.
CIS 451: XSL Dr. Ralph Westfall February, Problems With XML no formatting capabilities contra formatting tags like, etc. in HTML CSS can be used.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
XHTML,XML M.Abdullah Mrian. What is the XHTML Why XHTML ?
These Questions are copied from
CSE3201/CSE4500 Information Retrieval Systems XSLT – Part 2.
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.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Transforming Documents „a how-to of transforming xml documents“ Lecture on Walter Kriha.
CIS 375—Web App Dev II XSL. 2 XSL Introduction XSL stands for _____________________________. XSL is the language used for manipulating and displaying.
Lecture 11 XSL Transformations (part 1: Introduction)
 2002 Prentice Hall, Inc. All rights reserved. 1 Chapter 12 – XSL: Extensible Stylesheet Language Transformations (XSLT) Outline 12.1Introduction 12.2Setup.
ACG 6415 XSLT Presenting XML and XBRL. Re-Purpose  The main benefit of XML / XBRL Reusability of Data contained in Instance Document We need a method.
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.
XML and SVG from PQL By Dave Doulton Computing Services University of Southampton.
XP New Perspectives on XML, 2 nd Edition Tutorial 8 1 TUTORIAL 8 CREATING ELEMENT GROUPS.
XSLT. XSLT stands for Extensible Stylesheet Language Transformations XSLT is used to transform XML documents into other kinds of documents. XSLT can produce.
Unit 3 — Advanced Internet Technologies Lesson 11 — Introduction to XSL.
XPath. XPath, the XML Path Language, is a query language for selecting nodes from an XML document. The XPath language is based on a tree representation.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
 XSL – Extensible Style Sheet Language  XSLT – XSL Transformations › Used to transform XML documents to other formats,like HTML or other XML documents.
XP New Perspectives on XML, 2 nd Edition Tutorial 7 1 TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET.
CSE3201/CSE4500 Information Retrieval Systems XSLT – Part 2.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations Presenting XML and XBRL.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations Presenting XML and XBRL.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
XML Introduction to XML Extensible Markup Language.
XML Schema – XSLT Week 8 Web site:
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.
1 XSLT XSLT (extensible stylesheet language – transforms ) is another language to process XML documents. Originally intended as a presentation language:
Session IV Chapter 14 – Chapter 14 – XSLThttp://
XSLT: The XML transformation language
Creating an XSLT Style Sheet for Formatting Data
XML Related Technologies
Tutorial 04 (cont’) Using XPath Patterns in an XSLT Style Sheet.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations
More Sample XML By Sadia Anjum.
CS 431 – February 28, 2005 Carl Lagoze – Cornell University
WHAT IS XSLT?.
XSL XSLT and XPath 24-Feb-19.
XSL XSLT and XPath.
Presentation transcript:

XSLT programming examples Jaana Holvikivi Metropolia

J. Holvikivi XML source Stylesheet tree XSLT source Transformation Result tree Source tree XML XHTML text Serialize

Case: book printer’s system J. Holvikivi XML database XQueryXSLT SVG, MathML & XHTML PDF XSL-FO XML Editor XML documents

J. Holvikivi Recursion: xml file Pennies from heaven Mae West Memories Bertrand Russel Investigations Ludwig Wittgenstein

J. Holvikivi Recursion: books.xsl ...continues

J. Holvikivi Recursion (continues)

J. Holvikivi Sorting, second example

J. Holvikivi xsl:sort Moomin belongings sorted

J. Holvikivi Generic process for copying

J. Holvikivi Variables and parameters: the alphabet one by one ….

J. Holvikivi Another HTML example: An XML document representing the results of a soccer tournament 10-Jun-1998 Brazil Scotland 10-Jun-1998 Morocco Norway 16-Jun-1998 Scotland Norway

J. Holvikivi Another HTML example, page 2: An XML document representing the results of a soccer tournament 16-Jun-1998 Brazil Morocco 23-Jun-1998 Brazil Norway 23-Jun-1998 Scotland Morocco

J. Holvikivi A basic style sheet for the soccer results <xsl:transform xmlns:xsl=" version="1.0"> Results of Group Results of Group versus Played on Result:,

J. Holvikivi A style sheet that computes team standings (part 1) <xsl:transform xmlns:xsl=" version="1.0"> Results of Group Team Played Won Drawn Lost For Against

J. Holvikivi A style sheet that computes team standings (part 2) <xsl:variable name="won" > <xsl:variable name="lost" < <xsl:variable name="drawn" = <xsl:variable name="for" <xsl:variable name="against" - $for"/>

J. Holvikivi A style sheet that computes team standings: result  The data are rearranged and processed:

J. Holvikivi Explanations create a global variable teams (node-set which has all team elements, the same element cannot be selected twice) this node set is processed in the loop on the next page the dollar sign refers to variable teams declare a local variable this, that gets the value of the current node count($matches[team=$this]) counts the number of those matches for which it is true that the name of this team is in the element value > compare values of score attributes: has this team more (> >) scores than the other; != means NOT

J. Holvikivi XSL as a functional programming language: the factorial factorial( )

J. Holvikivi  1 0"> XSL as a functional programming language: the factorial, cont.