<Discussion>.

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-based Network Management Rob Enns
DOCUMENT TYPES. Digital Documents Converting documents to an electronic format will preserve those documents, but how would such a process be organized?
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
XML: Extensible Markup Language
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.
Rendering XML documents with XSL The most powerful approaches to rendering XML documents involve using XSL (eXtensible Stylesheet Language) XSL enables.
XML Prashant Karmarkar Brendan Nolan Alexander Roda.
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.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
XML – Extensible Markup Language XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.
Ertan Deniz Instructor.  XML Schema  Document Navigation (Xpath)  Document Transformation (XSLT)
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.
Introduction to XML Eugenia Fernandez IUPUI. What is XML? From the World Wide Web Consortium (W3C) The Extensible Markup Language (XML) is the universal.
Another PillowTalk Presentation  2004 Dynamic Systems, Inc. Introduction to XML for SOA Lee H. Burstein,
XML Overview. Chapter 8 © 2011 Pearson Education 2 Extensible Markup Language (XML) A text-based markup language (like HTML) A text-based markup language.
Extensible Markup and Beyond
XML Extensible Markup Language. Markup Languages u What does this number (100) mean? –Actually, it’s just a string of characters! –A markup language can.
Demystifying the eXtensible Markup Language Nick Roberts & Jim Few
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 ?
Implementing Forms and Form Renderers in the Open Source Portfolio David McPherson, Chris Maurer Will Trillich, Janice Smith Materials by Sean Keesler.
 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,
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.
Presentation Topic: XML and ASP Presented by Yanzhi Zhang.
Lecture 11 XSL Transformations (part 1: Introduction)
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
XML Introduction. Markup Language A markup language must specify What markup is allowed What markup is required How markup is to be distinguished from.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
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 –
 XSL – Extensible Style Sheet Language  XSLT – XSL Transformations › Used to transform XML documents to other formats,like HTML or other XML documents.
Martin Kruliš by Martin Kruliš (v1.1)1.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
XML Extensible Markup Language
XSLT, XML Schema, and XPath Matt McClelland. Introduction XML Schema ▫Defines the content and structure of XML data. XSLT ▫Used to transform XML documents.
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:
In this session, you will learn to:
XML: Extensible Markup Language
XML Introduction Bill Jerome.
Unit 4 Representing Web Data: XML
October 19th 2016 Meeting Minutes.
XML: Extensible Markup Language
XML in Web Technologies
eXtensible Stylesheet Language
Extensible Markup Language XML
ACG 4401 XSLT Extensible Stylesheet Language for Transformations
Extensible Markup and Beyond September 26, 2001 Jeff Derstadt
Chapter 7 Representing Web Data: XML
XML Data Introduction, Well-formed XML.
Extensible Markup Language
Applying eXtensible Style Sheets (XSL)
XML WITH CSS.
More Sample XML By Sadia Anjum.
IEEM 5352 E-Enterprise Integration
Chapter 13 XML Yingcai Xiao.
XSL XSLT and XPath 24-Feb-19.
Attributes, Empty-Element Tags, and XSL
XSL XSLT and XPath.
More XML XML schema, XPATH, XSLT
XML – An Introduction XML is getting a lot of attention right now, because of it leverages existing internet infrastructure and also because it enables.
Unit 6 - XML Transformations
Presentation transcript:

<Discussion>

XML – Extensible Markup Language

XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.

Major Roles for XML

Store Data XML Document XML Schema

Exchange Data XML Document XML Schema

Client Access to XML Data Present Info XSL Stylesheet 1 XML Document XML Document XSL Stylesheet 2 Client Access to XML Data

Simplify Data Capture (eventually) Database Data encapsulation into data node Insert data node

XML Includes … Marked up text XSD XForms Model XSL Parser XSLT XSL-FO XHTML HTML XPath Rendering Agent XForms Processor

XML Documents -

An XML Document … A text document. Stores data. Data items are delimited using tags. Hierarchical structure. -

Tags: Data: <?xml version="1.0"?> <Customers> <Id>5003</Id> <CName>Jane</CName> <Transaction> <TDate>2003-01-01</TDate> <Amt>-27.85</Amt> </Transaction> <TDate>2003-01-07</TDate> <Amt>49.50</Amt> </Customer> </Customers> Tags: Delimit data. Show meaning. You make tags! Data: Rich data types. Constraints.

