XML and Data Management



Similar documents
Last Week. XML (extensible Markup Language) HTML Deficiencies. XML Advantages. Syntax of XML DHTML. Applets. Modifying DOM Event bubbling

Semistructured data and XML. Institutt for Informatikk INF Ahmet Soylu

DTD Tutorial. About the tutorial. Tutorial

Quiz! Database Indexes. Index. Quiz! Disc and main memory. Quiz! How costly is this operation (naive solution)?

Database & Information Systems Group Prof. Marc H. Scholl. XML & Databases. Tutorial. 11. SQL Compilation, XPath Symmetries

04 XML Schemas. Software Technology 2. MSc in Communication Sciences Program in Technologies for Human Communication Davide Eynard

Introduction to XML. Data Integration. Structure in Data Representation. Yanlei Diao UMass Amherst Nov 15, 2007

Java and XML parsing. EH2745 Lecture #8 Spring

XML WEB TECHNOLOGIES

XML for RPG Programmers: An Introduction

Introduction to XML Applications

XML Schema Definition Language (XSDL)

Data Integration through XML/XSLT. Presenter: Xin Gu

Structured vs. unstructured data. Semistructured data, XML, DTDs. Motivation for self-describing data

Structured vs. unstructured data. Motivation for self describing data. Enter semistructured data. Databases are highly structured

6. SQL/XML. 6.1 Introduction. 6.1 Introduction. 6.1 Introduction. 6.1 Introduction. XML Databases 6. SQL/XML. Creating XML documents from a database

XML Databases 6. SQL/XML

XML: extensible Markup Language. Anabel Fraga

Web Services Technologies

by LindaMay Patterson PartnerWorld for Developers, AS/400 January 2000

Unified XML/relational storage March The IBM approach to unified XML/relational databases

XML- New meta language in e-business

Visualization of GML data using XSLT.

A Workbench for Prototyping XML Data Exchange (extended abstract)

XML and Data Integration

Modern Databases. Database Systems Lecture 18 Natasha Alechina

XSLT Mapping in SAP PI 7.1

Chapter 3: XML Namespaces

T XML in 2 lessons! %! " #$& $ "#& ) ' */,: -.,0+(. ". "'- (. 1

An XML Based Data Exchange Model for Power System Studies

How To Use Xml In A Web Browser (For A Web User)

XML. Document Type Definitions XML Schema

Creating a TEI-Based Website with the exist XML Database

Application of XML Tools for Enterprise-Wide RBAC Implementation Tasks

XML Databases 10 O. 10. XML Storage 1 Overview

Markup Languages and Semistructured Data - SS 02

High Performance XML Data Retrieval

10CS73:Web Programming

Extensible Markup Language (XML): Essentials for Climatologists

Exchanger XML Editor - Canonicalization and XML Digital Signatures

Chapter 2: Designing XML DTDs

CSET 3100 Advanced Website Design (3 semester credit hours) IT Required

<Namespaces> Core XML Technologies. Why Namespaces? Namespaces - based on unique prefixes. Namespaces. </Person>

Agents and Web Services

10. XML Storage Motivation Motivation Motivation Motivation. XML Databases 10. XML Storage 1 Overview

TagSoup: A SAX parser in Java for nasty, ugly HTML. John Cowan (cowan@ccil.org)

XSL - Introduction and guided tour

Languages for Data Integration of Semi- Structured Data II XML Schema, Dom/SAX. Recuperación de Información 2007 Lecture 3.

LabVIEW Internet Toolkit User Guide

Standard Recommended Practice extensible Markup Language (XML) for the Interchange of Document Images and Related Metadata

Storing and Querying Ordered XML Using a Relational Database System

Translating between XML and Relational Databases using XML Schema and Automed

CST6445: Web Services Development with Java and XML Lesson 1 Introduction To Web Services Skilltop Technology Limited. All rights reserved.

Concrete uses of XML in software development and data analysis.

An Approach to Eliminate Semantic Heterogenity Using Ontologies in Enterprise Data Integeration

XML. CIS-3152, Spring 2013 Peter C. Chapin

T Network Application Frameworks and XML Web Services and WSDL Tancred Lindholm

SOFTWARE ENGINEERING PROGRAM

Exercises: XSD, XPath Basi di da4 2

ERIE COMMUNITY COLLEGE COURSE OUTLINE A. COURSE NUMBER CS WEB DEVELOPMENT & PROGRAMMING I AND TITLE:

WWW. World Wide Web Aka The Internet. dr. C. P. J. Koymans. Informatics Institute Universiteit van Amsterdam. November 30, 2007

Course Name: Course in JSP Course Code: P5

Introduction to Ingeniux Forms Builder. 90 minute Course CMSFB-V6 P

Interactive Data Visualization for the Web Scott Murray

Caching XML Data on Mobile Web Clients

CMServer An Object-Oriented Framework for Website Development and Content Management

Coping with Semantics in XML Document Management

Overview of DatadiagramML

RUT developers handbook 9.51 Introduction to XML and DOM, with applications in Matlab v. 2.0

Developing XML Solutions with JavaServer Pages Technology

