XSLT and Structural Recursion. Gestão e Tratamento de Informação DEI IST 2011/2012

Size: px
Start display at page:

Download "XSLT and Structural Recursion. Gestão e Tratamento de Informação DEI IST 2011/2012"

Transcription

1 XSLT and Structural Recursion Gestão e Tratamento de Informação DEI IST 2011/2012

2 Outline Structural Recursion The XSLT Language

3 Structural Recursion : a different paradigm for processing data Data is modeled through sets and there is also a set union operator: {a:3, a:{b: one, c:5}, b:4} = {a:3} U {a:{b: one,c:5}} U {b:4} Data are processed by applying functions recursively over the structure (I.e., over the sets)

4 An Example Find all integer values in the data f($t1 U $T2) = f($t1) U f($t2) f({$l: $T}) = f($t) f({}) = {} f($v) = if isint($v) then {result: $V} else {} a a b 3 b c 4 one 5 result result result 3 5 4

5 Another Example What does the following program do? f($t1 U $T2) = f($t1) U f($t2) f({$l: $T}) = if $L=a then {b:f($t)} else {$L:f($T)} f({}) = {} f($v) = $V

6 Yet Another Example Increase engine prices by 10% f($t1 U $T2) = f($t1) U f($t2) f({$l: $T}) = if $L= engine then {$L: g($t)} else {$L: f($t)} f({}) = {} f($v) = $V g($t1 U $T2) = g($t1) U g($t2) g({$l: $T}) = if $L= price then {$L:1.1*$T} else {$L: g($t)} g({}) = {} g($v) = $V engine body engine body part price part price part price part price price price price price

7 General form for structural recursion programs f 1 ($T1 U $T2) = f 1 ($T1) U f 1 ($T2) f 1 ({$L: $T}) = E 1 ($L, f 1 ($T),...,f k ($T), $T) f 1 ({}) = { } f 1 ($V) = g($v).... f k ($T1 U $T2) = f k ($T1) U f k ($T2) f k ({$L: $T}) = E k ($L, f 1 ($T),...,f k ($T), $T) f k ({}) = { } f k ($V) = g($v) Each E 1,..., E k consists only of {_ : _}, U, if_then_else_

8 Outline Structural Recursion The XSLT Language

9 The W3C XSL Standard The XSL standard is composed of: A language for expressing XML transformations (XSLT) An XML vocabulary for specifying formating semantics: XSL-FO (formatting objects) An XSLT program expresses a transformation from one XML document into a result tree: Another XML document An HTML document A document that contains FO XSL-FO in general: Corresponds to one or more screen areas or pages Has properties to describe the visual aspect of the area(s) Contains contents in the form of: text external objects (image, applet, etc.), or Additional formatting objects

10 XSLT Programs XSL program = template-rule... template-rule template-rule = match pattern + template Computation Model: Different from other query languages. XSL begins in the root element and tries to apply a pattern to ther node. If it succeeds, then it executes the corresponding template over the node. Normally, the template includes XSLT instructions for producing the XML result tree, or for applying templates recursively over the child nodes. In the last case, the process is repeated. Thus, he XSLT program is like a recursive function.

11 XSLT Template Rules The template rules are indicated by elements of the type xsl:template The matching pattern is specifyed through an XPath in the value for the match attribute The actual template is the content for the xsl:template element <xsl:apply-templates/> is an instruction that applies the entire XSLT program to all the descentants of the matched element

12 An Example XML Document <bib> </bib> <book> </book> <paper> </paper> <book> </book> <title> t1 </title> <author> a1 </author> <author> a2 </author> <title> t2 </title> <author> a3 </author> <author> a4 </author> <title> t3 </title> <author> a5 </author> <author> a6 </author> <author> a7 </author>

13 Example XSLT Program <xsl:template match = * > <xsl:apply-templates/> <xsl:template match = title > <result> <xsl:value-of select =. /> </result> Results: <result> t1 </result> <result> t2 </result> <result> t3 </result> <xsl:template match="text()">

14 How the program works It starts by the root <bib>... </bib> Checks if any pattern matches the root node The pattern from the first template is satisfied. XSLT evaluates the body of the template, which contains <xsl:apply-templates/> This implies that the entire program is going to be applied to all descendants of the <bib> element Once again, the pattern from the first template is satisfied This implies that the entire program is going to be applied to the elements <title> and <author> Finallty, the pattern for the second template is satisfied by the element <title> The XSLT program generates a <result>...</result> element in which the content is the value for the current node, i.e. The textual string with the title

15 XSLT Patterns: Path Expressions bib the bib element * any element / root /bib bib element under the root bib/paper paper element, child from bib bib//paper paper child from bib, at any depth //paper paper element at any depth paper book paper or book price attribute bib/book/@price price attribute in book, from bib db/book[@price] books having a price attribute db/book[@price= 10 ] books with a price equal to 10

16 Using <xsl:element name= X > Creates a new element named X Example: <xsl:template match= A > <xsl:element name = B > <xsl:value-of select =. /> <xsl:element/> The above example is equivalent to: <xsl:template match= A > <B><xsl:value-of select =. /></B>

17 Another Example <xsl:template match= * > <xsl:element name = {name()} > <xsl:value-of select =. /> </xsl:element> Copies all top-level elements from the entry document name() returns the name for the current node, and we use this string as the name for the output node.

18 Another XSLT Program... <xsl:template match = * > <xsl:apply-templates/> <xsl:template match= a > <A><xsl:apply-templates/></A> <xsl:template match= b > <B><xsl:apply-templates/></B> <xsl:template match= c > <C><xsl:value-of select=. /></C>

19 ...Applied to a Document <a> <e> <b> <c> 1 </c> <c> 2 </c> </b> <a> <c> 3 </c> </a> </e> <c> 4 </c> </a> <A> <B> <C> 1 </C> <C> 2 </C> </B> <A> <C> 3 </C> </A> <C> 4 </C> </A>

