Creating an XSLT Style Sheet for Formatting Data

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

XML III. Learning Objectives Formatting XML Documents: Overview Using Cascading Style Sheets to format XML documents Using XSL to format XML documents.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
Technology Reviews :XSL Park, Ho-gun. What is XSL Extensible Style sheet LanguageExtensible Style sheet Language An XML-based language used to.
 2001 Prentice Hall, Inc. All rights reserved. 1.
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.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
Tutorial 3 Introducing Cascading Style Sheets. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Learn about Cascading Style Sheets Write.
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)
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
Understanding HTML Style Sheets. What is a style?  A style is a rule that defines the appearance and position of text and graphics. It may define the.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
Basics of HTML.
WORKING WITH NAMESPACES
Julien Thibault  HTML is the basic building-blocks of webpages  It is not a language!! (despite its name)  Structure text/media.
HTML Line Breaks and HTML Horizontal Rules (Lines)
CSS Cascading Style Sheets By Garrett Garman. CSS Why use Style Sheets? Separates Appearance and Structure Modularity Quick and Easy changes Flexibility.
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
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
Styles with Cascading Style Sheets (CSS) Web Design – Section 4-1 Part or all of this lesson was adapted from the University of Washington’s “Web Design.
Adding Hypertext Links to a Web Page Tutorial 2 eXtensible Markup Language (XML)
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.
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 34 - Case Study: Active Server Pages and XML Outline 34.1 Introduction 34.2 Setup and Message.
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.
IST 221 Internet Concepts and Applications Introduction to XML II CSS and XSLT Style Sheets.
ITB Web programming for E- Commerce 1 ITB6227 Programming for E-COMMERCE Lecture Presentation of XML Documents.
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.
Louisa Lambregts, Louisa Lambregts
Cascading Style Sheets CSS. Source W3Schools
DYNAMIC HTML What is Dynamic HTML: HTML code that allow you to change/ specify the style of your web pages. Example: specify style sheet, object model.
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.
WEEK -1 ACM 262 ACM 262 Course Notes. HTML What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML.
University of South Asia Course Name: Web Application Prepared By: Md Rezaul Huda Reza
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
Chapter 29. Copyright 2003, Paradigm Publishing Inc. CHAPTER 29 BACKNEXTEND 29-2 LINKS TO OBJECTIVES Attach an XML Schema Attach an XML Schema Load XML.
1 ITEC 4830 Graphics Design Chapter 1 Dreamweaver MX 2004 Basics.
Basic Web Page Design. Text book: HTML, XHTML, and CSS: Visual QuickStart Guide, Sixth Edition written by Elizabeth Castro. Software: Adobe® Dreamweaver®
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
Tutorial 03 Working with Schemas 1. Contents The University Hospital Problem Solution 2.
Module Road Map Document Transformations Web Form (ASPX) HTML Form.
WEB FOUNDATIONS CSS Overview. Outline  What is CSS  What does it do  Where are styles stored  Why use them  What is the cascade effect  CSS Syntax.
In this session, you will learn to:
XSLT: The XML transformation language
CSS Cascading Style Sheets
Document Type Definition
Tutorial 9 Working with XHTML
Tutorial 04 (cont’) Using XPath Patterns in an XSLT Style Sheet.
Creating an XML Document
Styles with Cascading Style Sheets (CSS)
Styles with Cascading Style Sheets (CSS)
CASCADING STYLE SHEET CSS.
Cascading Style Sheets - Building a stylesheet
More Sample XML By Sadia Anjum.
Tutorial 3 Working with Cascading Style Sheets
Apply procedures to create cascading style sheets.
Cascading Style Sheets - Building a stylesheet
Presentation transcript:

Creating an XSLT Style Sheet for Formatting Data Tutorial 04 Creating an XSLT Style Sheet for Formatting Data

Contents The CyberShoppe Problem Solution

The CyberShoppe Problem CyberShoppe needs to display product details, such as product ID, name of the product, and price per unit. The output should be displayed as shown below: In the output, all details about products should be displayed in red.

Solution Creating a style sheet Applying the style sheet to the XML document Testing

1. Creating a style sheet 1.1 Creating a new XSL file 1.2 Inserting template 1.3 Using for loop to retrieve data 1.4 Sorting data 1.5 Displaying data

1.1 Creating a new XSL file Open XML Spy > New > xsl > Generic XSL/XSLT Transformation > OK

1.2 Inserting template Use the pattern “/” to perform the action from the root node.

1.3 Using for loop to retrieve data

1.4 Sorting data Use @ to retrieve the attribute value

1.5 Displaying data Use tag <li> to display the list, <xsl:text> to display text, <font> to format the text color. Save it as product.xsl

2. Applying the style sheet to the XML document 2.1 Creating a new XML document 2.2 Applying the XSL file to the XML file

2.1 Creating a new XML document Create a new XML document which has the following content, save it as product.xml

2.2 Applying the XSL file to the XML file Insert a xml syntax as below:

3. Testing Open the xml file with a web browser to check it again

References New Perspectives on Creating Web Pages with HTML and XML (Patrick Carey & Mary Kemper) - Course Technology Publisher Creating Cool Web Sites with HTML, XHTML and CSS - Taylor, Dave, Wiley