Extracting data from XML. Wednesday DTL

Managing large sound databases using Mpeg7

ISM/ISC Middleware Module

Managing XML Documents Versions and Upgrades with XSLT

IT6503 WEB PROGRAMMING. Unit-I

Generating XML from Relational Tables using ORACLE. by Selim Mimaroglu Supervisor: Betty O NeilO

Modernize your NonStop COBOL Applications with XML Thunder September 29, 2009 Mike Bonham, TIC Software John Russell, Canam Software

WEB DEVELOPMENT IA & IB (893 & 894)

Lesson 4 Web Service Interface Definition (Part I)

Transcription:

XML and Data Management XML standards XML DTD, XML Schema DOM, SAX, XPath XSL XQuery,... Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 1

Overview of internet technologies for document management and archiving server technologies database coupling XML+XSL pure HTML document languages client technologies Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 2

Data centric XML - XML data storage <doc> opening tag <Auftrag> <Kunde> Arm </Kunde> <PC> pc400 </PC> </Auftrag> <Auftrag> <Kunde> Meier </Kunde> <PC> pc500 </PC> </Auftrag> <Auftrag> <Kunde> Reich </Kunde> <PC> pc500 </PC> </Auftrag> </doc> doc % Kunde PC auftrag( Arm pc400 ). auftrag( Meier pc500 ). auftrag( Reich pc600 ). closing tag Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 3

extended Markup Language (XML) XML - a family of standards: XML (extensible Markup Language) data format exchangable accross different operating systems, applications, and enterprises often used for content XPath path expressions used for navigation in XML trees used within other XML standards (e.g. XSL) XSL (extensible Stylesheet Language) used to describe layout of content / to convert data many more standards: XQuery ( queries ), DTD ( type definition ), XML-Schema ( integrity constraints ) Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 4

Unique Standard for Content DTD or XML Schema: defines structure of all XML trees exchanged => unique data format for all participants data formats exchangable accross company borders New data exchange formats and languages based on XML example: ebxml (E-Business XML) as a basis for OTA (Open Travel Association) data exchange between travel agency, airline etc. Consequence of these standards: ( econnomic ) force to use the standard Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 5

Separation of content and layout content (product2.xml) layout ( technican2.xsl) content (product1.xml) layout (customer1.xsl) HTML file combines requested data with requested layout Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 6

Separation of content and layout (2) Consequences: 1 (content) data source for different layouts (technican, seller, customer, re-seller,...) layout may change without changing content ( different logo, different seller or customer, different employee or job, new view of data ) reuse 1 layout for different content ( frame with company logo,...) content may change without changing layout ( new prices, ) Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 7

XML on Java servers XML + XSL separate layout and content layout (.xsl file) content data (.xml file) combine them in the web server XML file XSL file HTMLpage input Browser client calls generated HTML page Servlet server transform XML+XSL HTML Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 8

XML document as a data storage <doc> opening Tag <Auftrag> <Kunde> Arm </Kunde> <PC> pc400 </PC> </Auftrag> <Auftrag> <Kunde> Meier </Kunde> <PC> pc500 </PC> </Auftrag> <Auftrag> <Kunde> Reich </Kunde> <PC> pc500 </PC> </Auftrag> </doc> % Kunde PC auftrag( Arm pc400 ). auftrag( auftrag( doc Meier Reich closing Tag pc500 pc600 ). ). Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 9

XML syntax XML - Prolog: version character set without DTD! <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="xmlbsp1.xsl"?> XML - main part: used stylesheet (only inside ie5) element start tag /end tag <Auftrag> <Kunde> meier </Kunde> <PC> pc500 </PC> </Auftrag> text node Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 10

In the XML main part: XML syntax (2) (arbitrarily) no text node <Angebote> <Liefert wer= vobis teil= pc500 > </Liefert> attribute attribute value end of tag (no text) <Liefert wer= IBM teil= pc600 / > </Angebote> element Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 11

XML-Syntax (3) all tags must be closed (<tag>... </tag> or <singletag />) incorrectly nested tags not allowed ( <tag1> <tag2>... </tag1> </tag2> ) case-sensitive ( <tag> different from <Tag> ) attribute values must be quoted ( z.b. <p align="center"> ) text must be enclosed in elements Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 12

XML document as a tree <doc> <Kunde name= meier > <Auftrag>... </Auftrag> <Adresse> </Adresse> </kunde> <Kunde> <Auftrag/> <Adresse/> </Kunde> </doc> name = meier Kunde doc Kunde Auftrag Adresse Auftrag Adresse Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 13

7 kinds of nodes: XML node types root - has no parent node element text attribute comment name-space processing-instruction - leaf node (has no child node) - leaf node (has no child node) - leaf node (has no child node) - leaf node (has no child node) - leaf node (has no child node) Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 14

DTD and XML Schema DTD ( the older standard ) : + defines the structure (nesting of tags) of the documents <kunde> <auftrag> <teil> + defines structural dependencies, e.g. every auftrag contains at least one teil element XML-Schema ( the newer standard ) additionally : + binds XML elements to types defined in the XML Schema + defines Domains + defines integrity constraints Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 15