20 Conflict resolution for template matching rules If several template rules match, choose the one with the highest priority Priorities can either be: Explicit : <xsl:template match= abc priority= 1.41 > Implicit : ad-hoc rules given by W3C, based on the match match= abc priority 0. match= [... some namespace name... ] priority match= node() priority -0.5.

21 XSLT and Structural Recursion Equivalent to: f(t1 U T2) = f(t1) U f(t2) f({l: T}) = if L= c then {C: t} else L= b then {B: f(t)} else L= a then {A: f(t)} else f(t) f({}) = {} f(v) = V <xsl:template match= c > <xsl:template match= b > <xsl:template match= a > <xsl:template match = * >

22 XSLT versus Structural Recursion The XSLT Language: Operates on trees Program can create an infinite loop Structural Recursion: Over arbitrary graphs Programs always terminate

23 Example : Converting XML to HTML <xsl:template match= / > <HTML> <HEAD> <TITLE> Bibliography entries </TITLE> </HEAD> <BODY> <xsl:apply-templates/> </BODY> </HTML> <xsl:template match= title > <TD> <xsl:value-of select=. /> </TD> <xsl:template match= author > <TD><xsl:value-of select=. /></TD> <xsl:template match = book paper > <TR> <xsl:apply-templates select= title /> <xsl:apply-templates select= author /> </TR> <xsl:template match= bib > <TABLE> <TBODY> <xsl:apply-templates/> </TBODY> </TABLE>

24 HTML Result <HTML> <HEAD> <TITLE> Bibliography Entries </TITLE> </HEAD> <BODY> <TABLE> <TBODY> <TR><TD> t1 </TD> <TD> a1 </TD> <TD> a2 </TD> </TR> <TR><TD> t2 </TD> <TD> a3 </TD> <TD> a4 </TD> </TR> <TR><TD> t3 </TD> <TD> a5 </TD> <TD> a6 </TD> <TD> a7 </TD></TR> </TBODY> </TABLE> </BODY> </HTML>

25 Yet Another Simple XSLT Copies the entry document: <xsl:template match = / > <xsl:apply-templates/> <xsl:template match = {text()} > <xsl:value-of select=. /> <xsl:template match = * > <xsl:element name= name() > <xsl:apply-templates/> </xsl:element>

26 Exercise Write an XSLT program that transforms the XML document: <teaches> <teaches-tuple course="xml" lecturer="peter Wood"/> <teaches-tuple course="algorithms" lecturer="trevor Fenner"/> </teaches> Into another XML document with the following general schema: <teaches> <teaches-tuple> <course>xml</course><lecturer>peter Wood</lecturer> </teaches-tuple> <teaches-tuple> <course>algorithms</course><lecturer>trevor Fenner</lecturer> </teaches-tuple> </teaches>

27 References S. Abiteboul, P. Buneman, D. Suciu, Data on the Web, From Relations to Semistructured Data and XML, Morgan Kaufmann, 2000, (caps 5 e 6) Peter Wood, Slides on Representing and Querying Data on the Web, Dan Suciu, Slides on The semistructured data model, CSE 590ds: Management of XML and Semistructured Data, W3C's XSL home page nwalsh.com/docs/tutorials/xsl/ an XSL tutorial by Paul Grosso and Norman Walsh metalab.unc.edu/xml/books/bible/updates/14.html a chapter from the XML Bible on XSL Transformations (and XPath)

28 Questions? Gestão e Tratamento de Informação DEI IST 2011/2012

Author: Irena Holubová Lecturer: Martin Svoboda

Author: Irena Holubová Lecturer: Martin Svoboda NPRG036 XML Technologies Lecture 6 XSLT 9. 4. 2018 Author: Irena Holubová Lecturer: Martin Svoboda http://www.ksi.mff.cuni.cz/~svoboda/courses/172-nprg036/ Lecture Outline XSLT Principles Templates Instructions

More information

EXtensible Markup Language (XML) a W3C standard to complement HTML A markup language much like HTML

EXtensible Markup Language (XML)   a W3C standard to complement HTML A markup language much like HTML XML and XPath EXtensible Markup Language (XML) a W3C standard to complement HTML A markup language much like HTML origins: structured text SGML motivation: HTML describes presentation XML describes content

More information

XML Wrap-up. CS 431 March 1, 2006 Carl Lagoze Cornell University

