In this session, you will learn to:

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.
DOCUMENT TYPES. Digital Documents Converting documents to an electronic format will preserve those documents, but how would such a process be organized?
Cascading Style Sheets (CSS). Cascading Style Sheets With the explosive growth of the World Wide Web, designers and programmers quickly explored and reached.
Technology Reviews :XSL Park, Ho-gun. What is XSL Extensible Style sheet LanguageExtensible Style sheet Language An XML-based language used to.
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.
XSLT (eXtensible Stylesheet Language Transformation) 1.
XSL XSLT and XPath 11-Apr-17.
1/18 ITApplications XML Module Session 5: Extensible Stylesheet Language (XSL)
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
Rendering XML documents with XSL The most powerful approaches to rendering XML documents involve using XSL (eXtensible Stylesheet Language) XSL enables.
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
LBSC 690: Session 6 CSS, XML/XSLT Jimmy Lin College of Information Studies University of Maryland Monday, October 15, 2007.
LBSC 690 Session #6 CSS, XML/XSLT Jimmy Lin The iSchool University of Maryland Wednesday, October 8, 2008 This work is licensed under a Creative Commons.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
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.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
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
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
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
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 "
IST 221 Internet Concepts and Applications Introduction to XML II CSS and XSLT Style Sheets.
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.
XSL and XSLT 06. XSL and XSLT © Aptech Limited Introduction to XSL  In this first lesson, Introduction to XSL, you will learn to:  Define XSL, XSLT,
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.
XSLT. XSLT stands for Extensible Stylesheet Language Transformations XSLT is used to transform XML documents into other kinds of documents. XSLT can produce.
 XSL – Extensible Style Sheet Language  XSLT – XSL Transformations › Used to transform XML documents to other formats,like HTML or other XML documents.
Accessing XML Documents Using DOM ©NIITeXtensible Markup Language/Lesson 8/Slide 1 of 23 Objectives In this lesson, you will learn to: * Use XML DOM objects.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
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.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML.
CH 15 XSL Transformations 1. Objective What is XSL? Overview of XSL transformations Understanding XSL templates Computing the value of a node with xsl:value-of.
XSLT: The XML transformation language
CSS Cascading Style Sheets
In this session, you will learn to:
XML: Extensible Markup Language
Creating an XSLT Style Sheet for Formatting Data
In this session, you will learn to:
Cascading Style Sheets (CSS)
Intro to CSS CS 1150 Fall 2016.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Intro to CSS CS 1150 Spring 2017.
Creating an XML Document
Applying eXtensible Style Sheets (XSL)
Rationale Data interchange is essential to carry out business transactions. However, organizations store data in disparate formats, which makes the process.
In this session, you will learn to:
XML WITH CSS.
Introduction to Cascading Style Sheets (CSS)
Working with Cascading Style Sheets (CSS)
Working with Cascading Style Sheets (CSS)
What are Cascading Stylesheets (CSS)?
WHAT IS XSLT?.
XSL XSLT and XPath 24-Feb-19.
Unit 6 - XML Transformations
Presentation transcript:

In this session, you will learn to: Objectives In this session, you will learn to: Transform an XML document through a Cascading Style Sheet Transform an XML document through Extensible Style Sheet Language Introduce the students to the course by asking them what they know about forensics. Next, ask the students what they know about system forensics and why is it required in organizations dependent on IT. This could be a brief discussion of about 5 minutes. Lead the discussion to the objectives of this chapter.

Introducing Cascading Style Sheet A CSS is a text file containing one or more rules or definitions for the style characteristics of a particular element. It controls how tags are formatted in XML and HTML documents. The CSS file can be included in XML documents with the same data structure. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.

