XML: Extensible Markup Language

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 DOCUMENTS AND DATABASES
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 346 Day 24.
XML: Extensible Markup Language. Slide Chapter Outline Introduction Structured, Semi structured, and Unstructured Data. XML Hierarchical (Tree)
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.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
1 COS 425: Database and Information Management Systems XML and information exchange.
4/17/2017.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
4/20/2017.
XML – Data Model, DTD and Schema
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 XML Taken from Chapter 7.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
XML – Extensible Markup Language XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.
Lecture 21 XML querying. 2 XSL (eXtensible Stylesheet Language) In HTML, default styling is built into browsers as tag set for HTML is predefined and.
Maziar Sanaii Ashtiani – SCT – EMU, Fall 2011/12.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
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
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.
Chapter 26 XML and Internet Databases Copyright © 2004 Pearson Education, Inc.
Extensible Markup and Beyond
XHTML,XML M.Abdullah Mrian. What is the XHTML Why XHTML ?
 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,
EXtensible Markup Language (XML) and Documentation --ManojBokil -- Manoj Bokil.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
Lecture 11 XSL Transformations (part 1: Introduction)
Copyright © 2004 Pearson Education, Inc.. Chapter 26 XML and Internet Databases.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 27 XML: Extensible Markup Language.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
Copyright © 2004 Ramez Elmasri and Shamkant Navathe Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 26-2 Introduction Although.
An Introduction to XML Sandeep Bhattaram
XML Introduction. Markup Language A markup language must specify What markup is allowed What markup is required How markup is to be distinguished from.
XML and databases Chap. 12. Databases Today Data today: Structured - Info in databases – Data organized into chunks, similar entities groups together.
The Semistructured-Data Model Programming Languages for XML Spring 2011 Instructor: Hassan Khosravi.
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.
Unit 3 — Advanced Internet Technologies Lesson 11 — Introduction to XSL.
Computing & Information Sciences Kansas State University Friday, 20 Oct 2006CIS 560: Database System Concepts Lecture 24 of 42 Friday, 20 October 2006.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
Martin Kruliš by Martin Kruliš (v1.1)1.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
SEMI-STRUCTURED DATA (XML) 1. SEMI-STRUCTURED DATA ER, Relational, ODL data models are all based on schema Structure of data is rigid and known is advance.
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 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.
XML 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SAMPLE XML SCHEMA (XSD) 2 Schema is a record definition, analogous to the.
1 XSLT XSLT (extensible stylesheet language – transforms ) is another language to process XML documents. Originally intended as a presentation language:
XML Databases Presented By: Pardeep MT15042 Anurag Goel MT15006.
XML: Extensible Markup Language Abeiku Duncan Leslie Salami Anthony Mensah-Kumah Michelle Amarteifio Joseph Owusu-Badu.
Extensible Markup Language (XML) Pat Morin COMP 2405.
CSE202 Database Management Systems
Unit 4 Representing Web Data: XML
XML: Extensible Markup Language
XML in Web Technologies
Database Processing with XML
Chapter 7 Representing Web Data: XML
Semi-Structured data (XML Data MODEL)
2/18/2019.
CSE591: Data Mining by H. Liu
Semi-Structured data (XML)
Unit 6 - XML Transformations
Presentation transcript:

XML: Extensible Markup Language CHAPTER 13 XML: Extensible Markup Language

Introduction Databases function as data sources for Web applications HTML Used in static Web pages XML, JSON Self-describing documents Dynamic Web pages Chapter focus: XML data model and languages

13.1 Structured, Semistructured, and Unstructured Data Stored in relational database Semistructured data Not all data has identical structure Schema information mixed in Self-describing Directed graph model Unstructured data Limited data type indication Example: Web pages in HTML

Directed Graph Model for Semistructured Data Figure 13.1 Representing semistructured data as a graph

Structured, Semistructured, and Unstructured Data (cont’d.) HTML uses predefined tags Document header Script functions, formatting styles Body Table tags Attributes Large number of predefined tags XHTML Extends tags for different applications

13.2 XML Hierarchical (Tree) Data Model Basic object: XML document Element Simple Complex Schema document defines element names Attribute Document types Data-centric Document-centric Hybrid

13.3 XML Documents, DTD, and XML Schema Conditions for well-formed XML documents Begins with XML declaration Syntactically correct Valid Must follow a particular schema

