INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.

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.
 2001 Prentice Hall, Inc. All rights reserved. 1.
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.
+ XSL eXtensible Stylesheet Language. + 2 XML Lecture Adapted from the work of Prof Mark Baker ACET, University of Reading.
XML and XSL Transforming your XML documents with eXtensible Stylesheet Language Transformations [Optional Lecture]
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.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
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.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
XSLT Part 3B. id() The id() function returns a node-set containing the node or nodes with a given ID attribute. An ID attribute in this context is any.
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.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
XML for E-commerce III Helena Ahonen-Myka. In this part... n Transforming XML n Traversing XML n Web publishing frameworks.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
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.
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
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
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.
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 "
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.
CIS 375—Web App Dev II XSL. 2 XSL Introduction XSL stands for _____________________________. XSL is the language used for manipulating and displaying.
Lecture 11 XSL Transformations (part 1: Introduction)
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
 2002 Prentice Hall, Inc. All rights reserved. 1 Chapter 12 – XSL: Extensible Stylesheet Language Transformations (XSLT) Outline 12.1Introduction 12.2Setup.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
1 Introduction to XML XML stands for Extensible Markup Language. Because it is extensible, XML has been used to create a wide variety of different markup.
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.
XP New Perspectives on XML, 2 nd Edition Tutorial 8 1 TUTORIAL 8 CREATING ELEMENT GROUPS.
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
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,
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.
ACG 4401 XSLT Extensible Stylesheet Language for Transformations Presenting XML and XBRL.
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
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.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML Introduction to XML Extensible Markup Language.
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.
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.
1 XSLT XSLT (extensible stylesheet language – transforms ) is another language to process XML documents. Originally intended as a presentation language:
Unit 4 Representing Web Data: XML
Using XSLT and XPath to Transform XML Documents
ACG 4401 XSLT Extensible Stylesheet Language for Transformations
Chapter 7 Representing Web Data: XML
Attributes, Empty-Element Tags, and XSL
Presentation transcript:

INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg

Breeze –Input PSU Access ID –Feel free to enter the “room” anytime Download prompted software; it only takes a minute With a camera: –start camera –talk into the microphone Without a camera, feel free to join in using the “chat” pod!

XML Reviewed.

Element: Building Block of XML Each element has a name and content Each element has a start and end tag XML does NOT define elements Example:

XML Environment

Attributes Another XML Building Block –Adds richer metadata to elements –Information to help describe an XML element –Contained in the element tag

More about XML Example:  Name/value pair  Value is bounded by quotes

. …………………... class = …………………………….. Attribute:

Example from PortfolioProject Gayle J Yaverbaum

Comments Example

References that are immediately replaced by the character they represent. Predefined e.g. < > (as in HTML) 50 < 100 Programmer defined entities (to be demonstrated later) Predefined Entities Example

Parsing with XSLT XML Stylesheet Language Transformation

Review of Course Software  Sun Java (jdk1.5.0_01 or above) Saxon will not work with earlier versions of JAVA. Java will need environment variables adjusted for the directories in which you placed JAVA JAVA_HOMEc:/JDK1.5.0_ CLASSPATH c:/jdk1.5.0_01/lib; c:/jdk1.5.0_01/bin  Eclipse 3.2. Write xml and xsl files (and others). Produce and test JAVA code. See Eclipse instructions. Install AFTER Java

