17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)

Slides:



Advertisements
Similar presentations
Internet Technologies1 1 Lecture 4: Programming with XSLT.
Advertisements

1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
XSLT (eXtensible Stylesheet Language Transformation) 1.
XSL XSLT and XPath 11-Apr-17.
+ 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.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
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.
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 Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
Object Oriented Programming III1 XSLT Processing XML using XSLT Using XPath.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Internet Technologies1 XSLT Processing XML using XSLT Using XPath.
XSL Transformations Transforming XML document into other (XML) documents 1XSL Transformations.
MC 365 – Software Engineering Presented by: John Ristuccia Shawn Posts Ndi Sampson XSLT Introduction BCi.
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.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
XML – Extensible Markup Language XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.
CSE3201/CSE4500 XPath. 2 XPath A locator for elements or attributes in an XML document. XPath expression gives direction.
XML for E-commerce III Helena Ahonen-Myka. In this part... n Transforming XML n Traversing XML n Web publishing frameworks.
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
XSLT for Data Manipulation By: April Fleming. What We Will Cover The What, Why, When, and How of XSLT What tools you will need to get started A sample.
CSE3201/CSE4500 Information Retrieval Systems
Introduction technology XSL. 04/11/2005 Script of the presentation Introduction the XSL The XSL standard Tools for edition of codes XSL Necessary resources.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XSLT and XPath, by Dr. Khalil1 XSL, XSLT and XPath Dr. Awad Khalil Computer Science Department AUC.
CIS 451: XSL Dr. Ralph Westfall February, Problems With XML no formatting capabilities contra formatting tags like, etc. in HTML CSS can be used.
WORKING WITH XSLT AND XPATH
Session II Chapter 2 – Chapter 2 – XSLhttp://
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:
Module Road Map Credit Categories Assignment 2 Credit Category 2 You are able to demonstrate how data may be filtered using Xpath You are able to demonstrate.
1 XSLT An Introduction. 2 XSLT XSLT (extensible Stylesheet Language:Transformations) is a language primarily designed for transforming the structure of.
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 "
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.
Transforming Documents „a how-to of transforming xml documents“ Lecture on Walter Kriha.
Lecture 11 XSL Transformations (part 1: Introduction)
XPath Aug ’10 – Dec ‘10. XPath   XML Path Language   Technology that allows to select a part or parts of an XML document to process   XPath was.
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
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 cs XSL XSL is a standard that consists of three parts: XPath (navigation in documents) XPath was taught in the DB course, so it will not be.
1 Copyright (c) [2000]. Roger L. Costello. All Rights Reserved. Using XSLT and XPath to Transform XML Documents Roger L. Costello XML Technologies.
Dr. Chunbo Chu Week 3. XML Not a replacement for HTML. XML and HTML were designed with different goals: XML was designed to transport and store data,
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.
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.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations Presenting XML and XBRL.
1 XMLXSL(T) and CSS NOEA/PQC (rev. fen) 2007 Stylesheets CSS:Cascading Style Sheets XSL(T):eXtended Stylesheet Language (Transformations)
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)
5 Copyright © 2004, Oracle. All rights reserved. Navigating XML Documents by Using XPath.
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.
XSLT, XML Schema, and XPath Matt McClelland. Introduction XML Schema ▫Defines the content and structure of XML data. XSLT ▫Used to transform XML documents.
April 20023CSG1XSL 1 Electronic Commerce XSL transformations John Wordsworth Department of Computer Science The University of Reading
XSLT 1.0.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations
XML Path Language Andy Clark 17 Apr 2002.
XML WITH CSS.
Unit 6 - XML Transformations
Presentation transcript:

17 Apr 2002 XML Stylesheets Andy Clark

What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT) Converting XML to another form – e.g. Use Xalan to convert to text, XML, HTML, etc… – Formatting objects (XSL:FO) Layout of XML document – e.g. Use FOP to convert to PDF, etc… – Defined by W3C

The Simplest Stylesheet (1 of 2) Empty XSLT document 01 02<xsl:stylesheet xmlns:xsl=‘ 03 version=‘1.0’> 04

The Simplest Stylesheet (2 of 2) Empty XSLT document – Note: This will simply copy the text content of the input document to the output <xsl:stylesheet xmlns:xsl=‘ 03 version=‘1.0’> 04

What Are Its Features? Features – Templates Map input patterns to output – Conditionals – Loops – Functions – Extensions

Templates Transformation rules – Selects nodes from input document Uses XPath expressions – Specifies output Can be text, XML, HTML (xml with html tags) Template modes – Allows multiple templates to have same rules Named templates – Call templates by name

Simple Template (1 of 4) Match document root – – – –

Simple Template (2 of 4) Match document root – – – –

Simple Template (3 of 4) Match document root – – – –

Simple Template (4 of 4) Match document root – – – –

Simple Template+ (1 of 5) Match document root – – – – –

Simple Template+ (2 of 5) Match document root – – – – –

Simple Template+ (3 of 5) Match document root – – – – –

Simple Template+ (4 of 5) Match document root – – – – –

Simple Template+ (5 of 5) Input Output Care and Feeding of Wombats 03 nn Care and Feeding of Wombats 04 05

Conditionals If statement –... Switch statement –... – Predicates –

Loops For statement – … –

XPath Functions Node-set functions – e.g. position(), last(), local-name(), etc… String functions – e.g. string(), contains(), substring(), etc… Boolean functions – e.g. boolean(), not(), etc… Number functions – e.g. number(), sum(), round(), etc…

XSLT Functions Multiple source documents – e.g. document(“document2.xml”) Keys Number formatting Additional functions – e.g. current(), system-property(), etc…

Example Transformation (0 of 14) Source Destination Care and Feeding of Wombats Item Price BK123 - Care and Feeding of Wombats 07 $

Example Transformation (1 of 14) Match element 01<xsl:stylesheet xmlns:xsl=‘ 02 version=‘1.0’> Item Price

Example Transformation (2 of 14) Match element 01<xsl:stylesheet xmlns:xsl=‘ 02 version=‘1.0’> Item Price

Example Transformation (3 of 14) Match element 01<xsl:stylesheet xmlns:xsl=‘ 02 version=‘1.0’> Item Price

Example Transformation (4 of 14) Match element 01<xsl:stylesheet xmlns:xsl=‘ 02 version=‘1.0’> Item Price

Example Transformation (5 of 14) Match element 01<xsl:stylesheet xmlns:xsl=‘ 02 version=‘1.0’> Item Price

Example Transformation (6 of 14) Match element

Example Transformation (7 of 14) Match element

Example Transformation (8 of 14) Match element

Example Transformation (9 of 14) Match element

Example Transformation (10 of 14) Match element ¥ 31 $

Example Transformation (11 of 14) Match element ¥ 31 $

Example Transformation (12 of 14) Match element ¥ 31 $

Example Transformation (13 of 14) Match element ¥ 31 $

Example Transformation (14 of 14) Output ItemPrice BK123 - Care and Feeding of Wombats$42.00

Rendering XML in Browsers Latest browsers (e.g. IE 6.0+) have support for XSLT Insert “xml-stylesheet” processing instruction – Output ItemPrice BK123 - Care and Feeding of Wombats$42.00

Useful Links XPath 1.0 Specification – XSLT 1.0 Specification –

XML Stylesheets Andy Clark