CSCI 7818 (Topics in Software Engineering) Web Infrastructure, Services, and Applications Document Type Definition (DTD) Author: Lukasz Kurgan.

Slides:



Advertisements
Similar presentations
An Introduction to XML Based on the W3C XML Recommendations.
Advertisements

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.
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.
3 November 2008CIS 340 # 1 Topics To define XML as a technology To place XML in the context of system architectures.
Tutorial 9 Working with XHTML
1 XML: Document Type Definitions 2 Road Map  Introduction to DTDs  What’s a DTD?  Why are they important?  What will we cover?  Our First DTD 
Structured Documents KA1 Document Type definition DTD.
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
Topics The "bigger picture" –The "XML sales pitch" –XML/XHTML vs. SGML/HTML –XML in electronic publishing –XML and the future, web 2.0 XML basics: –Building.
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.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
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 What is XML? XML v.s. HTML XML Components Well-formed and Valid Document Type Definition (DTD) Extensible Style Language (XSL) SAX and DOM.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
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.
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
XML (2) DTD Sungchul Hong.
FIGIS’ML Hands-on training - © FAO/FIGIS An introduction to XML Objectives : –what is XML? –XML and HTML –XML documents structure well-formedness.
 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,
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language  XML is a markup language for creating documents containing structured information.
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
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.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
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.
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
Lecture 16 Introduction to XML Boriana Koleva Room: C54
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.
1/11 ITApplications XML Module Session 3: Document Type Definition (DTD) Part 1.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
What it is and how it works
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.
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
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.
CIS 375—Web App Dev II DTD. 2 Introduction to DTD DTD stands for ______________________. The purpose of a DTD is to define the legal building blocks of.
XML Document Type Definitions and the Document object model.
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 DTD. XML Validation XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XML Technology. Emerging Importance of XML –HTML-tagging is display oriented. –XML-based content tagging has important uses: data mining role-oriented.
DTD Document Type Definition. Agenda Introduction to DTD DTD Building Blocks DTD Elements DTD Attributes DTD Entities DTD Exercises DTD Q&A.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
DTDs© Aptech Limited DTDs 03. DTDs© Aptech LimitedDTDs© Aptech Limited Document Type Definition  In this first lesson, Document Type Definition, you.
Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor
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.
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML Technologies DTD.
Session III Chapter 6 – Creating DTDs
Session II Chapter 6 – Creating DTDs
Presentation transcript:

CSCI 7818 (Topics in Software Engineering) Web Infrastructure, Services, and Applications Document Type Definition (DTD) Author: Lukasz Kurgan

What is DTD? DTD is used to declare each of the building blocks (elements) used in a XML document DTD defines: –a structure of the XML document –a list of legal elements of the XML document DTD by Lukasz Kurgan

Well-Formed vs. Valid Document Well-formed document – the document that adheres to the XML syntax rules Valid document – the document that adheres to the rules defined in the corresponding DTD document Only the valid documents are valuable in terms of sharing and retrieving information. DTD by Lukasz Kurgan

Internal vs. External DTD DTD by Lukasz Kurgan What is wrong here ?

Internal vs. External DTD External DTD are better because of: –possibility of sharing definitions between XML documents –The documents that share the same DTD are more uniform and easier to retrieve Linking in the DTD document Ken Anderson Lukasz Kurgan Ok! We can see some progress DTD by Lukasz Kurgan

Building blocks of XML XML documents (and HTML documents) are made up by the following building blocks: DTD by Lukasz Kurgan DescriptionExamples in HTMLExamples in XML Elements main building blocks body,tablenote, from Tags used to markup elements Attributes provide extra information about elements Entities variables used to define common text & " ' PCDATA 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 CDATA 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.

Declaring Elements in DTD An element declaration has the following syntax: –Elements name cannot include <> characters and must start with letter or underscore –Elements name can include namespace declaration: Namespace:element-name DTD by Lukasz Kurgan

Declaring Elements in DTD Details on element declarations: Empty elements Elements with data Elements with children (sequences) DTD by Lukasz Kurgan

Declaring Elements in DTD Details on element declarations: Declaring zero or more occurrences of the same element Declaring minimum one occurrence of the same element Declaring mixed content The example above declares that the element note must contain at least one to child element, exactly one header, zero or more message, and some other parsed character data. DTD by Lukasz Kurgan

Declaring Attributes in DTD XML element attributes are declared with an ATTLIST declaration. An attribute declaration has the following syntax: DTD by Lukasz Kurgan valueexplanation attribute-type CDATAcharacter data (eval|eval|..)enumerated value IDunique id NMTOKENvalid XML name default-value #DEFAULT valuedefault value #REQUIREDmust be included in the element #IMPLIEDdoes not have to be included #FIXED valuevalue is fixed

Declaring Attributes in DTD Attribute declaration example DTD example: XML example: DTD by Lukasz Kurgan

Entities in DTD Variables used to define shortcuts to common text Entity references are references to entities Can be declared internally or externally DTD by Lukasz Kurgan

Internal Entities in DTD Define shortcuts to common text Syntax: Example: In DTD: In XML: &copyright; &writer; DTD by Lukasz Kurgan

External Entities in DTD Allow to copy the XML content located at specified URI into the current XML document Syntax: Example: In DTD: In XML: Article from &article; DTD by Lukasz Kurgan

HTML=XML+DTD+XSL DTD by Lukasz Kurgan XML page DTD page HTML page returned XSL style sheet BROWSER Request for a XML page

“Bigger” Example Machine Learning Bibliographies Maintained by Lukasz Kurgan 1. Feature Selection 2. Rule Induction 3. Discretization 4. Learning Ensemble of Classifiers 09/11/01 DTD by Lukasz Kurgan DTD document

Why use the DTD? XML provides an application independent way of sharing data With a DTD, independent groups of people can agree to use a common DTD for interchanging data Your application can use a standard DTD to verify that data that you receive from the outside world is valid You can also use a DTD to verify your own data DTD by Lukasz Kurgan

Links Demo: Simple Tutorial: Sample XML pages that use DTD and XSL: DTD by Lukasz Kurgan

My Impressions XML = extremely syntax sensitive –good thing that assures unification and accessibility of the knowledge on the net Long learning curve –Hard to learn, difficult to display as HTML. People will resist learning it –Thus, the strong need for good XML editors Good Tutorial sites are really needed! But, the XML is the only tool that can result in the next generation of the WWW DTD by Lukasz Kurgan