Saxon  Download Saxon fromSaxon Select the open source and freeware version: i.e. Saxon-B 8.8 Select the download for JAVA (saxon will use XML parser supplied with the Java VM. Unzip files into a suitable directory. eg saxon8

Saxon Saxon Environment Variables( adjust for directory in which you place SAXON: C:\saxon8\saxon8.jar; C:\saxon8\saxon8-jdom.jar; C:\saxon8\saxon8-xom.jar; C:\saxon8\saxon8-sql.jar

XYZXYZ XSLT Processor (saxon) aa Y bb X aa Z bb W cc How It Works! Result: HTML Page Data/Information Transformation of XML to a different format.

Transforming XML to XHTML Format SAXON 8.n XSLT implements the XSLT 2.0 and XPath 1.0 recommendations from the World Wide Web Consortium Referred to collectively as "XSLT"Saxon parser

XSL Stylesheets Must contain “attribute version” (2.0) Must include xmlms:xsl –Is a namespace declaration. –value of xmlns:xsl is always "

Template Each xsl:template element must contain either match or name attribute Match templates are the basic building block of xsl Name templates are associated with reuse of code (later)

XSL: Extensible Stylesheet Language XSL transforms documents to XHTML Specifies how the data should be rendered

XML (from last week’s lab)

VIRTUAL PORTFOLIO Used to convey to others the skill level of the person who is maintaining the portfolio. Artists typically demonstrate skills via a portfolio. Relevant here because skills are mastered throughout the semester. Output is a measure of skill level. The objective of a portfolio is to track, evaluate, and improve performance by providing work examples.

An electronic portfolio is: [1] * a collection of authentic and diverse evidence, * drawn from a larger archive representing what a person or organization has learned over time * on which the person or organization has reflected, and * designed for presentation to one or more audiences for a articular rhetorical purpose. [1] Barrett, H., Wilkerson, J. (2004), Conflicting Paradigms in Electronic Portfolio Approaches Choosing an Electronic Portfolio Strategy that Matches your Conceptual Framework

INFSY 547 PORTFOLIO A collection of work that an individual completes this semester. Private WEB space (PASS) rather than paper output. Portfolio becomes an evolutionary development of all work Using your virtual drive Available when you log on to any PSU machine See PASS on syllabus resources for further information about how to access your personal space. Form to Open PASS Space

Sample XML (for discussion purposes) XML.jpg The Structure of a Portfolio Gayle J Yaverbaum

XSLT Documents Explained! XSLT Documents: Differentiated by a root element, called stylesheet. <xsl:stylesheet version = “2.0" xmlns:xsl = " Each template describes how to transform the data elements. Uses one or more templates or instructions

TEMPLATES An XSLT document is an XML document Has a root element of stylesheet The stylesheet namespace is:

Explanation: Root template.  The “/” is a pattern that matches root  The xsl: indicates a “namespace” and is essential here to distinguish XSLT from non XSLT elements.

<xsl:stylesheet xmlns:xsl=" xmlns=" version="2.0"> Projects <link rel="stylesheet" type="text/css“ href="PortfolioProject.css" /> INFSY 547 XSLT

Templates Matches the document root node Matches any element nodes Applies templates to child nodes <xsl:stylesheet xmlns:xsl=" xmlns=" version="2.0">

The Process 1.Parser will always look for the root of the XML document 2.Typically will be: 3. Each template has a match attribute.

XSL  A very special XLST Instruction (xsl:apply-templates)  Identifies the node-set  Will match all child nodes to templates

Patterns Templates contain patterns Patterns match elements. Patterns define a condition that a node may or may not satisfy Whenever you have a beginning template, you will need an ending eg element

.

“/” Symbol ■ Use the “/” symbol to match specific hierarchies ■ Use the “/” to specify deeper matches also ■ Use // slash to select deeper levels

for-each ■ Processes each element chosen by its select attribute in turn ■ The “/” after title is a short form

Matching attributes ■ The selects nodes based upon attribute names. ■ Assume an attribute “lang” associated with every book in a bookstore file

Sorting Output Elements Assume an AUTHOR element with two children: Arch Frank To Sort and display by LAST: any other code for group Or ascending

Images XML File XML.jpg

Images XSL File

Batch File to Run Processor java net.sf.saxon.Transform bookstore.xml bookstore.xsl > bookstore.html pause

Lab Assignment Copy the bookstore.xml from my Web space into an Eclipse General Project called BookStore bookstore.xml Create the.xsl file to present bookstore.xml –Only list the books that are in English – Create a 2 column table to display the book title and the price Link this lab into your portfolio. Recommended is a lab section. –.xml –.xsl –.html –.bat

Harry Potter Learning XML French History 89.99