Well Formed XML All data items are between tags. Closing tags start with /. Tags are case sensitive. No spaces or symbols in tags. (Data may contain spaces and some symbols.) Tags balance.

Tags and Data <?xml version="1.0"?> <Customers> <Id>5003</Id> <CName>Jane</CName> <Transaction> <TDate>2003-01-01</TDate> <Amt>-27.85</Amt> </Transaction> </Customer> </Customers>

Well Formed? <Cost>123.45<Cost> <Cost><Quantity>123.45</Cost>15</Quantity> <Cost>123.45</Cost><Quantity>15</Quantity> <Cost>Homer Simpson</Cost>

XML Document Structure <?xml version="1.0"?> <Customers> <Customer> <Id>5003</Id> <CName>Jane</CName> <Transaction> <TDate>2003-01-01</TDate> <Amt>-27.85</Amt> </Transaction> <TDate>2003-01-07</TDate> <Amt>49.50</Amt> </Customer> <Id>5004</Id> <CName>Tom</CName> <TDate>2003-03-03</TDate> <Amt>58.85</Amt> </Customers> Customers Customer Id CName 5003 Jane Customer Id CName 5004 Tom Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Transaction TDate Amt 1/3/03 58.85

Hierarchy of Nodes Root Node / Document Element or Document Node Customers Document Element or Document Node Customer Id CName 5004 Tom 5003 Jane Node or Complex Element (Simple) Element Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Transaction TDate Amt 1/3/03 58.85

Key to Understanding? Meaningful, descriptive tag names! 103.95 <z>103.95</z> <Price>103.95</Price> <ListPrice>103.95</ListPrice> <SalesPrice>103.95</SalesPrice> Meaningful, descriptive tag names!

XML Schemas

An XML Schema … Defines the structure of an XML document. Nodes. Hierarchy. Defines the elements in each node. Tag. Data type. Constraints. XML Document XML Schema

Valid XML Document Well formed. XML Document XML document conforms to structure defined in XML schema. XML Schema

XML Schema - Exchange Data Document XML Schema Based on Standards

Identify Data Requirements Defining an XML Schema Agree on Definitions Identify Data Requirements Specify Structure Specify Tags

Some Major XML Standards eXtensible Business Reporting Language (XBRL) Financial Reporting EDI XML/EDI and electronic business using XML (ebXML) EFT Direct Deposit Open Financial Exchange (OFX) Tax Reporting IRS e-file Standards

<?xml version="1.0"?> <Customers> <Customer> <Id>5003</Id> <CName>Jane</CName> <Transaction> <TDate>2003-01-01</TDate> <Amt>-27.85</Amt> </Transaction> <TDate>2003-01-07</TDate> <Amt>49.50</Amt> </Customer> <Id>5004</Id> <CName>Tom</CName> <TDate>2003-03-03</TDate> <Amt>58.85</Amt> </Customers> Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Customer Id CName 5004 Tom 5003 Jane 1/3/03 58.85 Customers

<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema"> <?xml version = "1.0"?> <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema"> <xsd:element name = "Customers"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "Customer" maxOccurs = "unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Customer Id CName 5004 Tom 5003 Jane 1/3/03 58.85 Customers

<xsd:element name = "Customer"> <xsd:complexType> … <xsd:element name = "Customer"> <xsd:complexType> <xsd:sequence> <xsd:element name = "Id" type = "xsd:string"/> <xsd:element name = "CName" type = "xsd:string"/> <xsd:element ref = "Transaction" maxOccurs = "unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Customer Id CName 5004 Tom 5003 Jane 1/3/03 58.85 Customers

<xsd:element name = "Transaction"> <xsd:complexType> … <xsd:element name = "Transaction"> <xsd:complexType> <xsd:sequence> <xsd:element name = "TDate" type = "xsd:date"/> <xsd:element name = "Amt" type = "xsd:decimal"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Customer Id CName 5004 Tom 5003 Jane 1/3/03 58.85 Customers

<?xml version = "1.0"?> <xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema"> <xsd:element name = "Customers"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "Customer" maxOccurs = "unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name = "Customer"> <xsd:element name = "Id" type = "xsd:string"/> <xsd:element name = "CName" type = "xsd:string"/> <xsd:element ref = "Transaction" maxOccurs = "unbounded"/> <xsd:element name = "Transaction"> <xsd:element name = "TDate" type = "xsd:date"/> <xsd:element name = "Amt" type = "xsd:decimal"/> </xsd:schema>

