XML Technologies XML, DTD

Similar documents
Part II: Semistructured Data

The concept of DTD. DTD(Document Type Definition) Why we need DTD

XML, DTD: Exercises. A7B36XML, AD7B36XML: XML Technologies. Practical Classes 1 and 2: 3. and

Introduction Syntax and Usage XML Databases Java Tutorial XML. November 5, 2008 XML

Tutorial 2: Validating Documents with DTDs

EMERGING TECHNOLOGIES. XML Documents and Schemas for XML documents

XML DTD A brief introduction. Glossary XML DTD <!DOCTYPE [ ]>

Introduction to XML Zdeněk Žabokrtský, Rudolf Rosa

Outline. XML vs. HTML and Well Formed vs. Valid. XML Overview. CSC309 Tutorial --XML 4. Edward Xia

Introduction to XML. Yanlei Diao UMass Amherst April 17, Slides Courtesy of Ramakrishnan & Gehrke, Dan Suciu, Zack Ives and Gerome Miklau.

Author: Irena Holubová Lecturer: Martin Svoboda

Outline. XML DOCTYPE External - SYSTEM. XML DOCTYPE Internal DTD &6&7XWRULDO ;0/ (GZDUG;LD

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11

Chapter 1: Getting Started. You will learn:

XML and DTD. Mario Alviano A.Y. 2017/2018. University of Calabria, Italy 1 / 28

Introduction to XML. Chapter 133

UNIT I. A protocol is a precise set of rules defining how components communicate, the format of addresses, how data is split into packets

XML. Document Type Definitions XML Schema. Database Systems and Concepts, CSCI 3030U, UOIT, Course Instructor: Jarek Szlichta

Semistructured data, XML, DTDs

Introduction to XML. National University of Computer and Emerging Sciences, Lahore. Shafiq Ur Rahman. Center for Research in Urdu Language Processing

XML. Document Type Definitions. Database Systems and Concepts, CSCI 3030U, UOIT, Course Instructor: Jarek Szlichta

SDPL : XML Basics 2. SDPL : XML Basics 1. SDPL : XML Basics 4. SDPL : XML Basics 3. SDPL : XML Basics 5

The Semi-Structured Data Model. csc343, Introduction to Databases Diane Horton originally based on slides by Jeff Ullman Fall 2017

Databases and Internet Applications

XML Structures. Web Programming. Uta Priss ZELL, Ostfalia University. XML Introduction Syntax: well-formed Semantics: validity Issues

XML. extensible Markup Language. Overview. Overview. Overview XML Components Document Type Definition (DTD) Attributes and Tags An XML schema


This chapter describes the encoding scheme supported through the Java API.

Data Presentation and Markup Languages

CPT374 Tutorial-Laboratory Sheet Two

XML. COSC Dr. Ramon Lawrence. An attribute is a name-value pair declared inside an element. Comments. Page 3. COSC Dr.

- XML. - DTDs - XML Schema - XSLT. Web Services. - Well-formedness is a REQUIRED check on XML documents

Introduction to Semistructured Data and XML. Overview. How the Web is Today. Based on slides by Dan Suciu University of Washington

What is XML? XML is designed to transport and store data.

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML

IBM. XML and Related Technologies Dumps Braindumps Real Questions Practice Test dumps free

Overview. Introduction. Introduction XML XML. Lecture 16 Introduction to XML. Boriana Koleva Room: C54

2006 Martin v. Löwis. Data-centric XML. Document Types

Part 2: XML and Data Management Chapter 6: Overview of XML

XML. Semi-structured data (SSD) SSD Graphs. SSD Examples. Schemas for SSD. More flexible data model than the relational model.

Lunch n Learn Unders Under t s a t nding nding D D T s UNCLASSIFIED

Electronic Commerce Architecture Project LAB ONE: Introduction to XML

7.1 Introduction. extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML

Introduction to XML. An Example XML Document. The following is a very simple XML document.

XML databases. Jan Chomicki. University at Buffalo. Jan Chomicki (University at Buffalo) XML databases 1 / 9

Constructing a Document Type Definition (DTD) for XML

XML and Semantic Web Technologies. II. XML / 3. XML Namespaces

Querying XML. COSC 304 Introduction to Database Systems. XML Querying. Example DTD. Example XML Document. Path Descriptions in XPath

Introduction to XML. When talking about XML, here are some terms that would be helpful:

Chapter 16: Introduction to XML and DTD Files

HML Data Dictionary :24:16 CDT

Chapter 13 XML: Extensible Markup Language

Relational Data Model is quite rigid. powerful, but rigid.

(One) Layer Model of the Semantic Web. Semantic Web - XML XML. Extensible Markup Language. Prof. Dr. Steffen Staab Dipl.-Inf. Med.

Structured documents

Appendix H XML Quick Reference

Computer Science E-75 Building Dynamic Websites

CSCI3030U Database Models

Bulk Data Manager XML DTD CHAPTER

RepCom: A Customisable Report Generator Component System using XML-driven, Component-based Development Approach

XML. extensible Markup Language. ... and its usefulness for linguists

FUNCTIONAL MARKUP For instance, with functional markup, text representing section headings. INTRODUCTION This part of chapter includes

Introduction to XML (Extensible Markup Language)

<account_number> A-101 </account_number># <branch_name> Downtown </branch_name># <balance> 500 </balance>#

XML: extensible Markup Language

Query Languages for XML

The Gigascale Silicon Research Center

Using UML To Define XML Document Types

Data Format Specifications for the Collection of PCT National Phase Information

XML stands for Extensible Markup Language and is a text-based markup language derived from Standard Generalized Markup Language (SGML).

Session [2] Information Modeling with XSD and DTD

Computer Science S-75 Building Dynamic Websites

Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013

Additional Readings on XPath/XQuery Main source on XML, but hard to read:

Introduction to Database Systems CSE 414

Delivery Options: Attend face-to-face in the classroom or via remote-live attendance.

StreamServe Persuasion SP5 XMLOUT

EMERGING TECHNOLOGIES

Introduction to XML. M2 MIA, Grenoble Université. François Faure

Introduction to XML. XML: basic elements

XML and Web Services

Well-formed XML Documents

XML. Objectives. Duration. Audience. Pre-Requisites

Methods and Tools for Management Information Systems

Contents. 1 Introduction Basic XML concepts Historical perspectives Query languages Contents... 2

Delivery Options: Attend face-to-face in the classroom or remote-live attendance.

XML, DTD, and XPath. Announcements. From HTML to XML (extensible Markup Language) CPS 116 Introduction to Database Systems. Midterm has been graded

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name

Which of the following Tags names are valid, which are not? Explain your answers. <lecture> <student and teacher> <student&teacher>

XML Problem. Specification of the Publication Entity:

XML Namespaces. Mario Arrigoni Neri

XML and Semantic Web Technologies. II. XML / 2. XML Document Type Definitions (DTDs)

IMS Learning Design XML Binding

Comp 336/436 - Markup Languages. Fall Semester Week 4. Dr Nick Hayward

CS145 Introduction. About CS145 Relational Model, Schemas, SQL Semistructured Model, XML

Session 23 XML. XML Reading and Reference. Reading. Reference: Session 23 XML. Robert Kelly, 2018

MANAGING INFORMATION (CSCU9T4) LECTURE 2: XML STRUCTURE

CountryData Technologies for Data Exchange. Introduction to XML

DATA MODELS FOR SEMISTRUCTURED DATA

2009 Martin v. Löwis. Data-centric XML. XML Syntax

Transcription:

XML Technologies XML, DTD

Basic Structural Components of XML Documents (1/2) <?xml version="1.0" encoding="utf-8"?> <!-- XML declaration --> <!-- root element --> <root-element> <!-- an empty element --> <element/> <!-- attributes of an element --> <element attribute1="value" attribute2="another value">...</element> <!-- an element with subelements --> <element attribute1="value" attribute2="value"> <subelement>text CONTENT</subelement> <subelement>...</subelement> </element> </root-element>

Basic Structural Components of XML Documents (2/2) <?xml version="1.0" encoding="utf-8"?> <!-- XML declaration --> <!-- root element --> <root-element> <!-- element with mixed content --> <element> TEX <subelement>mixed</subelement> CONTENT WITH <subelement>subelements</subelement> </element> </root-element>

Common Mistakes in XML Documents <?xml version="1.0" encoding="utf-8"?> <elementa> <!-- a bad enclosing symbol --> <elementb>...</elementb> <!-- an element without an enclosing symbol --> <elementd> <!-- a bad element nesting --> <elemente> <elementf>... </elemente> </elementf> </elementa> <!-- another root element --> <elementg />

Basic Structural Components in DTD (1/3) <!-- declaration of an element with text content --> <!ELEMENT AAA (#PCDATA)> <!-- declaration of an element with empty content --> <!ELEMENT AAA EMPTY> <!-- declaration of an element with any content --> <!ELEMENT AAA ANY> <!-- declaration of an element with a sequence of subelements --> <!ELEMENT AAA (BBB,CCC?,DDD*,EEE+)> <!-- declaration of an element with a choice of subelements --> <!ELEMENT AAA (BBB CCC)> <!-- declaration of an element with a complex content model --> <!ELEMENT AAA (BBB,((CCC,DDD*) EEE+)+)> <!-- declaration of an element with a mixed content --> <!ELEMENT AAA (#PCDATA BBB CCC DDD)*>

Basic Structural Components in DTD (2/3) <!-- declaration of attributes of element AAA : - a mandatory attribute-1 with text content - an optional attribute-2 with text content - attribute-3 with a fixed "value" - a key attribute-4 - attribute-5 is a key reference - attribute-6 has one of the values, "value1" is default (if the attribute is not present in XML document, it has this value) --> <!ATTLIST AAA attribute-name-1 CDATA #REQUIRED attribute-name-2 CDATA #IMPLIED attribute-name-3 CDATA #FIXED "value" attribute-name-4 ID... attribute-name-5 IDREF... attribute-name-6 (value1 value2...) "value1">

Basic Structural Components in DTD (3/3) <!-- internal entity declaration --> <!ENTITY lt "&#60;"> <!ENTITY c "Copyright: " > <!-- declaration of system (private, own) external entity --> <!ENTITY ct SYSTEM "http://ksi.mff.cuni.cz/copyright.xml" > <!-- declaration of public external entity --> <!ENTITY ct PUBLIC "-//W3C//TEXT copyright//en" "http://www.w3.org/xmlspec/copyright.xml"> <?xml version="1.0" standalone="no"?> <copyright>&c;&ct;</copyright>

DTD Declaration <!-- internal declaration --> <?xml version="1.0"?> <!DOCTYPE root-element [...DTD...]> <root-element>...</root-element> <!-- private, external DTD --> <?xml version="1.0"?> <!DOCTYPE root-element SYSTEM "URI"> <root-element>...</root-element> <!-- public, external DTD --> <?xml version="1.0"?> <!DOCTYPE root-element PUBLIC public-name> <root-element>...</root-element> <?xml version="1.0"?> <!DOCTYPE root-element PUBLIC public-name "URI"> <root-element>...</root-element>

Keys and References <!ATTLIST product vid ID #REQUIRED> <!ATTLIST order oid ID #REQUIRED> <!ATTLIST item vid_ref IDREF #REQUIRED> <sale> <order oid="id_1"> <item vid_ref="id_1" /> <item vid_ref="id_3" /> </order> <order oid="id_2"> <item vid_ref="id_2" /> <item vid_ref="id_4" /> <!-- the next reference leads to non existing id! --> <item vid_ref="id_5" /> </order> <product vid="id_1" /><!--! "id_1" is already used --> <product vid="id_2" /><!--! "id_2" is already used --> <product vid="id_3" /> <product vid="id_4" /> </sale>

Common Mistakes in DTD (1/2) <!-- Every element which we use in a DTD must be defined. The same holds for attributes. --> <!-- usage of #PCDATA for different purpose than text or mixed content --> <!ELEMENT AAA (BBB, #PCDATA, CCC)> <!-- the value of ID attribute starts with number --> <!ATTLIST BBB number ID #REQUIRED> <BBB number="1">text</bbb> <!-- EMPTY can be used only separately --> <!ELEMENT AAA (EMPTY (BBB,CCC) )> <!-- attributes can not be used in element declaration --> <!ELEMENT AAA (attr1 (attr2,attr3))> <!ATTLIST AAA attr1 CDATA attr2 CDATA attr3 CDATA>

Common Mistakes in DTD (2/2) <!-- Only elements declared in the DTD can be used in the XML document (in the following example the element customer is not defined) --> <!ELEMENT new-customer (...)> <!ELEMENT present-customer (...)> <customer>...</customer> <!-- An attribute declared as choice must have a default value or must be compulsory --> <!ATTLIST AAA attr1 (value1 value2 value3)> <!-- It is not possible to specify the content of the root element directly in DOCTYPE. It must be done in declaration of this element within the DTD. --> <!DOCTYPE AAA (BBB,CCC) [...DTD...]>