Structured Documents KA1 Document Type definition DTD.

Slides:



Advertisements
Similar presentations
Defining XML The Document Type Definition. Document Type Definition text syntax for defining –elements of XML –attributes (and possibly default values)
Advertisements

XML: text format Dr Andy Evans. Text-based data formats As data space has become cheaper, people have moved away from binary data formats. Text easier.
An Introduction to XML Based on the W3C XML Recommendations.
© De Montfort University, XML – a meta language Howell Istance and Peter Norris School of Computing De Montfort University.
XML 6.3 DTD 6. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:  Elements.
History Leading to XHTML
XML Document Type Definitions ( DTD ). 1.Introduction to DTD An XML document may have an optional DTD, which defines the document’s grammar. Since the.
Introduction to XML: DTD
Document Type Definition DTDs CS-328. What is a DTD Defines the structure of an XML document Only the elements defined in a DTD can be used in an XML.
Document Type Definitions
CSCI 7818 (Topics in Software Engineering) Web Infrastructure, Services, and Applications Document Type Definition (DTD) Author: Lukasz Kurgan.
A Technical Introduction to XML Transparency No. 1 XML quick References.
 2002 Prentice Hall, Inc. All rights reserved. ISQA 407 XML/WML Winter 2002 Dr. Sergio Davalos.
Thayer School of Engineering Dartmouth Lecture 2 Overview Web Services concept XML introduction Visual Studio.net.
Week 4 Document Type Definition (DTD)
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Tutorial 11 Creating XML Document
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Introduction to XML This material is based heavily on the tutorial by the same name at
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Document Type Definitions Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
XML - DTD. The building blocks of XML documents Elements, Tags, Attributes, Entities, PCDATA, and CDATA.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
XML Extensible Markup Language. What is XML? ● meta-markup language ● a language for defining a family of languages ● semantic/structured mark-up language.
XML Syntax - Writing XML and Designing DTD's
XML (2) DTD Sungchul Hong.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
Lecture 6 XML DTD Content of.xml fileContent of.dtd file.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
XML - DTD Week 4 Anthony Borquez. What can XML do? provides an application independent way of sharing data. independent groups of people can agree to.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation An Introduction to XML.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
IS432 Semi-Structured Data Lecture 2: DTD Dr. Gamal Al-Shorbagy.
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.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
Lecture 16 Introduction to XML Boriana Koleva Room: C54
School of Computing and Information Systems CS 371 Web Application Programming XML and JSON Encoding Data.
1 Introduction to XML XML stands for Extensible Markup Language. Because it is extensible, XML has been used to create a wide variety of different markup.
An Introduction to XML Sandeep Bhattaram
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
1 Dr Alexiei Dingli XML Technologies DTD. 2 Document Type Definition Defines –the legal building blocks of an XML document –the document structure –The.
XML Design Goals 1.XML must be easily usable over the Internet 2.XML must support a wide variety of applications 3.XML must be compatible with SGML 4.It.
Document Type Definitions (DTD) A Document Type Definition (DTD) defines the structure and the legal elements and attributes of an XML document. A DTD.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
Well Formed XML The basics. A Simple XML Document Smith Alice.
Introduction to DTD A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XML DTD. XML Validation XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML.
Document Type Definition (DTD) Eugenia Fernandez IUPUI.
DTD Document Type Definition. Agenda Introduction to DTD DTD Building Blocks DTD Elements DTD Attributes DTD Entities DTD Exercises DTD Q&A.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
XML CORE CSC1310 Fall XML DOCUMENT XML document XML document is a convenient way for parsers to archive data. In other words, it is a way to describe.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor
CITA 330 Section 2 DTD. Defining XML Dialects “Well-formedness” is the minimal requirement for an XML document; all XML parsers can check it Any useful.
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML Technologies DTD.
Unit 4 Representing Web Data: XML
Creating a Well-Formed Valid Document
The XML Language.
Chapter 7 Representing Web Data: XML
Web Programming Maymester 2004
Allyson Falkner Spokane County ISD
Presentation transcript:

Structured Documents KA1 Document Type definition DTD

Structured Documents KA 2 Structural Analysis and DTD 1.Structural Analyses and DTD 2.What is DTD 3.Ex: phonebook.dtd 4.Ex: phonebook.xml 5.Parts of XML Document 6.Producing XML Document 7.XML Browsers 8.Ex phonebook.xsl 9.DTD Planning 10.XML: Separators 11.XML: Comments and Naming 12.XML: Elelemnts 13.XML: Order of elements 14.Ex: Letter 15.Ex: Letter b 16.Ex: letter c 17.DTD: Building Blocks 18.DTD: Elements 19.XML tags 20.DTD: Attributes 21.Types of Attribute 22.Attribute Defaults 23.DTD: Predefined Entities 24.DTD: Own Entities 25.DTD: PCDATA / CDATA

Structured Documents KA 3 What is a DTD DTD = Document Type Definition definition of the document class DTD descripes the logical elements, their order and content DTD can be created from the structure diagram

