XSLT transformations Or how to get your XML to become HMTL.

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

Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
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.
Jennifer Widom Querying XML XSLT. Jennifer Widom XSLT Querying XML Not nearly as mature as Querying Relational  Newer  No underlying algebra Sequence.
XML XML What XML is and what it means to me as a Computer Scientist By: Derek Edwards CS 376 March 10, 2003.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
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.
WML/HTML and XML Multiplatform Applications. Agenda XML – History and purpose What have HTML, WML and XML got to do with each other Why useful for multiplatform.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
XSL Transformations Transforming XML document into other (XML) documents 1XSL Transformations.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
Philadelphia Area SharePoint User Group Using XSLT with Custom Web Parts Rick Wise RJB Technical Consulting
CIS 375—Web App Dev II XPath. 2 XPath IntroductionIntroduction What is XPath? XPath is a syntax for defining parts of an _____ document XPath uses paths.
Introduce of XML Xiaoling Song CS157A. What is XML? XML stands for EXtensible Markup Language XML stands for EXtensible Markup Language XML is a markup.
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.
Julien Thibault  HTML is the basic building-blocks of webpages  It is not a language!! (despite its name)  Structure text/media.
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.
ColdFusion’s XML Capabilities Maryland CFUG April 12, 2005 Presented by Doug Ward.
Introduction technology XSL. 04/11/2005 Script of the presentation Introduction the XSL The XSL standard Tools for edition of codes XSL Necessary resources.
Introduction to XSLT By Ed Rosenthal And Dave Pion.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XSLT transformations Or how to get your XML to become HMTL.
CIS 451: XSL Dr. Ralph Westfall February, Problems With XML no formatting capabilities contra formatting tags like, etc. in HTML CSS can be used.
CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute.
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
Session II Chapter 2 – Chapter 2 – XSLhttp://
Extensible Markup and Beyond
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
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.
XHTML,XML M.Abdullah Mrian. What is the XHTML Why XHTML ?
1 T RANSFORMING XSLT 2.0 T O XQ UERY 1.0 Advanced Database SystemsCOSC282 G OWRI S HANKAR D ARA T EAM M EMBERS D ARREL M AZZARI A LBIN L AGA A DITYA T.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
Li Tak Sing COMPS311F. XPath XPath is a simple language that allows you to write expressions to refer to different parts of an XML document. We will learn.
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
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.
The Information School at the University of Washington INFO 440: Information System Design Fall 2003 * Bob Boiko * MSIM Associate Chair XML Transforms.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
CIS 375—Web App Dev II XSL. 2 XSL Introduction XSL stands for _____________________________. XSL is the language used for manipulating and displaying.
Presentation Topic: XML and ASP Presented by Yanzhi Zhang.
Lecture 11 XSL Transformations (part 1: Introduction)
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
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.
Dom and XSLT Dom – document object model DOM – collection of nodes in a tree.
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.
 XSL – Extensible Style Sheet Language  XSLT – XSL Transformations › Used to transform XML documents to other formats,like HTML or other XML documents.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
Some Notes on XSLT Eugenia Fernandez IUPUI. Transforming XML with XSLT XSLT processor converts XML document into a node tree Uses XSLT stylesheet for.
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.
1 XSLT XSLT (extensible stylesheet language – transforms ) is another language to process XML documents. Originally intended as a presentation language:
April 20023CSG1XSL 1 Electronic Commerce XSL transformations John Wordsworth Department of Computer Science The University of Reading
Session IV Chapter 14 – Chapter 14 – XSLThttp://
Querying XML XSLT.
Unit 6 - XML Transformations
Presentation transcript:

XSLT transformations Or how to get your XML to become HMTL

Agenda What is XSL and XSLT How do I use them Example usage

What is XSL and XSLT Recap –XSL – EXtensible Stylesheet Language –XSLT - EXtensible Stylesheet Language Transformation One is the mechanism to store the structuring of the document The other is the method of applying that

XSLT XSLT transforms an XML document into another document XSLT uses XPath to navigate in XML documents XSLT is a W3C Standard

Why? You might have an XML document in one format (the supplier) and it is needed in another structure by another party (the manufacturer) You might want to convert from XML to another XML type language such as HTML or WML

How does it work? You create the structure of the new document You find the bits of the original document that you wish to extract information from You then place the original data into the new structure by transforming the data

XSLT files Start with an XML declaration Then choosing the node(s) that you wish to use Then state your formatting instructions Place your data in the relevant area For example

Base xml file <catalog><cd> Empire Burlesque Empire Burlesque Bob Dylan Bob Dylan <country>USA</country><company>Columbia</company><price>10.90</price><year>1985</year></cd><cd> Hide your heart Hide your heart Bonnie Tyler Bonnie Tyler <country>UK</country> CBS Records CBS Records <price>9.90</price><year>1988</year></cd>…….

XSL file My CD Collection My CD Collection Title Title Country Country </xsl:template></xsl:stylesheet> HTML formatting XSL code to choose area of XML file XSL code to choose node to display

Output

How to filter the list Because you use XPATH to access nodes you can filter data e.g. Will list every cd that costs over £10

Templates If you want to break down the formatting of a page to individual efforts you can use templates The command is The command is This can allow you to apply formatting to individual elements e.g

<html><body> My CD Collection My CD Collection <xsl:apply-templates/></body></html></xsl:template> <p> </p></xsl:template> : : </span><br/></xsl:template> : : </span><br/></xsl:template></xsl:stylesheet>

Write an XML file using an XSL file in ASP <% 'Load XMLxml = Server.CreateObject("Microsoft.XMLDOM").asyn c = false.load(Server.MapPath("cdcatalog.xml")) 'Load XSLxsl = Server.CreateObject("Microsoft.XMLDOM").asyn c = false.load(Server.MapPath("cdcatalog.xsl")) 'Transform file.Write(xml.transformNode(xsl)) %>