Session III Chapter 7 – Entities and Notation in DTD’s

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

Introduction to the Logical Structure of XML Documents Web Engineering, SS 2007 Tomáš Pitner, Michael Derntl.
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.
Tutorial 9 Working with XHTML
XML Study-Session: Part II Validating XML Documents.
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.
Review Writing XML  Style  Common errors 1XML Technologies David Raponi.
Introduction to XLink Transparency No. 1 XML Information Set W3C Recommendation 24 October 2001 (1stEdition) 4 February 2004 (2ndEdition) Cheng-Chia Chen.
A Technical Introduction to XML Transparency No. 1 XML quick References.
4/16/2007Declare a DTD File II1 Declare A DTD File - II.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Declare A DTD File. Declare A DTD Inline File For example, use DTD to restrict the value of an XML document to contain only character data.
XML Verification Well-formed XML document  conforms to basic XML syntax  contains only built-in character entities Validated XML document  conforms.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Unit 4 – XML Schema XML - Level I Basic.
Copyright © 2003 Pearson Education, Inc. Slide 2-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
XML Validation I DTDs Robin Burke ECT 360 Winter 2004.
Tutorial 3: XML Creating a Valid XML Document. 2 Creating a Valid Document You validate documents to make certain necessary elements are never omitted.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
Validating DOCUMENTS with DTDs
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.
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
Chapter 4: Document Type Definitions. Chapter 4 Objectives Learn to create DTDs Validate an XML document against a DTD Use DTDs to create XML documents.
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.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
August Chapter 2 - Markup and Core Concepts Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.
XML Syntax - Writing XML and Designing DTD's
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.
Session IV Chapter 9 – XML Schemas
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
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.
CIS 451: XML DTDs Dr. Ralph D. Westfall February, 2009.
3. Document Type Definitions(DTDs) Data Warehousing Lab. 윤 혜 정.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
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.
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.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
The Official 2002 XML Marathon April 4, Revised Requirements A photocopy of the original text A short description (read: single paragraph) discussing.
Document Type Definitions (DTD) A Document Type Definition (DTD) defines the structure and the legal elements and attributes of an XML document. A DTD.
Beginning XML 3 rd Edition. Chapter 4: Document Type Definitions.
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
SNU OOPSLA Lab. Logical structure © copyright 2001 SNU OOPSLA Lab.
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.
Structured Documents - XML and FrameMaker 7 Asit Pant.
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.
XML Technology. Emerging Importance of XML –HTML-tagging is display oriented. –XML-based content tagging has important uses: data mining role-oriented.
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.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML Technologies DTD.
Document Type Definition DTDs
The XML Language.
Session III Chapter 6 – Creating DTDs
Session II Chapter 6 – Creating DTDs
Allyson Falkner Spokane County ISD
Presentation transcript:

Session III Chapter 7 – Entities and Notation in DTD’s

Outline Introduction General Entities Creating Unparsed Content Embedding Unparsed Content Parameter Entities 8/1/2014Copyright © Carl M. Burnett2

Introduction Entities are used to define shortcuts to special characters. Entities can be two types: general and parameter General entities can be declared internal or external, parsed or unparsed Parameters can be declared internal or external, but are always parsed. 8/1/2014Copyright © Carl M. Burnett3

Creating & Using General Entities 8/1/2014Copyright © Carl M. Burnett4 1.Type <!ENTITY 2.Type ent_name where ent_name is name of the entity. 3.Type “ content” where content is the shortcut text. 4.Type > to close out the entity definition. Creating General Entities Using General Entities 1.Type in the XML document the “ &” 2.Type ent_name where ent_name is name of the entity. 3.Type a ; after the entity name.

Creating and Using External General Entities 8/1/2014Copyright © Carl M. Burnett5 Creating External General Entities Using External General Entities 1.Type <!ENTITY 2.Type ent_name where ent_name is name of the entity. 3.Type “ SYSTEM ” to indicate the entity is external. 4.Type “entity.uri” where the entity.uri file is located. 5.Type > to close out the entity definition. entity.ent file The first and most interesting fact about the gardens is that there is significant controversy about whether the gardens existed at all.... ancient historians have created one of the &wow;. 1.Add <standalone=“no” to the XML declaration. 2.Type & in the XML document where the ent_name is to be used. 3.Type ent_name where ent_name is name of the entity. 4.Type ; to close out the entity definition earthquake &gardens_story;

Creating Unparsed Content 8/1/2014Copyright © Carl M. Burnett6 1.In the DTD where you want to embed the content type <!NOTATION_n_name where n_name is the content. 2.Type SYSTEM. 3.Type “notation.instr” where notation.instr is the URI for the unparsed content. 4.Type > to complete the notation. To Create a Notation To define an entity for the unparsed content 1.After the notation declaration type, <!ENTITY 2.Type ent_name where ent_name is the name for the external entity 3.Type SYSTEM. 4.Type “entity.uri” where entity.uri is the location of the file. 5.Type SNDATA n_name where n_name is the unparsed content name. 6.Type > to complete the definition.

Embedding Unparsed Content 8/1/2014Copyright © Carl M. Burnett7 1.In the DTD first define and declare an element. 2.Type <!ATTLIST tag where tag is the element you defined. 3.Type att_name where att_name is the name of the attribute. 4.Type ENTITY or ENTITIES to reference that this is an unparsed entity. 5.Type > to complete the attribute definition. To Declare the Attribute for the Unparsed Entity To Embed an Unparsed Entity into a XML Document 1.In the XML document that referes to the DTD add: standalone=“no” 2.In the body of the XML document within the attribute declared with an ENTITY type, att_name=“ent_name” where att_name is the name of the unparsed entity declared.

Creating and Using Parameter Entities 8/1/2014Copyright © Carl M. Burnett8 1.In the DTD type <!ENTITY to begin the definition. 2.Type % (space) to note that the entity is a parameter. 3.Type ent_name where ent_name is the name of the entity. 4.Type “content” where “content” is the shortcut text. 5.Type > to complete the entity definition. To Create a Parameter Entity To Use a Parameter Entity 1.In the DTD type % to begin the definition. 2.Then Type ent_name where ent_name is the name of the entity. 3.Finally type ; to close out the expression.

Creating an External Parameter Entity 8/1/2014Copyright © Carl M. Burnett9 1.Create the entity’s content in an external text file and save it with the extension.ent. To Create an External Parameter Entity To Define an External Parameter Entity 1.In the DTD type <!ENTITY to begin the entity definition. 2.Then type % to indicate that this is for a parameter entity. 3.Type ent_name where ent_name is the name of the entity. 4.Then type SYSTEM to indicate that the is defined externally. 5.Type “entity.uri” where “entity.uri” is the location of the external file with the content. 6.Finally type > to close out the entity definition. <!ATTLIST main_image file CDATA #REQUIRED w CDATA #REQUIRED h CDATA #REQUIRED> pic.ent file

Review Introduction General Entities Creating Unparsed Content Embedding Unparsed Content Parameter Entities 8/1/2014Copyright © Carl M. Burnett10 Next: Chapter 8 – Validation and Using DTDs