We Need Smart XML Processing HTML has ultra-complex semantics XML has no semantics Something must bridge the gap  A program ?  A clear set of data semantics?

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.
Open Office.Org What is the Open Office.org Source Project? Open source project through which Sun Microsystems is releasing the technology for the popular.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
UFCE8V-20-3 Information Systems Development 3 (SHAPE HK) Lecture 12 Extensible Stylesheet Language Transformations : XSLT.
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 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)
Lecture 10. Back to the table example We can now return to considering in detail the first XSLT style-sheet we saw –The one which, when applied to the.
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
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.
ECA 228 Internet/Intranet Design I Intro to XML. ECA 228 Internet/Intranet Design I HTML markup language very loose standards browsers adjust for non-standard.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
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.
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.
Session II Chapter 2 – Chapter 2 – XSLhttp://
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
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 is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
Lecture 14 Extensible Stylesheet Language Transformations : XSLT.
 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.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
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.
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.
Lecture 15 XSL Transformations (part V) Acknowledgment:
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.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
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.
Martin Kruliš by Martin Kruliš (v1.1)1.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
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.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
1 XSLT XSLT (extensible stylesheet language – transforms ) is another language to process XML documents. Originally intended as a presentation language:
Extensible Markup Language (XML) Pat Morin COMP 2405.
Unit 4 Representing Web Data: XML
XML in Web Technologies
eXtensible Stylesheet Language
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Chapter 7 Representing Web Data: XML
More XML XML schema, XPATH, XSLT
Unit 6 - XML Transformations
Presentation transcript:

We Need Smart XML Processing HTML has ultra-complex semantics XML has no semantics Something must bridge the gap  A program ?  A clear set of data semantics?

HTML’s Complex Semantics In an HTML file  data semantics  presentation semantics  user interface semantics  behavioural semantics are all mixed together.

Where has XML’s Complexity Gone? An XML file only has  data semantics The remainder  presentation semantics  user interface semantics  behavioural semantics must be mapped on somehow.

Who has the Complexity? CSS stylesheets provide a simple, linear transformation from data to presentation DOM programming provides an ad-hoc, completely flexible transformation. Either way, the complexity of the application is taken on by a program.

Where Should the Complexity Be? One approach is to have different standards which cleanly model the different semantics.  Presentation - CSS  User Interface - XForm  Behaviour - XLink

Back to Square One with HTML? However, many of these new standards are under-developed Hence we resort to HTML as a unified presentation layer.

XML Processing: XSL XSL provides  an XML vocabulary for specifying formatting semantics  a language for transforming XML data The vocabulary is  Formatting Objects DTD The language is  XSL(T)

XSL: XML Stylesheets An XSL stylesheet describes how to transform  your XML document  into a different XML document  (one that uses the formatting vocabulary)

Stylesheet Processing (theory) mydoc.xml mydoc.dtd style.xsl XSLT processor FOdoc.xml FO.dtd XSL processor Printed document Web page WAP page

Stylesheet Problems Pragmatics  XSLT is a final W3C Recommendation  XSL is still under discussion  Few practical XSL implementations exist  Many FO features are similar to CSS[2]  IE5+ defines HTML as the formatting language to be used with XSLT.

Stylesheet Processing (practice) mydoc.xml mydoc.dtd style.xsl IE 5 / XSLT mydoc.html FO.dtd IE 5 Printed document Web page WAP page

XSL Stylesheet: Templates XSL stylesheet consists of a number of templates Each template  matches an element in the original document  specifies the new content to replace the element by

Simple Stylesheet A simple stylesheet might look like this... *!#$%!* replace with replace by censor all swear words XHTML

XSL Complications …but of course it's more complicated than that A stylesheet is a random mix of  XSL native elements  formatting language elements Namespaces must be used to distinguish the two. Also, no DTD is possible.

XSL Namespaces XSL processor will only treat element names in the correct namespace as significant.  Standard namespace is  Old Microsoft namespace was

Simple Stylesheet (2) So the stylesheet might look more like this... *!#$%!*

Simple Stylesheet (3) or this... *!#$%!*

XSL: Recursive Templates Of course the templates get more complex too “ ” apply-elements causes all children of the current element to be processed

XSL: Starting to Match at the Top The basis of any XSL style-sheet will be a rule that matches the document root Here is my document Contact Les Carr with problems

XSL: Matching with XPath A separate standard is used to specify the template matches  XPath navigates around the elements in an XML document  like a URL navigates around documents in the Web Also used in conjunction with new standards for queries and linking.

XSL: Common Elements  evaluates to the contents of the selected elements (or attributes) …  explicitly iterates over each of the selected elements (or attributes)

Invoking XSL To attach an XSL stylesheet to an XML file, use a processing instruction Alternatively, JavaScript the processing htmlString= xmlID.transformNode(xslID.XMLDocument);

Microsoft XSL Gotcha XSL defines two implied templates Recursively applied to all elements / text Microsoft misses these out! '/' is NOT equal to the top level element

XSL Worked Example Here is an XML Les Carr Hugh Davis Teaching Duties Using Java to teach Programming Principles seems to have worked well. The standard of software engineering seems to have increased.

Example: Outline First, define the basic outline Message Converted by XSLMail, Les Carr

Example: Result The message should appear as follows: From:Les Carr To:Hugh Davis Subject:Teaching Duties blah blah blah blah blah blah blah blah blah blah …. So we can use a table for alignment

Example: Root Template So here is the updated root template Message Converted by XSLMail, Les Carr

Example: From We want to convert the from element into a row in the table From: ( ) The first cell contains the label From: The next cell contains the contents of the name and address subelements

Example: To Similarly the to element becomes a row To: ( ) The first cell contains the label To: The next cell contains the contents of the name and address subelements

Example: Subject And the subject element Subject: The first cell contains the label Subject: The next cell contains the contents of this element

Example: Content And finally the content element There is only 1 cell which contains the contents of this element

Example: Final Touch But don't forget the gotcha The full version with namespaces added is in Worked.xsl and Worked.xml Worked.xsl Worked.xml