Document-Type-Definition (DTD) <!-- DTD xmlbsp2d.dtd for example xmlbsp2d.mxl --> <!ELEMENT Auftraege (Auftrag)* > <!ELEMENT Auftrag ( Kunde, PC ) > <!ELEMENT Kunde (#PCDATA) > <!ELEMENT PC (#PCDATA) > arbitrary many root element parsed char data sequence required <?xml version="1.0" encoding="iso-8859-1" standalone="no"?> <!DOCTYPE Auftraege SYSTEM "xmlbsp2d.dtd"> <?xml-stylesheet type="text/xsl" href="xmlbsp2.xsl"?> <Auftraege> <Auftrag> <Kunde>Meier</Kunde> <PC>pc500</PC> </Auftrag> <Auftrag>... </Auftrag> </Auftraege> Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 16

Element declarations in DTDs <!ELEMENT PC (#PCDATA) > <!ELEMENT Liefert (EMPTY) > <!ELEMENT Angebot (Liefert) > <!ELEMENT Angebote (Liefert)* > <!ELEMENT Auftrag (Kunde,PC) > <!ELEMENT Zahlung (Bar Karte) > <!ELEMENT E ((A B)*,C,(D)?)+ > text (no elements) empty 1 sub-element? 0 or 1 * arbitrary many + al least 1 sub-element sequence choice paranthesis Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 17

Attribute declarations in DTDs <!-- DTD xmlbsp2d.dtd for the example xmlbsp2d.xml --> <!ELEMENT Angebote (Liefert)* > arbitrary many <!ELEMENT Liefert (EMPTY) > empty <!ATTLIST Liefert wer CDATA #REQUIRED teil CDATA #REQUIRED > root element attribute type (char data) must occur <Angebote> <Liefert wer= vobis teil= pc500 > </Liefert> <Liefert wer= IBM teil= pc600 / > </Angebote> Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 18

Axes in XML document trees XML document doc name = meier Kunde Kunde Axes: child-axis Auftrag Adresse Auftrag Adresse /child::doc/child::kunde/child::auftrag / doc / Kunde / Auftrag attribute-axis /child::doc/child::kunde/attribute::name / doc / Kunde /@ name Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 19

Axes in XML document trees (2) ancestor doc ancestor-or-self parent Kunde self Auftrag Adresse descendant-or-self child PC following following-sibling descendant attribute @nr Handbuch Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 20

Axes in XML document trees (3) <doc> <Kunde> </Kunde> <Kunde> <name> </name> <Auftrag> self::... </Auftrag> <Adresse> </Adresse> </Kunde> <Kunde> </Kunde> </doc> Kunde name ancestor:: doc Kunde Auftrag Adresse Kunde preceding:: descendant:: following:: Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 21

Axes in XML document trees (4) Die following axes select for a given context node: child:: descendant:: parent:: ancestor:: following-sibling:: preceding-sibling:: following:: preceding:: attribute:: namespace:: its child nodes its descendants (=children and their descendants) the parent node (only root does not have a parent). nodes on the path to the root (=parent and its anc's). siblings have identical parent, following in doc order (empty for attribute and namespace nodes). inverse to following sibling (empty for attribute and namespace nodes). all nodes following in doc order after context node (excluding descendant-, attribute- & namespace-nodes). all nodes preceeding in doc order before context node (excluding ancestor-, attribute- & namespace-nodes). its attributes (empty for each non-element node). its namespace-nodes (empty for each non-element node). Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 22

Axes in XML document trees (5) the following axes select for a given context node: self:: the context node itself descendant-or-self:: the context node and its descendants ancestor-or-self:: the context node and its ancestors When ignoring attribute nodes and namespace nodes, the following holds for everey document node: the axes ancestor::, descendant::, following::, preceding:: and self:: partition a document fully, i.e., the selected node sets do not overlap but the union of all partitions contain all nodes of the document. Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 23

XML Schema example (1) <xsd:element name="address" > <xsd:sequence> <xsd:element name="fullname" maxoccurs="1"> <xsd:sequence> <xsd:element name="firstname"/> <xsd:element name="lastname"/> </xsd:sequence> </xsd:element> <xsd:choice> <xsd:element name="street"/> <xsd:element name="pob"/> </xsd:choice> </xsd:sequence> </xsd:element> Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 24

XML Schema example (2) <xsd:element name="shipto" type="coaddress"/> <xsd:complextype name="address"> <xsd:complexcontent> <xsd:sequence> <xsd:element name="fullname"/> <xsd:element name="street"/> </xsd:sequence> </xsd:complexcontent> </xsd:complextype> <xsd:complextype name="coaddress"> <xsd:extension base="address"> <xsd:sequence> <xsd:element name="countrycode"/> </xsd:sequence> </xsd:extension> </xsd:complextype> </xsd:element> Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 25

XML summary XML : DTD : XML-Schema tree structure for content structure definition additionally: type checking and logic consistency checking well documented standards http://www.w3c.org Databases and Information Systems 1 - WS 2005 / 06 - Prof. Dr. Stefan Böttcher XML / 26