The syntax for coding a CSS is: elementname { Creating CSS The syntax for coding a CSS is: elementname { property1: value; property2: value; } elementname specifies the name of the element. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.

The syntax for coding a CSS is: elementname { Creating CSS (Contd.) The syntax for coding a CSS is: elementname { property1: value; property2: value; } property1 and property2 specify the property names, such as font-family, font-size, and color Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.

The syntax for coding a CSS is: elementname { Creating CSS (Contd.) The syntax for coding a CSS is: elementname { property1: value; property2: value; } value specifies the property values for a property name. For example, to display the film title in red, you can type the following code in a CSS file: FILM {COLOR: RED} Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.

A CSS can be applied to an XML document using the following syntax: Applying CSS A CSS can be applied to an XML document using the following syntax: <?xml:stylesheet type="text/css" href="path-name"?> Instructs the browser that the XML document uses a stylesheet. Hold a two- three minute discussion on the different types of system-related crimes that the students have experienced or heard. At the end of the discussion, give additional examples of system-related crimes.

A CSS can be applied to an XML document using the following syntax: Applying CSS (Contd.) A CSS can be applied to an XML document using the following syntax: <?xml:stylesheet type="text/css" href="path-name"?> Specifies the type of formatting that is being used. Hold a two- three minute discussion on the different types of system-related crimes that the students have experienced or heard. At the end of the discussion, give additional examples of system-related crimes.

A CSS can be applied to an XML document using the following syntax: Applying CSS (Contd.) A CSS can be applied to an XML document using the following syntax: <?xml:stylesheet type="text/css" href="path-name"?> Specifies the name of the CSS file used to format the XML document. Hold a two- three minute discussion on the different types of system-related crimes that the students have experienced or heard. At the end of the discussion, give additional examples of system-related crimes.

Demo: Creating a CSS Problem Statement: Jim, the XML developer at CyberShoppe, has been asked to display the product details for Cybershoppe in a browser in the following format: The price per unit, description, and quantity on hand for each product should be displayed in teal, with a font size of 10 pts. The product name should be displayed in red, with a font size of 20 pts. It should be displayed in bold. All details should be displayed in the Arial font. While explaining the definition of system forensics, ask the students to note the following key words in the definition: Identify Extract Process Analyze Digital and hardware evidence Tell the students that these form an integral aspect of system forensics and would be discussed in detail. Before moving on to the next slide, hold a brief discussion on why is it important for organizations to take the help of system forensics. The discussion should be focused on: The role that system forensics plays in organizations having an IT set up. This discussion will serve as a precursor to the next slide.

Introducing XSL CSS does not support the reorder, sort, and display of elements based on a condition. For such advanced formatting, XML supports Extensible Style Sheet Language (XSL). XSL has two parts: XSL Transformations (XSLT) XML Path (XPath) XSL: Contains instructions on how an XML document should be transformed into an HTML or an XHTML document. Uses XPath expressions to extract specific data from an XML document. The XSLT processor transforms the XML document into an HTML or XHTML or into another XML document. While explaining the definition of system forensics, ask the students to note the following key words in the definition: Identify Extract Process Analyze Digital and hardware evidence Tell the students that these form an integral aspect of system forensics and would be discussed in detail. Before moving on to the next slide, hold a brief discussion on why is it important for organizations to take the help of system forensics. The discussion should be focused on: The role that system forensics plays in organizations having an IT set up. This discussion will serve as a precursor to the next slide.

Analyzing the Working of the XSLT Processor The XSLT processor applies the transformation information to the source document and builds the result tree as shown in the following figure. MSXML Parser XSLT style sheet XSLT tree Elaborate on the role that system forensics plays in an organization, based on the discussion in the previous slide and the information given on this slide. XSLT processor Result tree XML document Source tree

Formatting Data Using XSLT XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Formatting Data Using XSLT (Contd.) XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Instructs the browser that the document is a style sheet file. Is the root element for all XSLT style sheets. Is written as: <xsl:stylesheet xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" version="1.0"> Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Formatting Data Using XSLT (Contd.) XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Displays the value of the specified element or attribute. Follows the syntax: <xsl:value‑of select="elementname/attributename"/> Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Formatting Data Using XSLT (Contd.) XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Instructs the XSLT processor to process the information for each instance of the specified pattern. Follows the syntax: <xsl:for-each select="pattern"> [action to be performed] </xsl:for-each> Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Formatting Data Using XSLT (Contd.) XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Sorts data based on the values assigned to elements and attributes. Follows the syntax: <xsl:sort select="expression" order="ascending | descending" case-order="upper-first | lower-first“ data-type="text | number | qname"/> Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Formatting Data Using XSLT (Contd.) XSLT provides the following elements to select and format data: stylesheet value-of for-each sort text Generates constant text in the output and displays labels. Follows the syntax: <xsl:text> Text to be displayed as label </xsl:text> Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Formatting Data Using XSL Formatting Objects XSL Formatting Objects (XSL-FO): Is an XML-based language that formats XML documents into pages, paragraphs, and lists. Provides various objects and properties that define the formatting of XML objects. Provides a basic document structure that contains the formatting objects and properties. Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Formatting Data Using XSL Formatting Objects (Contd.) The following code snippet depicts the structure of an XML document: Is <?xml version="1.0" encoding="ISO-8859-1"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="A4"> <!-- Page template goes here --> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4"> <!-- Page content goes here --> </fo:page-sequence> </fo:root> Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Formatting Data Using XSL Formatting Objects (Contd.) The XSL-FO objects provides a logical layout to an XML document. The content of an XML document can be split into pages. These pages are divided into following four areas: Regions: Are the topmost areas in the page. Block areas: Are the block level elements. Line areas: Contain the text within the block areas. Inline areas: Are part of line areas. Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Formatting Data Using XSL Formatting Objects (Contd.) The XSL-FO properties specifies the type of formatting that can be specified on the XSL-FO objects. Consider the following code-snippet: <fo:simple-page-master master-name="right"> <fo:region-body margin-left="5in" margin-right="2in"/> </fo:simple-page-master> This element defines a template with the name right. This specifies that the left margin of the template is set to 5 inches. Connect the information given on this slide to the initial discussion held on the different types of system-related crimes. This specifies that the right margin of the template is set to 2 inches.

Creating XSLT Template Rules A template rule: Describes how an XML element and its contents are converted into a specific format for displaying in the browser. Consists of two parts: A pattern that identifies an XML element in an XML document. An action or processing code that details the transformation and rendering of the resulting element. XSLT uses two main elements for creating template rules: template apply-templates Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Creating XSLT Template Rules (Contd.) A template rule: Describes how an XML element and its contents are converted into a specific format for displaying in the browser. Consists of two parts: A pattern that identifies an XML element in an XML document. An action or processing code that details the transformation and rendering of the resulting element. XSLT uses two main elements for creating template rules: template apply-templates Defines a template for the desired output. Follows the syntax: <xsl:template match="pattern"> [action to be taken] </xsl:template> Connect the information given on this slide to the initial discussion held on the different types of system-related crimes.

Creating XSLT Template Rules (Contd.) A template rule: Describes how an XML element and its contents are converted into a specific format for displaying in the browser. Consists of two parts: A pattern that identifies an XML element in an XML document. An action or processing code that details the transformation and rendering of the resulting element. XSLT uses two main elements for creating template rules: template apply-templates Connect the information given on this slide to the initial discussion held on the different types of system-related crimes. Instructs the XSLT processor to find an appropriate template and perform the specified tasks on selected elements. Follows the syntax: <xsl:apply‑templates [select="pattern"]>

The details about the products should be displayed in red. Demo: Creating an XSLT Style Sheet to Format Data Problem Statement: CyberShoppe needs to display product details, such as product ID, name, and price per unit. The following figure depicts a sample output. The details about the products should be displayed in red. While explaining the definition of system forensics, ask the students to note the following key words in the definition: Identify Extract Process Analyze Digital and hardware evidence Tell the students that these form an integral aspect of system forensics and would be discussed in detail. Before moving on to the next slide, hold a brief discussion on why is it important for organizations to take the help of system forensics. The discussion should be focused on: The role that system forensics plays in organizations having an IT set up. This discussion will serve as a precursor to the next slide.

Practice Questions The various departments of a university store data in different formats. The IT department of the university decides to use XML as the data interchange format to transmit the data between the departments. Which of the following would be the best approach to accomplish the task using XML? a. Devise a common information model and enforce its use by all the departments that need to exchange data. b. Implement a conversion application that can handle the data received from other departments. Reiterate the concepts taught earlier by asking the given question.

Practice Questions (Contd.) c. Use an XSLT style sheet to convert the incoming or outgoing XML document into the format used within the departments. d. Modify the XML schema to use the same content model in all departments. Reiterate the concepts taught earlier by asking the given question. Answer: c. Use an XSLT style sheet to convert the incoming or outgoing XML document into the format used within the departments.

Practice Questions Which of the following code snippets can be used in an XML document named Test.xml to associate it with a style sheet named Test.css? a. <?xml-stylesheet href="Test.css" type="text/css"?> b. <?xml-stylesheet href="Test.xsl" type="text/css"?> c. <?xmlstylesheet href="Test.css" type="text/xsl"?> d. <xml-stylesheet href="Test.css" type="text/css"/> Reiterate the concepts taught earlier by asking the given question. Answer: a. <?xml-stylesheet href=”Test.css” type=”text/css”?>

Consider the following statements: Practice Questions Consider the following statements: Statement A: CSS can be used to reorder, add, delete, or perform other operations on elements. Statement B: CSS uses less memory when compared to XSLT. Which of the following is correct about the preceding statements? a. Statement A is True, and Statement B is False. b. Statement A is False, and Statement B is True. c. Both, Statement A and Statement B, are True. d. Both, Statement A and Statement B, are False. Reiterate the concepts taught earlier by asking the given question. Answer: b. Statement A is False, and Statement B is True.

Which element must contain one or more when elements? Practice Questions Which element must contain one or more when elements? a. xsl:if b. xsl:for-each c. xsl:sort d. xsl:choose Reiterate the concepts taught earlier by asking the given question. Answer: d. xsl:choose

Consider the following statements: Practice Questions Consider the following statements: Statement A: XSLT is a superset of the CSS functionality. Statement B: XSLT is an application of XML. Which of the following is correct about the preceding statements? a. Statement A is True, and Statement B is False. b. Statement A is False, and Statement B is True. c. Both, Statement A and Statement B, are True. d. Both, Statement A and Statement B, are False. Reiterate the concepts taught earlier by asking the given question. Answer: c. Both, Statement A and Statement B, are True.

In this session, you learned that: Summary In this session, you learned that: Rendering is the process of formatting and presenting the data in an XML document in different formats. A style sheet is a document that contains the formatting rules for one or several XML documents. The two types of style sheets that can be used with XML documents are: CSS XSL CSS is used to define the style or appearance of an XML document. XSL is made up of XSLT and XPath. XSLT is used to display selective elements or attributes, sort data on one or more elements, and process the data based on conditions.

Summary (Contd.) The XSLT processor applies the transformation information contained in the XSLT style sheet and builds a resultant tree structure, which is then rendered to various targets. XSLT elements, such as template, apply-templates, sort, for-each, and value-of are used to extract and format data. XSL-FO provides formatting objects to break XML documents into pages, paragraphs, and lists. The associated properties of the formatting objects allow you to format the XML documents. A template rule describes how an XML element and its contents are converted into a format that can be displayed in the browser.