XML Wrap-up. CS 431 March 1, 2006 Carl Lagoze Cornell University XML Wrap-up CS 431 March 1, 2006 Carl Lagoze Cornell University XSLT Processing Model Input XSL doc parse Input XML doc parse Parsed tree serialize Input XML doc Parsed tree Xformed tree Output doc (xml,

More information

Semi-structured Data 11 - XSLT

Semi-structured Data 11 - XSLT Semi-structured Data 11 - XSLT Andreas Pieris and Wolfgang Fischl, Summer Term 2016 Outline What is XSLT? XSLT at First Glance XSLT Templates Creating Output Further Features What is XSLT? XSL = extensible

More information

Manipulating XML Trees XPath and XSLT. CS 431 February 18, 2008 Carl Lagoze Cornell University

Manipulating XML Trees XPath and XSLT. CS 431 February 18, 2008 Carl Lagoze Cornell University Manipulating XML Trees XPath and XSLT CS 431 February 18, 2008 Carl Lagoze Cornell University XPath Language for addressing parts of an XML document XSLT Xpointer XQuery Tree model based on DOM W3C Recommendation

More information

XML and Databases. Lecture 11 XSLT Stylesheets and Transforms. Sebastian Maneth NICTA and UNSW

XML and Databases. Lecture 11 XSLT Stylesheets and Transforms. Sebastian Maneth NICTA and UNSW XML and Databases Lecture 11 XSLT Stylesheets and Transforms Sebastian Maneth NICTA and UNSW CSE@UNSW -- Semester 1, 2010 Outline 1. extensible Stylesheet Language Transformations (XSLT) 2. Templates:

More information

Comp 336/436 - Markup Languages. Fall Semester Week 9. Dr Nick Hayward

Comp 336/436 - Markup Languages. Fall Semester Week 9. Dr Nick Hayward Comp 336/436 - Markup Languages Fall Semester 2018 - Week 9 Dr Nick Hayward DEV Week assessment Course total = 25% project outline and introduction developed using a chosen markup language consider and

More information

Introduction to Database Systems CSE 444

Introduction to Database Systems CSE 444 Introduction to Database Systems CSE 444 Lecture 25: XML 1 XML Outline XML Syntax Semistructured data DTDs XPath Coverage of XML is much better in new edition Readings Sections 11.1 11.3 and 12.1 [Subset

More information

Introduction to Data Management CSE 344

Introduction to Data Management CSE 344 Introduction to Data Management CSE 344 Lecture 11: XML and XPath 1 XML Outline What is XML? Syntax Semistructured data DTDs XPath 2 What is XML? Stands for extensible Markup Language 1. Advanced, self-describing

More information

XSLT. Lecture 38. Robb T. Koether. Mon, Apr 21, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XSLT Mon, Apr 21, / 26

XSLT. Lecture 38. Robb T. Koether. Mon, Apr 21, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XSLT Mon, Apr 21, / 26 XSLT Lecture 38 Robb T. Koether Hampden-Sydney College Mon, Apr 21, 2014 Robb T. Koether (Hampden-Sydney College) XSLT Mon, Apr 21, 2014 1 / 26 1 XSLT 2 Running XSLT 3 XSLT Files 4 Output Modes 5 XSLT

More information

10/24/12. What We Have Learned So Far. XML Outline. Where We are Going Next. XML vs Relational. What is XML? Introduction to Data Management CSE 344

10/24/12. What We Have Learned So Far. XML Outline. Where We are Going Next. XML vs Relational. What is XML? Introduction to Data Management CSE 344 What We Have Learned So Far Introduction to Data Management CSE 344 Lecture 12: XML and XPath A LOT about the relational model Hand s on experience using a relational DBMS From basic to pretty advanced

More information

Computer Science E-259

Computer Science E-259 Computer Science E-259 XML with Java Lecture 5: XPath 1.0 (and 2.0) and XSLT 1.0 (and 2.0), Continued 22 October 2007 David J. Malan malan@post.harvard.edu 1 Computer Science E-259 Last Time CSS Level

More information

XPath and XSLT. Overview. Context. Context The Basics of XPath. XPath and XSLT. Nodes Axes Expressions. Stylesheet templates Transformations

XPath and XSLT. Overview. Context. Context The Basics of XPath. XPath and XSLT. Nodes Axes Expressions. Stylesheet templates Transformations XPath and XSLT Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@imap.pitt.edu http://www.sis.pitt.edu/~spring Context The Basics of XPath Nodes

More information

Introduction to Database Systems CSE 414

Introduction to Database Systems CSE 414 Introduction to Database Systems CSE 414 Lecture 13: XML and XPath 1 Announcements Current assignments: Web quiz 4 due tonight, 11 pm Homework 4 due Wednesday night, 11 pm Midterm: next Monday, May 4,

More information

XSL Languages. Adding styles to HTML elements are simple. Telling a browser to display an element in a special font or color, is easy with CSS.

XSL Languages. Adding styles to HTML elements are simple. Telling a browser to display an element in a special font or color, is easy with CSS. XSL Languages It started with XSL and ended up with XSLT, XPath, and XSL-FO. It Started with XSL XSL stands for EXtensible Stylesheet Language. The World Wide Web Consortium (W3C) started to develop XSL

More information

XSLT. Announcements (October 24) XSLT. CPS 116 Introduction to Database Systems. Homework #3 due next Tuesday Project milestone #2 due November 9

XSLT. Announcements (October 24) XSLT. CPS 116 Introduction to Database Systems. Homework #3 due next Tuesday Project milestone #2 due November 9 XSLT CPS 116 Introduction to Database Systems Announcements (October 24) 2 Homework #3 due next Tuesday Project milestone #2 due November 9 XSLT 3 XML-to-XML rule-based transformation language Used most

More information

XSLT (part I) Mario Alviano A.Y. 2017/2018. University of Calabria, Italy 1 / 22

XSLT (part I) Mario Alviano A.Y. 2017/2018. University of Calabria, Italy 1 / 22 1 / 22 XSLT (part I) Mario Alviano University of Calabria, Italy A.Y. 2017/2018 Outline 2 / 22 1 Introduction 2 Templates 3 Attributes 4 Copy of elements 5 Exercises 4 / 22 What is XSLT? XSLT is a (Turing

More information

Section A: Multiple Choice

Section A: Multiple Choice Section A: Multiple Choice Question 1 Each item has only one correct answer. Two marks for each correct answer, zero marks for each incorrect answer. Use the supplied sheet to record a single response

More information

XML and Databases. Outline XML. XML, typical usage scenario XML. 1. extensible Stylesheet Language X M L. Sebastian Maneth NICTA and UNSW

XML and Databases. Outline XML. XML, typical usage scenario XML. 1. extensible Stylesheet Language X M L. Sebastian Maneth NICTA and UNSW Outline XML and Databases 1. extensible Stylesheet Language Transformations (XSLT) 2. Templates (match pattern action) Lecture 11 XSLT Stylesheets and Transforms Sebastian Maneth NICTA and UNSW 3. Default

More information

XML. Objectives. Duration. Audience. Pre-Requisites

XML. Objectives. Duration. Audience. Pre-Requisites XML XML - extensible Markup Language is a family of standardized data formats. XML is used for data transmission and storage. Common applications of XML include business to business transactions, web services

More information

XPath an XML query language

XPath an XML query language XPath an XML query language Some XML query languages: XML-QL XPath XQuery Many others 1 XML-QL http://www.w3.org/tr/note-xml-ql (8/98) Features: regular path expressions patterns, templates Skolem Functions

More information

Querying transformed XML documents: Determining a sufficient fragment of the original document

Querying transformed XML documents: Determining a sufficient fragment of the original document Querying transformed XML documents: Determining a sufficient fragment of the original document Sven Groppe, Stefan Böttcher University of Paderborn Faculty 5 (Computer Science, Electrical Engineering &

More information

XSL Concepts: Conditions and Loops. Robert Kiffe, Senior Web Developer OmniUpdate, Inc.

XSL Concepts: Conditions and Loops. Robert Kiffe, Senior Web Developer OmniUpdate, Inc. XSL Concepts: Conditions and Loops Robert Kiffe, Senior Web Developer OmniUpdate, Inc. Quick XSL Recap Conditional Statements If Choose XPath Conditional Loops For-Each For-Each-Group Apply-Templates Activities!

More information

Introduction to Semistructured Data and XML. Overview. How the Web is Today. Based on slides by Dan Suciu University of Washington

Introduction to Semistructured Data and XML. Overview. How the Web is Today. Based on slides by Dan Suciu University of Washington Introduction to Semistructured Data and XML Based on slides by Dan Suciu University of Washington CS330 Lecture April 8, 2003 1 Overview From HTML to XML DTDs Querying XML: XPath Transforming XML: XSLT

More information

XSLT program. XSLT elements. XSLT example. An XSLT program is an XML document containing

XSLT program. XSLT elements. XSLT example. An XSLT program is an XML document containing XSLT CPS 216 Advanced Database Systems Announcements (March 24) 2 Homework #3 will be assigned next Tuesday Reading assignment due next Wednesday XML processing in Lore (VLDB 1999) and Niagara (VLDB 2003)

More information

Introduction to Semistructured Data and XML

Introduction to Semistructured Data and XML Introduction to Semistructured Data and XML Chapter 27, Part D Based on slides by Dan Suciu University of Washington Database Management Systems, R. Ramakrishnan 1 How the Web is Today HTML documents often

More information

Computer Science E-259

Computer Science E-259 Computer Science E-259 XML with Java Lecture 4: XPath 1.0 (and 2.0) and XSLT 1.0 (and 2.0) 21 February 2007 David J. Malan malan@post.harvard.edu 1 Computer Science E-259 Last Time DOM Level 3 JAXP 1.3

More information

516. XSLT. Prerequisites. Version 1.2

516. XSLT. Prerequisites. Version 1.2 516. XSLT Version 1.2 This comprehensive four-day course develops in-depth knowledge and skills in transforming XML documents using extensible Stylesheet Language Transformations, or XSLT. Students work

More information

Style Sheet A. Bellaachia Page: 22

Style Sheet A. Bellaachia Page: 22 Style Sheet How to render the content of an XML document on a page? Two mechanisms: CSS: Cascading Style Sheets XSL (the extensible Style sheet Language) CSS Definitions: CSS: Cascading Style Sheets Simple

More information

EXAM XML 1.1 and Related Technologies TYPE: DEMO

EXAM XML 1.1 and Related Technologies TYPE: DEMO IBM EXAM - 000-142 XML 1.1 and Related Technologies TYPE: DEMO http://www.examskey.com/000-142.html 1 Question: 1 XML data is stored and retrieved within a relational database for a data-centric application

More information

XSL Elements. xsl:copy-of

XSL Elements. xsl:copy-of XSL Elements The following elements are discussed on this page: xsl:copy-of xsl:value-of xsl:variable xsl:param xsl:if xsl:when xsl:otherwise xsl:comment xsl:import xsl:output xsl:template xsl:call-template

More information

Introduction to XSLT. Version 1.0 July nikos dimitrakas

Introduction to XSLT. Version 1.0 July nikos dimitrakas Introduction to XSLT Version 1.0 July 2011 nikos dimitrakas Table of contents 1 INTRODUCTION... 3 1.1 XSLT... 3 1.2 PREREQUISITES... 3 1.3 STRUCTURE... 3 2 SAMPLE DATA... 4 3 XSLT... 6 4 EXAMPLES... 7

More information

Exam : Title : XML 1.1 and Related Technologies. Version : DEMO

Exam : Title : XML 1.1 and Related Technologies. Version : DEMO Exam : 000-142 Title : XML 1.1 and Related Technologies Version : DEMO 1. XML data is stored and retrieved within a relational database for a data-centric application by means of mapping XML schema elements

More information

Extensible Markup Stylesheet Transformation (XSLT)

Extensible Markup Stylesheet Transformation (XSLT) Extensible Markup Stylesheet Transformation (XSLT) Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Dept. of Computer Engineering Khon Kaen University 1 Overview Terms: XSL, XSLT, XSL-FO Value

More information

Querying XML Data. Querying XML has two components. Selecting data. Construct output, or transform data

Querying XML Data. Querying XML has two components. Selecting data. Construct output, or transform data Querying XML Data Querying XML has two components Selecting data pattern matching on structural & path properties typical selection conditions Construct output, or transform data construct new elements

More information

Introduction to Database Systems CSE 414

Introduction to Database Systems CSE 414 Introduction to Database Systems CSE 414 Lecture 14-15: XML CSE 414 - Spring 2013 1 Announcements Homework 4 solution will be posted tomorrow Midterm: Monday in class Open books, no notes beyond one hand-written

More information

Gestão e Tratamento de Informação

Gestão e Tratamento de Informação Departamento de Engenharia Informática 2013/2014 Gestão e Tratamento de Informação 1st Project Deadline at 25 Oct. 2013 :: Online submission at IST/Fénix The SIGMOD Record 1 journal is a quarterly publication

More information

XML, XPath, and XSLT. Jim Fawcett Software Modeling Copyright

XML, XPath, and XSLT. Jim Fawcett Software Modeling Copyright XML, XPath, and XSLT Jim Fawcett Software Modeling Copyright 1999-2017 Topics XML is an acronym for extensible Markup Language. Its purpose is to describe structured data. XPath is a language for navigating

More information

Next Generation Query and Transformation Standards. Priscilla Walmsley Managing Director, Datypic

Next Generation Query and Transformation Standards. Priscilla Walmsley Managing Director, Datypic Next Generation Query and Transformation Standards Priscilla Walmsley Managing Director, Datypic http://www.datypic.com pwalmsley@datypic.com 1 Agenda The query and transformation landscape Querying XML

More information

XML and XSLT. XML and XSLT 10 February

XML and XSLT. XML and XSLT 10 February XML and XSLT XML (Extensible Markup Language) has the following features. Not used to generate layout but to describe data. Uses tags to describe different items just as HTML, No predefined tags, just

More information

Data Formats and APIs

Data Formats and APIs Data Formats and APIs Mike Carey mjcarey@ics.uci.edu 0 Announcements Keep watching the course wiki page (especially its attachments): https://grape.ics.uci.edu/wiki/asterix/wiki/stats170ab-2018 Ditto for

More information

The XML Query Language Xcerpt: Design Principles, Examples, and Semantics

The XML Query Language Xcerpt: Design Principles, Examples, and Semantics The XML Query Language Xcerpt: Design Principles, Examples, and Semantics François Bry and Sebastian Schaffert Institute for Computer Science, University of Munich http://www.pms.informatik.uni-muenchen.de/

More information

XML Query Languages. Yanlei Diao UMass Amherst April 22, Slide content courtesy of Ramakrishnan & Gehrke, Donald Kossmann, and Gerome Miklau

XML Query Languages. Yanlei Diao UMass Amherst April 22, Slide content courtesy of Ramakrishnan & Gehrke, Donald Kossmann, and Gerome Miklau XML Query Languages Yanlei Diao UMass Amherst April 22, 2008 Slide content courtesy of Ramakrishnan & Gehrke, Donald Kossmann, and Gerome Miklau 1 Querying XML How do you query a directed graph? a tree?

More information

Introduction to XML. Yanlei Diao UMass Amherst April 17, Slides Courtesy of Ramakrishnan & Gehrke, Dan Suciu, Zack Ives and Gerome Miklau.

Introduction to XML. Yanlei Diao UMass Amherst April 17, Slides Courtesy of Ramakrishnan & Gehrke, Dan Suciu, Zack Ives and Gerome Miklau. Introduction to XML Yanlei Diao UMass Amherst April 17, 2008 Slides Courtesy of Ramakrishnan & Gehrke, Dan Suciu, Zack Ives and Gerome Miklau. 1 Structure in Data Representation Relational data is highly

More information

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on XML and Semantic Web

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on XML and Semantic Web Course on XML and Semantic Web Technologies, summer term 2012 0/44 XML and Semantic Web Technologies XML and Semantic Web Technologies I. XML / 5. XML Stylesheet Language Transformations (XSLT) Lars Schmidt-Thieme

More information

xmlns:gu="http://www.gu.au/empdtd" xmlns:uky="http://www.uky.edu/empdtd">

xmlns:gu=http://www.gu.au/empdtd xmlns:uky=http://www.uky.edu/empdtd> Namespaces Namespaces An XML document may use more than one DTD or schema Since each structuring document was developed independently, name clashes may appear The solution is to use a different prefix

More information

XSLT: How Do We Use It?

XSLT: How Do We Use It? XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman 1 XSLT: Agenda Introduction & Terminology XSLT Walkthrough Client-Side XSLT/XHTML Server-Side XSLT/XHTML More Creative Server-Side XSLT 2 XSLT:

More information

XSL Transformation (XSLT) XSLT Processors. Example XSLT Stylesheet. Calling XSLT Processor. XSLT Structure

XSL Transformation (XSLT) XSLT Processors. Example XSLT Stylesheet. Calling XSLT Processor. XSLT Structure Transformation (T) SOURCE The very best of Cat Stevens UK 8.90 1990 Empire Burlesque Bob

More information

XML. XML Namespaces, XML Schema, XSLT

XML. XML Namespaces, XML Schema, XSLT XML XML Namespaces, XML Schema, XSLT Contents XML Namespaces... 2 Namespace Prefixes and Declaration... 3 Multiple Namespace Declarations... 4 Declaring Namespaces in the Root Element... 5 Default Namespaces...

More information

Burrows & Langford Appendix D page 1 Learning Programming Using VISUAL BASIC.NET

Burrows & Langford Appendix D page 1 Learning Programming Using VISUAL BASIC.NET Burrows & Langford Appendix D page 1 APPENDIX D XSLT XSLT is a programming language defined by the World Wide Web Consortium, W3C (http://www.w3.org/tr/xslt), that provides the mechanism to transform a

More information

CSE-6490B Final Exam

CSE-6490B Final Exam February 2009 CSE-6490B Final Exam Fall 2008 p 1 CSE-6490B Final Exam In your submitted work for this final exam, please include and sign the following statement: I understand that this final take-home

More information

Sample Relational Database

Sample Relational Database Sample Relational Database Student: Alexander Rudolf Gruber MNr: 9812938 Table of Contents 1 Database Schema:... 2 2 Practical implementation of the database with mysql... 3 3 Inserting Test Data with

More information

Semantic Web. XSLT: XML Transformation. Morteza Amini. Sharif University of Technology Fall 95-96

Semantic Web. XSLT: XML Transformation. Morteza Amini. Sharif University of Technology Fall 95-96 ه عا ی Semantic Web XSLT: XML Transformation Morteza Amini Sharif University of Technology Fall 95-96 Outline Fundamentals of XSLT XPath extensible Stylesheet Language Cocoon 2 XSLT XSLT stands for extensible

More information

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards Representing Web Data: XML XML Example XML document: An XML document is one that follows certain syntax rules (most of which we followed for XHTML) Guy-Vincent

More information

Functions & Conditional Statements

Functions & Conditional Statements Functions & Conditional Statements OmniUpdate User Training Conference 2015 OmniUpdate, Inc. 1320 Flynn Road, Suite 100 Camarillo, CA 93012 OmniUpdate, Inc. 1320 Flynn Road, Suite 100 Camarillo, CA 93012

More information

Evaluating XPath Queries

Evaluating XPath Queries Chapter 8 Evaluating XPath Queries Peter Wood (BBK) XML Data Management 201 / 353 Introduction When XML documents are small and can fit in memory, evaluating XPath expressions can be done efficiently But

More information

XML and Databases XSLT Stylesheets and Transforms

XML and Databases XSLT Stylesheets and Transforms XML and Databases XSLT Stylesheets and Transforms Kim.Nguyen@nicta.com.au Lecture 11 1 / 38 extensible Stylesheet Language Transformations Outline 1 extensible Stylesheet Language Transformations 2 Templates

More information

The Transformation Language XSL

The Transformation Language XSL Chapter 8 The Transformation Language XSL 8.1 XSL: Extensible Stylesheet Language developed from CSS (Cascading Stylesheets) scripting language for transformation of data sources to HTML or any other optical

More information

Introduction to Semistructured Data and XML. Management of XML and Semistructured Data. Path Expressions

Introduction to Semistructured Data and XML. Management of XML and Semistructured Data. Path Expressions Introduction to Semistructured Data and XML Chapter 27, Part E Based on slides by Dan Suciu University of Washington Database Management Systems, R. Ramakrishnan 1 Management of XML and Semistructured

More information

Querying and Transforming XML Data Chapter5 Contents

Querying and Transforming XML Data Chapter5 Contents Contents Outline of Lecture... 153 Sources... 153 Motivation... 153 Querying and Transforming XML Data... 154 Tree Model of XML Data... 154 XML Hierarchy... 155 What is XPath?... 156 XPath - Selecting

More information

Applied Databases. Sebastian Maneth. Lecture 18 XPath and XSLT. University of Edinburgh - March 23rd, 2017

Applied Databases. Sebastian Maneth. Lecture 18 XPath and XSLT. University of Edinburgh - March 23rd, 2017 Applied Databases Lecture 18 XPath and XSLT Sebastian Maneth University of Edinburgh - March 23rd, 2017 2 Outline Lecture 19 (Monday March 27th): Recap / Exam preparation Lecture 20 (Monday March 27th):

More information

Introduction to XML (Extensible Markup Language)

Introduction to XML (Extensible Markup Language) Introduction to XML (Extensible Markup Language) 1 History and References XML is a meta-language, a simplified form of SGML (Standard Generalized Markup Language) XML was initiated in large parts by Jon

More information

INLS 760 Web Databases Lecture 12 XML, XPATH, XSLT

INLS 760 Web Databases Lecture 12 XML, XPATH, XSLT INLS 760 Web Databases Lecture 12 XML, XPATH, XSLT Robert Capra Spring 2013 Note: These lecture notes are based on the tutorials on XML, XPath, and XSLT at W3Schools: http://www.w3schools.com/ and from

More information

Burrows & Langford Chapter 9 page 1 Learning Programming Using Visual Basic.NET

Burrows & Langford Chapter 9 page 1 Learning Programming Using Visual Basic.NET Burrows & Langford Chapter 9 page 1 CHAPTER 9 ACCESSING DATA USING XML The extensible Markup Language (XML) is a language used to represent data in a form that does not rely on any particular proprietary

More information

Additional Readings on XPath/XQuery Main source on XML, but hard to read:

Additional Readings on XPath/XQuery Main source on XML, but hard to read: Introduction to Database Systems CSE 444 Lecture 10 XML XML (4.6, 4.7) Syntax Semistructured data DTDs XML Outline April 21, 2008 1 2 Further Readings on XML Additional Readings on XPath/XQuery Main source

More information

Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p.

Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p. Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p. 16 Attributes p. 17 Comments p. 18 Document Type Definition

More information

Advanced XSLT. Web Data Management and Distribution. Serge Abiteboul Ioana Manolescu Philippe Rigaux Marie-Christine Rousset Pierre Senellart

Advanced XSLT. Web Data Management and Distribution. Serge Abiteboul Ioana Manolescu Philippe Rigaux Marie-Christine Rousset Pierre Senellart Advanced XSLT Web Data Management and Distribution Serge Abiteboul Ioana Manolescu Philippe Rigaux Marie-Christine Rousset Pierre Senellart Web Data Management and Distribution http://webdam.inria.fr/textbook

More information

XSL extensible Style Language" DOCUMENTS MULTIMEDIA! Transforming documents using! XSLT" XSLT processor" XSLT stylesheet"

XSL extensible Style Language DOCUMENTS MULTIMEDIA! Transforming documents using! XSLT XSLT processor XSLT stylesheet DOCUMENTS MULTIMEDIA! Transforming documents using! XSLT" XSL extensible Style Language"!" A family of languages for defining document transformation and presentation" XSL XSLT XSL-FO Christine Vanoirbeek"

More information

Display the XML Files for Disclosure to Public by Using User-defined XSL Zhiping Yan, BeiGene, Beijing, China Huadan Li, BeiGene, Beijing, China

Display the XML Files for Disclosure to Public by Using User-defined XSL Zhiping Yan, BeiGene, Beijing, China Huadan Li, BeiGene, Beijing, China PharmaSUG China 2018 Paper CD-72 Display the XML Files for Disclosure to Public by Using User-defined XSL Zhiping Yan, BeiGene, Beijing, China Huadan Li, BeiGene, Beijing, China ABSTRACT US Food and Drug

More information

info-h-509 xml technologies Lecture 5: XSLT Stijn Vansummeren February 14, 2017

info-h-509 xml technologies Lecture 5: XSLT Stijn Vansummeren February 14, 2017 info-h-509 xml technologies Lecture 5: XSLT Stijn Vansummeren February 14, 2017 lecture outline 1 How XML may be rendered in Web Browsers 2 Syntax and Semantics of XSLT 3 How XPath is used in XSLT 1 our

More information

XML. COSC Dr. Ramon Lawrence. An attribute is a name-value pair declared inside an element. Comments. Page 3. COSC Dr.

XML. COSC Dr. Ramon Lawrence. An attribute is a name-value pair declared inside an element. Comments. Page 3. COSC Dr. COSC 304 Introduction to Database Systems XML Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca XML Extensible Markup Language (XML) is a markup language that allows for

More information

4. Unit: Transforming XML with XSLT

4. Unit: Transforming XML with XSLT Semistructured Data and XML 28 4. Unit: Transforming XML with XSLT Exercise 4.1 (XML to HTML) Write an XSLT routine performing the following task: Map the following country data for each country to an

More information

Advanced XSLT. Web Data Management and Distribution. Serge Abiteboul Philippe Rigaux Marie-Christine Rousset Pierre Senellart

Advanced XSLT. Web Data Management and Distribution. Serge Abiteboul Philippe Rigaux Marie-Christine Rousset Pierre Senellart Advanced XSLT Web Data Management and Distribution Serge Abiteboul Philippe Rigaux Marie-Christine Rousset Pierre Senellart http://gemo.futurs.inria.fr/wdmd January 15, 2010 Gemo, Lamsade, LIG, Télécom

More information

Introduction to XSLT. Version 1.3 March nikos dimitrakas

Introduction to XSLT. Version 1.3 March nikos dimitrakas Introduction to XSLT Version 1.3 March 2018 nikos dimitrakas Table of contents 1 INTRODUCTION... 3 1.1 XSLT... 3 1.2 PREREQUISITES... 3 1.3 STRUCTURE... 3 2 SAMPLE DATA... 4 3 XSLT... 6 4 EXAMPLES... 7

More information

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

PASS4TEST. IT Certification Guaranteed, The Easy Way!   We offer free update service for one year PASS4TEST IT Certification Guaranteed, The Easy Way! \ http://www.pass4test.com We offer free update service for one year Exam : 000-141 Title : XML and related technologies Vendors : IBM Version : DEMO

More information

The main Topics in this lecture are:

The main Topics in this lecture are: Lecture 15: Working with Extensible Markup Language (XML) The main Topics in this lecture are: - Brief introduction to XML - Some advantages of XML - XML Structure: elements, attributes, entities - What

More information

XPath and XSLT without the pain!

XPath and XSLT without the pain! XPath and XSLT without the pain! Bertrand Delacrétaz ApacheCon EU 2007, Amsterdam bdelacretaz@apache.org www.codeconsult.ch slides revision: 2007-05-04 Goal Learning to learn XPath and XSLT because it

More information

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1 Slide 27-1 Chapter 27 XML: Extensible Markup Language Chapter Outline Introduction Structured, Semi structured, and Unstructured Data. XML Hierarchical (Tree) Data Model. XML Documents, DTD, and XML Schema.

More information

XML in Databases. Albrecht Schmidt. al. Albrecht Schmidt, Aalborg University 1

XML in Databases. Albrecht Schmidt.   al. Albrecht Schmidt, Aalborg University 1 XML in Databases Albrecht Schmidt al@cs.auc.dk http://www.cs.auc.dk/ al Albrecht Schmidt, Aalborg University 1 What is XML? (1) Where is the Life we have lost in living? Where is the wisdom we have lost

More information

XML and Semantic Web Technologies. II. XML / 5. XML Stylesheet Language Transformations (XSLT)

XML and Semantic Web Technologies. II. XML / 5. XML Stylesheet Language Transformations (XSLT) XML and Semantic Web Technologies XML and Semantic Web Technologies II. XML / 5. XML Stylesheet Language Transformations (XSLT) Lars Schmidt-Thieme Information Systems and Machine Learning Lab (ISMLL)

More information

Presentation 19: XML technologies part 2: XSL, XSLT, XSL-FO, XPath & XML Programming

Presentation 19: XML technologies part 2: XSL, XSLT, XSL-FO, XPath & XML Programming Presentation 19: XML technologies part 2: XSL, XSLT, XSL-FO, XPath & XML Programming Outline XML recap Formatting CSS or XSL? XPath XSL/XSLT XSL-FO XML Programming Slide 2 XML markup recap XML based on

More information

Hypermedia and the Web XSLT and XPath

Hypermedia and the Web XSLT and XPath Hypermedia and the Web XSLT and XPath XSLT Extensible Stylesheet Language for Transformations Compare/contrast with CSS: CSS is used to change display characteristics of primarily HTML documents. But,

More information

XML Overview, part 1

XML Overview, part 1 XML Overview, part 1 Norman Gray Revision 1.4, 2002/10/30 XML Overview, part 1 p.1/28 Contents The who, what and why XML Syntax Programming with XML Other topics The future http://www.astro.gla.ac.uk/users/norman/docs/

More information

8/1/2016. XSL stands for EXtensible Stylesheet Language. CSS = Style Sheets for HTML XSL = Style Sheets for XML. XSL consists of four parts:

8/1/2016. XSL stands for EXtensible Stylesheet Language. CSS = Style Sheets for HTML XSL = Style Sheets for XML. XSL consists of four parts: XSL stands for EXtensible Stylesheet Language. CSS = Style Sheets for HTML XSL = Style Sheets for XML http://www.w3schools.com/xsl/ kasunkosala@yahoo.com 1 2 XSL consists of four parts: XSLT - a language

More information

DocBook: A Case Study and Anecdotes. Norman Walsh Sun Microsystems, Inc.

DocBook: A Case Study and Anecdotes. Norman Walsh Sun Microsystems, Inc. DocBook: A Case Study and Anecdotes Norman Walsh Sun Microsystems, Inc. Background What is DocBook? A DocBook Document DocBook History DocBook s Purpose 2 / 30 What is DocBook? DocBook is an XML vocabulary

More information

COP 4814 Florida International University Kip Irvine XSLT. Updated: 2/9/2016 Based on Goldberg, Chapter 2. Irvine COP 4814

COP 4814 Florida International University Kip Irvine XSLT. Updated: 2/9/2016 Based on Goldberg, Chapter 2. Irvine COP 4814 COP 4814 Florida International University Kip Irvine XSLT Updated: 2/9/2016 Based on Goldberg, Chapter 2 XSL Overview XSL Extensible Stylesheet Language A family of languages used to transform and render

More information

4. Unit: Transforming XML with XSLT

4. Unit: Transforming XML with XSLT Semistructured Data and XML 38 4. Unit: Transforming XML with XSLT Exercise 4.1 (XML to HTML) Write an XSLT routine that outputs the following country data for all countries with more than 1000000inhabitants

More information

Traditional Query Processing. Query Processing. Meta-Data for Optimization. Query Optimization Steps. Algebraic Transformation Predicate Pushdown

Traditional Query Processing. Query Processing. Meta-Data for Optimization. Query Optimization Steps. Algebraic Transformation Predicate Pushdown Traditional Query Processing 1. Query optimization buyer Query Processing Be Adaptive SELECT S.s FROM Purchase P, Person Q WHERE P.buyer=Q. AND Q.city= seattle AND Q.phone > 5430000 2. Query execution

More information

The Transformation Language XSL

The Transformation Language XSL Chapter 8 The Transformation Language XSL 8.1 XSL: Extensible Stylesheet Language developed from CSS (Cascading Stylesheets) scripting language for transformation of data sources to HTML or any other optical

More information

XML: Extensible Markup Language

XML: Extensible Markup Language XML: Extensible Markup Language CSC 375, Fall 2015 XML is a classic political compromise: it balances the needs of man and machine by being equally unreadable to both. Matthew Might Slides slightly modified

More information

Extensions to XSLT 1.0, and XSLT 2.0

Extensions to XSLT 1.0, and XSLT 2.0 ... Extensions A typical problem: XSLT 1.0 does not have any way of finding the current date and time. However, some XSLT 1.0 processors allow you to use extensions to XSLT 1.0. The EXSLT initiative http://www.exslt.org/

More information

SDPL : XML Basics 2. SDPL : XML Basics 1. SDPL : XML Basics 4. SDPL : XML Basics 3. SDPL : XML Basics 5

SDPL : XML Basics 2. SDPL : XML Basics 1. SDPL : XML Basics 4. SDPL : XML Basics 3. SDPL : XML Basics 5 2 Basics of XML and XML documents 2.1 XML and XML documents Survivor's Guide to XML, or XML for Computer Scientists / Dummies 2.1 XML and XML documents 2.2 Basics of XML DTDs 2.3 XML Namespaces XML 1.0

More information

Introduction to Database Systems CSE 414

Introduction to Database Systems CSE 414 Introduction to Database Systems CSE 414 Lecture 14: XQuery, JSON 1 Announcements Midterm: Monday in class Review Sunday 2 pm, SAV 264 Includes everything up to, but not including, XML Closed book, no

More information

CS145 Final Examination

CS145 Final Examination CS145 Final Examination Spring 2002, Prof. Widom Please read all instructions (including these) carefully. There are 10 problems on the exam, with a varying number of points for each problem and subproblem

More information

The XML Metalanguage

The XML Metalanguage The XML Metalanguage Mika Raento mika.raento@cs.helsinki.fi University of Helsinki Department of Computer Science Mika Raento The XML Metalanguage p.1/442 2003-09-15 Preliminaries Mika Raento The XML Metalanguage

More information

XSLT XML. Incremental Maintenance of Materialized XML Views Defined by XSLT DEWS2004 I-5-04

XSLT XML. Incremental Maintenance of Materialized XML Views Defined by XSLT DEWS2004 I-5-04 DEWS2004 I-5-04 XSLT XML 305 8573 1 1 1 305 8573 1 1 1 E-mail: syusaku@kde.is.tsukuba.ac.jp, {ishikawa,kitagawa}@is.tsukuba.ac.jp XML XML XSLT XML XML XSLT XML XML XUpdate XSLT XML XML XML XSLT XUpdate

More information

$Q,QFUHPHQWDO;6/77UDQVIRUPDWLRQ3URFHVVRU IRU;0/'RFXPHQW0DQLSXODWLRQ

$Q,QFUHPHQWDO;6/77UDQVIRUPDWLRQ3URFHVVRU IRU;0/'RFXPHQW0DQLSXODWLRQ $Q,QFUHPHQWDO;6/77UDQVIRUPDWLRQ3URFHVVRU IRU;0/'RFXPHQW0DQLSXODWLRQ /LRQHO9LOODUG 2SpUD3URMHFW,15,$5K{QH$OSHV5HVHDUFKXQLW =LUVWDYHQXHGHO (XURSH0RQWERQQRW 6DLQW,VPLHU&HGH[ )UDQFH 7HO )D[ OLRQHOYLOODUG#LQULDOSHVIU

More information

H2 Spring B. We can abstract out the interactions and policy points from DoDAF operational views

H2 Spring B. We can abstract out the interactions and policy points from DoDAF operational views 1. (4 points) Of the following statements, identify all that hold about architecture. A. DoDAF specifies a number of views to capture different aspects of a system being modeled Solution: A is true: B.

More information

XML Applications. Prof. Andrea Omicini DEIS, Ingegneria Due Alma Mater Studiorum, Università di Bologna a Cesena

XML Applications. Prof. Andrea Omicini DEIS, Ingegneria Due Alma Mater Studiorum, Università di Bologna a Cesena XML Applications Prof. Andrea Omicini DEIS, Ingegneria Due Alma Mater Studiorum, Università di Bologna a Cesena Outline XHTML XML Schema XSL & XSLT Other XML Applications 2 XHTML HTML vs. XML HTML Presentation

More information

AFew existing languages transforming XML data into

AFew existing languages transforming XML data into A formatting method for transforming XML data into HTML Zhe JIN, and Motomichi TOYAMA, Member, IEEE Abstract In this, we propose a fixed formatting method of PPX(Pretty Printer for XML). PPX is a query

More information