Chapter 13 XML Yingcai Xiao. What is XML? What is it for? Examples How to write? How to validate? How to read? How to display? How to format? How to translate?

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: Extensible Markup Language
XML and Enterprise Computing. What is XML? Stands for “Extensible Markup Language” –similar to SGML and HTML –document “tags” are used to define content.
XML & Data Structures for the Internet Yingcai Xiao.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
XSL XSLT and XPath 11-Apr-17.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
XSLT & XPATH. From Friday Everything in XML is machine readable Attributes describe elements, so does an element’s place in the tree (context) XML must.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
©Silberschatz, Korth and Sudarshan10.1Database System Concepts W3C Activities HTML: is the lingua franca for publishing on the Web XHTML: an XML application.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
Chapter 10 © 2001 by Addison Wesley Longman, Inc. 1 Chapter 10 Sebesta: Programming the World Wide Web.
XML(EXtensible Markup Language). XML XML stands for EXtensible Markup Language. XML is a markup language much like HTML. XML was designed to describe.
COS 381 Day 16. Agenda Assignment 4 posted Due April 1 There was no resubmits of Assignment Capstone Progress report Due March 24 Today we will discuss.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
MC 365 – Software Engineering Presented by: John Ristuccia Shawn Posts Ndi Sampson XSLT Introduction BCi.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
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.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
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.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
XML – Extensible Markup Language XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
XML: Overview MIS 181.9: Service Oriented Architecture 2 nd Semester,
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
XML eXtensible Markup Language w3c standard Why? Store and transport data Easy data exchange Create more languages WSDL (Web Service Description Language)
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.
XML Overview. Chapter 8 © 2011 Pearson Education 2 Extensible Markup Language (XML) A text-based markup language (like HTML) A text-based markup language.
XML What is XML? XML v.s. HTML XML Components Well-formed and Valid Document Type Definition (DTD) Extensible Style Language (XSL) SAX and DOM.
XHTML,XML M.Abdullah Mrian. What is the XHTML Why XHTML ?
These Questions are copied from
Advanced Java Session 9 New York University School of Continuing and Professional Studies.
 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.
Session IV Chapter 9 – XML Schemas
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter X IXXXXXXXXXX XXXXXX.
Presentation Topic: XML and ASP Presented by Yanzhi Zhang.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
Windows Presentation Foundation (WPF) Chapter 16 Dr. Abraham.
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
1 11/29/05CS360 Windows Programming XML. 2 11/29/05CS360 Windows Programming What is XML?  XML: Extensible Markup Language  HTML expresses appearance.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
Jennifer Widom XML Data Introduction, Well-formed XML.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
XML A Language Presentation. Outline 1. Introduction 2. XML 2.1 Background 2.2 Structure 2.3 Advantages 3. Related Technologies 3.1 DTD 3.2 Schemas and.
Dom and XSLT Dom – document object model DOM – collection of nodes in a tree.
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.
©Silberschatz, Korth and Sudarshan10.1Database System Concepts W3C - The World Wide Web Consortium W3C - The World Wide Web Consortium.
Working with XML. Markup Languages Text-based languages based on SGML Text-based languages based on SGML SGML = Standard Generalized Markup Language SGML.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
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
XML Introduction to XML Extensible Markup Language.
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.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
Unit 4 Representing Web Data: XML
Database Processing with XML
Chapter 7 Representing Web Data: XML
XML Data Introduction, Well-formed XML.
More Sample XML By Sadia Anjum.
Chapter 13 XML Yingcai Xiao.
Unit 6 - XML Transformations
Presentation transcript:

Chapter 13 XML Yingcai Xiao

What is XML? What is it for? Examples How to write? How to validate? How to read? How to display? How to format? How to translate?

 Extensible Markup Language.  De facto data language.  HTML expresses appearance; XML describes data and its structure.  Text based (platform-independent).  Object-oriented data representation.  Has no predefined tags.  Provides rules to format data.  Many XML parsers already available.  Strong XML support in the FCL.. XML

XML Example (Guitars.xml) Gibson SG 1977 Tobacco Sunburst Rosewood Fender Stratocaster Black Maple

XML Example (Guitars.xml)  Document element (root): Guitars.  Guitar elements are children of Guitars.  Make contain data.  Empty element:  Nested elements.  The content of an XML document can be viewed as a tree.  Attributes

XML Description  XML Elements: text-based object-oriented data (object)  Error checking?  Text-based object-oriented type (class) definition?  Early days: document type definitions (DTDs).  Today: XML Schema Definitions (XSDs).  Schema: a collection of meta data.  Meta data: data that describes data.  XSD is an XML-based language for describing XML documents and the types that they contain.

Example: Guitars.xsd

Examples\c13\Validate\ Typo => xsd:Year should be xsd:string run.bat Validate Guitars.xml Guitars.xsd run-bad-xml.bat Validate Guitars-Missing-Make.xml Guitars.xsd Example: Guitars.xsd

XML Parsers  Most XML parsers implement one of two popular APIs: DOM or SAX.  DOM: Document Object Model Level-2-Core.  SAX: Simple API for XML, unofficial,  FCL XmlDocument, managed DOM implementation  Examples of using XmlDocument: Validate ReadXml XmlView Transform Quotes ExpressAnalyzer

ReadXml.cs (also see XmlView) using System; using System.Xml; class MyApp { static void Main () { XmlDocument doc = new XmlDocument (); doc.Load ("Guitars.xml"); XmlNodeList nodes = doc.GetElementsByTagName ("Guitar"); foreach (XmlNode node in nodes) { Console.WriteLine(“Maker {0}; Model {1}", node["Make"].InnerText, node["Model"].InnerText); }

 XML Path Language  For addressing parts of an XML document.  “/Guitars/Guitar” is an XPath expression.  XPath

XSL is a language for expressing style sheets. Adopted from CSS, a file that describes how to display an XML document of a given type.CSS Styling requires a source XML documents, containing the information that the style sheet will display and the style sheet itself which describes how to display a document of a given type. It supports: Formatting Objects. It also adds a transformation language for XML documents: XSLT. Examples\c13\Quotes\Quotes.xsl XSL

 Extensible Stylesheet Language Transformations.  Converting XML documents into HTML documents.  Converting HTML documents into other XML documents. Examples\c13\Transform\Transform.cs XSL Transformations (XSLT)