Structured Documents KA 4 Example phonebook.dtd

Structured Documents KA 5 Example phonebook. xml Michael Schumacher Nelikkoratsu 2 A Heinola ……

Structured Documents KA 6 Parts of an XML Document A XML document itself consist of: XML declaration (can be missing) Document Type Definition (DTD can be missing) Root element (eg. Document instance (representative of the document class) XML declaration informs the XML prosessing system about the version and the character set e.g. DTD can be written directly into a document itself or into another document

Structured Documents KA 7 Producing an XML Document XML + DTD XML editor dbase simple editor Paper doc IntelligentOCR Structured doc conversion XML Spy XMetal Eclipse

Structured Documents KA 8 Example phonebook.xsl Phonebook Company …..

Structured Documents KA 9 DTD Planning 1. Define application area (firm, department …) 2. Define strategy of using the DTD 1. Why to do the DTD? 2. How DTD is applied? 3. Priority of functionality? 4. Access criterias? 5. Sorting/Calculation criterias 3. Define the users 4. Name the DTD 5. Define the logical elements of the document class 1. Structure analyzes 2. Name the elements 3. Element vs. attribute

Structured Documents KA 10 XML: Separatos /> Used to separate the information and the markup E.g. Header

Structured Documents KA 11 XML: Comments and Naming A comment is defined XML name consist of the following chars: 1. char a-z, A-Z 2-n. chara-z, A-Z, 0-9,.,- NO tab or whitespace XML names are CASE sensitive

Structured Documents KA 12 XML: Elements Element format Element ending Element is defined in the DTD Element can include other elements The part within the parenthis is called the model group. Element can be text, #PCDATA or include other elements.

Structured Documents KA 13 XML: Order of Elements Elements in sequence are separated with a comma (,) 0,1 or n times appearing elements with (*) 1 or n times appearing elements with (+) Alternative elements with a pipe (|) 0 or 1 time appearing element with a question mark (?)

Structured Documents KA 14 Example: letter letter.dtd letter.xml Seija R. Kake A. Perjantaina on tiimipalaveri Seija R.

Structured Documents KA 15 Example: letter b letterb.dtd letterb.xml Seija R. Kake A. Tiimipalaveri Perjantaina on tiimipalaveri Seija R. Erkki R.

Structured Documents KA 16 Example: letter c letterc.dtd

Structured Documents KA 17 DTD Building Blocks Seen from a DTD point of view, all XML documents (and HTML documents) are made up by the following simple building blocks:  Elements  Tags  Attributes  Entities  PCDATA = parseable character data  CDATA

Structured Documents KA 18 DTD: Elements Elements are the main building blocks of both XML and XHTML documents. Examples of XHTML elements are "body" and "table". Examples of XML elements could be "note" and "message". Elements can contain text, other elements, or be empty. Examples of empty HTML elements are "hr", "br" and "img".

Structured Documents KA 19 XML: Tags Tags are used to markup elements. A starting tag like marks up the beginning of an element, and an ending tag like marks up the end of an element. body element marked up with body tags: body text in between. message element marked up with message tags: some message in between

Structured Documents KA 20 DTD: Attributes Attributes provide extra information about elements. Attributes are always placed inside the starting tag of an element. Attributes always come in name/value pairs. The following "img" element has additional information about a source file: The name of the element is "img". The name of the attribute is "src". The value of the attribute is "computer.gif". Since the element itself is empty it is closed by a " /". DTD:.xml:

Structured Documents KA 21 Types of Attribute TypeMeaning CDATACharacter data (string) ID IDREF IDREFS Name unique within a given document Reference to some element bearing an ID attribute Series of IDREFs delimited with white space ENTITY ENTITIES Name of predefined external entity Series of entity names delimited by white space NMTOKENA name NOTATIONAccepts one of a series of explicitly user-defined values that the attribute can take on dtd: xml: dtd: xml: …

Structured Documents KA 22 Attribute Defaults ValueExplanation valueThe attributes default value #DEFAULT valueThe attributes default value #REQUIREDThe attribute value must be included in the element #IMPLIEDThe attribute does not have to be included #FIXED valueThe attribute value is fixed

Structured Documents KA 23 DTD: Predefined Entities Entities are variables used to define common text. Entity references are references to entities. Most of you will know the HTML entity reference: " ". This "no- breaking-space" entity is used in HTML to insert an extra space in a document. Entities are expanded when a document is parsed by an XML parser. The following entities are predefined in XML: Entity References Character << >> && "" &apos;'

Structured Documents KA 24 DTD: Own Entities Every where in XML file the note &EVTEK; is replaced with string Espoo Vantaa Instituite of Technology and It is 45 ° now in Turkey is replaced with string It is 45° now in Turkey

Structured Documents KA 25 DTD: PCDATA / CDATA PCDATA means parsed character data. PCDATA is text that will be parsed by a parser. Tags inside the text will be treated as markup and entities will be expanded. CDATA also means character data. CDATA is text that will NOT be parsed by a parser. Tags inside the text will NOT be treated as markup and entities will not be expanded.