XML Documents, DTD, and XML Schema (cont’d.) Notation for specifying elements elementname* indicates optional multivalued (repeating) element elementname+ indicates required multivalued (repeating) element elementname? indicates optional single-valued (non-repeating) element elementname indicates required single-valued (non-repeating) element

XML Documents, DTD, and XML Schema (cont’d.) Notation for specifying elements (cont’d.) Type specified by parentheses following the element name !ATTLIST used to specify attributes within the element Parentheses can be nested when specifying elements Bar symbol (e1|e2) indicates either e1 or e2 can appear in the document

XML Documents, DTD, and XML Schema (cont’d.) Figure 13.4(a) An XML DTD file called ‘Projects’

XML Schema XML schema language Specifies document structure Same syntax rules as XML documents Elements, attributes, keys, references, and identifiers Example: Figure 13.5 in the text

XML Schema (cont’d.) XML namespace Defines set of commands that can be used Annotations, documentation, and language used Elements and types Root element First-level elements Specifying element type and min and max occurrences

XML Schema (cont’d.) Keys Complex elements Constraints that correspond to relational database Primary key Foreign key Complex elements xsd:complexType Composite (compound) attributes

13.4 Storing and Extracting XML Documents from Databases Use file system or DBMS to store documents as text Use DBMS to store document contents as data elements Design specialized system to store XML data Create or publish custom XML documents from preexisting relational databases This approach explored further in 13.6

13.5 XML Languages Query language standards XPath XQuery Specifying XPath expressions in XML Returns sequence of items satisfying certain pattern Values, elements, or attributes Qualifier conditions Separators Single slash / or double slash //

XPath (cont’d.) Example For COMPANY.XML document stored at location www.company.com/info.XML doc(www.company.com/infor.XML)/company returns company root node and all descendant nodes

XPath (cont’d.) Figure 13.6 Some examples of XPath expressions on XML documents that follow the XML schema file company in Figure13.5.

XQuery: Specifying Queries in XML FLWOR expression Variables preceded with $ For assigns variable to a range Where specifies additional conditions Order by specifies order of result elements Return specifies elements for retrieval

XQuery: Specifying Queries in XML Example

Other Languages and Protocols Related to XML Extensible Stylesheet Language (XSL) Extensible Stylesheet Language for Transformations (XSLT) Web Services Description Language (WSDL) Simple Object Access Protocol (SOAP) Resource Description Framework (RDF)

13.6 Extracting XML Documents from Relational Databases XML uses hierarchical (tree) model Common database model is flat relational database Conceptually represent using ER schema University example (follows) Choices for root: course, student, section

University Example Figure 13.8 An ER schema diagram for a simplified UNIVERSITY database

University Example (cont’d.) Figure 13.9 Subset of the UNIVERSITY database schema needed for XML document extraction

University Example (cont’d.) Figure 13.10 Hierarchical (tree) view with ‘COURSE’ as the root

University Example (cont’d.) Figure 13.11 XML schema with ‘COURSE’ as the root

University Example (cont’d.) Figure 13.12 Hierarchical (tree) view with ‘STUDENT’ as the root

University Example (cont’d.) Figure 13.13 XML schema document with ‘STUDENT’ as the root

Breaking Cycles to Convert Graphs into Trees

Other Steps for Extracting XML Documents from Databases Create SQL query to extract desired information Execute the query Restructure from flat to tree structure Customize query to select single or multiple objects into the document

13.7 XML/SQL: SQL Functions for Creating XML Data XMLELEMENT Specifies tag (element) name that will appear in XML result XMLFOREST Specifies multiple element names XMLAGG Aggregate several elements XMLROOT Selected elements formatted as XML document with single root element

XML/SQL: SQL Functions for Creating XML Data (cont’d.) XMLATTRIBUTES Creates attributes for the elements of the XML result Example: create XML element containing the EMPLOYEE lastname for the employee with SSN 123456789 Result:

Employee Example (Query 2) To retrieve multiple columns for a single row: Result:

Employee Example (Query 3) To create XML document with last name, first name, and salary of employees from Dept. 4:

Employee Example (Query 3 cont’d.) Result:

13.8 Summary Structured, semistructured, and unstructured data Hierarchical data model of XML standard Languages for specifying structure XML DTD and XML schema Approaches for storing XML documents XPath and XQuery languages Mapping issues SQL/XML allows formatting query results as XML data