Validating XML Documents Use software or web tools. Topologi Schematron Validator. www.topologi.com GotDotNet Schema Validator. http://apps.gotdotnet.com/xmltools/xsdvalidator/

XSL Stylesheet, etc.

An XSL Stylesheet … Gets and filters nodes in an XML document. Transforms nodes. Formats output.

Many XSL Stylesheets XSL Stylesheet #1 XML Document XSL Stylesheet #2

XSL Stylesheet “Languages” XML Path XSL Transformations XPath: gets nodes using paths and filtering patterns. XSLT: transforms a document tree into a new document tree. XSL-Formatting Objects XSL-FO: describes how output looks. (HTML on steroids!)

Parsed and Rendered Output XML Document XSL Stylesheet + =

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/Customers"> <html> <body> <h1>Customer Information</h1> <xsl:apply-templates select="Customer" /> </body> </html> </xsl:template> <xsl:template match="Customer"> <b>Id: </b> <xsl:value-of select="Id" /><br /> <b>Name: </b> <xsl:value-of select="CName" /><br /> <xsl:apply-templates select="Transaction" /> <br /><hr /><br /> <xsl:template match="Transaction"> <b>Date: </b> <xsl:value-of select="TDate" /> <b>Amount: </b> <xsl:value-of select="Amt" /><br /> </xsl:stylesheet> Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Customer Id CName 5004 Tom 5003 Jane 1/3/03 58.85 Customers

Alphabet Soup of Xtechs XForms XML Document XSL Stylesheet XML Schema Languages & Formats XForms Model Marked up text XPath XSL-FO XHTML XSD XSLT HTML Software XForms Processor Editor & Validator XSL Parser Rendering Agent

</Discussion>

Nodes and Elements Customers Customer Id CName Transaction Transaction 5004 Tom 5003 Jane Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Transaction TDate Amt 1/3/03 58.85

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/Customers"> <html> <body> <h1>Customer Information</h1> <xsl:apply-templates select="Customer" /> </body> </html> </xsl:template> <xsl:template match="Customer"> <b>Id: </b> <xsl:value-of select="Id" /><br /> <b>Name: </b> <xsl:value-of select="CName" /><br /> <xsl:apply-templates select="Transaction" /> <br /><hr /><br /> <xsl:template match="Transaction"> <b>Date: </b> <xsl:value-of select="TDate" /> <b> Amount: </b> <xsl:value-of select="Amt" /><br /> </xsl:stylesheet>

<html> <body> <h1>Customer Information</h1> <b>Id: </b>5003<br> <b>Name: </b>Jane<br> <b>Date: </b>2003-01-01<b> Amount: </b>-27.85<br> <b>Date: </b>2003-01-07<b> Amount: </b>49.50<br> <br><hr><br> <b>Id: </b>5004<br> <b>Name: </b>Tom<br> <b>Date: </b>2003-03-03<b> Amount: </b>58.85<br> </body> </html>

<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="Customers.xsl"?> <Customers xmlns:mySchema="Customers.xsd"> <Customer> <Id>5003</Id> <CName>Jane</CName> <Transaction> <TDate>2003-01-01</TDate> <Amt>-27.85</Amt> </Transaction> <TDate>2003-01-07</TDate> <Amt>49.50</Amt> </Customer> <Id>5004</Id> <CName>Tom</CName> <TDate>2003-03-03</TDate> <Amt>58.85</Amt> </Customers>

Context and Selection Path / Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Customer Id CName 5004 Tom 5003 Jane 1/3/03 58.85 Customers /Customers /Customers/Customer /Customers/Customer/Transaction

Processing Order & Data Exposed / Transaction TDate Amt 1/1/03 -27.95 1/7/03 49.50 Customer Id CName 5004 Tom 5003 Jane 1/3/03 58.85 Customers Customers Customer #1 Customer #2 Transaction #1 Transaction #2 Transaction

Transform and Render XSLT Parser Transformation XPath XSLT Well-formed Tree XSLT Parser XPath Transformation XSLT XSL Stylesheet Well-formed Tree XSL-FO (HTML/CSS) Rendering Agent Rendering

Alphabet Soup of Xtechs XForms XML Document XSL Stylesheet XML Schema Languages & Formats XForms Model Marked up text XPath XSL-FO XHTML XSD XSLT HTML Software XForms Processor Editor & Validator XSL Parser Rendering Agent