Construction and Pedagogical Use of Digital Archives Washington University 30 May 2006 Four: The DTD <!DOCTYPE TEI.2 PUBLIC "-//TEI P4//DTD Main DTD Driver.

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

1 DTD (Document Type Definition) Imposing Structure on XML Documents (W3Schools on DTDs)W3Schools on DTDs.
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.
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.
Document Type Definitions
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 
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.
Full declaration When an element is declared to have element content, the children element types must also be declared Example: to which the following.
Physical and Logical Structure
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:
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
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Document Type Definition.
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
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.
MIS 315 Bsharah An Introduction to XML 1MIS Bsharah.
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
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
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.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
 2002 Prentice Hall, Inc. All rights reserved. Chapter 6 – Document Type Definition (DTD) Outline 6.1Introduction 6.2Parsers, Well-formed and Valid XML.
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.
SNU OOPSLA Lab. XML Documents 1 : Structure The ubiquitous XML(2) © copyright 2001 SNU OOPSLA Lab.
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.
IS432 Semi-Structured Data Lecture 2: DTD Dr. Gamal Al-Shorbagy.
2 XML Syntax XML Document Structure August 15, :00 Darmstadt Hessen Germany fine 25 SW 6 Markup Content.
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.
CSE3201 Information Retrieval Systems DTD Document Type Definition.
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.
ENG 5933 Humanities Computing Introduction to XML
QUALITY CONTROL WITH SCHEMAS CSC1310 Fall BASIS CONCEPTS SchemaSchema is a pass-or-fail test for document Schema is a minimum set of requirements.
1 Internal DTD External DTD. 2 Internal DTD ]> Tove Jani Reminder Don't forget me this weekend.
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.
Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor
CH 9 Attribute Declaration 1. Objective What is an attribute Declaring attributes Declaring multiple attribute Alternatives to default attributes values.
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.
The Orlando Project An Integrated History of
Well-formed and Valid XML Documents
Document Type Definition DTDs
Session III Chapter 6 – Creating DTDs
Managing XML and Semistructured Data
ENG 5933 Humanities Computing
Web Programming Maymester 2004
Basic HTML and Embed Codes
New Perspectives on XML
DTD (Document Type Definition)
Session II Chapter 6 – Creating DTDs
Document Type Definition (DTD)
Presentation transcript:

Construction and Pedagogical Use of Digital Archives Washington University 30 May 2006 Four: The DTD <!DOCTYPE TEI.2 PUBLIC "-//TEI P4//DTD Main DTD Driver File//EN" " [ %ISOlat1; %ISOlat2; %ISOnum; %ISOpub; ]>

The XML Declaration The first line of any XML document contains the XML declaration: If the file has an associated XSL stylesheet, it is declared next: where “filename” is the URL of the associated stylesheet.

Doctype Declaration The doctype declaration follows the XML declarations: where “Filename.dtd” is the URL of the external dtd. Additions or references to the base dtd can be added between brackets “[ ]”: <!DOCTYPE Root_element_name SYSTEM " Filename.dtd ”[ % characterset; ]>

Doctype Declaration A dtd can also be included in the body of the document rather than in an external document: <!DOCTYPE Root_element_name SYSTEM [ Element, Attribute and, Entity Declarations... ]> where all the element, attribute, and entity declarations occur between the square brackets [ ].

DTD Operators When declaring elements and attributes, use the following symbols to indicate relationships: ? Optional, 0 or 1 + Required, 1 or more * Optional and repeatable, 0 or more | Or, Sequential

Element Declaration Element declarations take the following form: The Content Model may contain: * Specific tagnames or ANY (essentially any and all tagnames) * #PCDATA (essentially simple characters) * EMPTY (indicating an empty tag

Sample Element Declarations Simple text: Mixed content: <!ELEMENT dateline (#PCDATA | date | time | name | address | anchor | gap | figure | index | interp | interpGrp | lb | milestone | pb)* > Complex: Empty:

Attribute Declaration Attribute declarations take the following form: Attribute types can have the following values: CDATA: Characters data that is not markup; Enumerated: A list of values from which only one may be chosen; ID: A unique name not shared by any other ID type in the document; IDREF: The value of an ID type attribute of an element in the document; IDREFS: Multiple IDS of elements separated by whitespace; ENTITY: The name of an entity declared in the DTD; ENTITIES: Names of multiple entitities declared in the DTD, separated by whitespace.

Attribute Declaration Attribute declarations take the following form: Default types can have the following values: #REQUIRED: The attribute must be included and given a value; #IMPLIED: The attribute is optional #FIXED: The attribute is required and the value is declared in the attribute declaration within quotes immediately after the default value declaration.

Sample Attribute Declaration <!ATTLIST p corresp IDREFS #IMPLIED next IDREF #IMPLIED prev IDREF #IMPLIED ana IDREFS #IMPLIED id ID #IMPLIED n CDATA #IMPLIED lang IDREF #IMPLIED rend CDATA #IMPLIED TEIform CDATA "p" >

Element & Attribute <!ELEMENT p (#PCDATA | ident | code | kw | abbr | address | date | name | num | rs | time | add | corr | del | orig | reg | sic | unclear | formula | emph | foreign | gloss | hi | mentioned | soCalled | term | title | ptr | ref | xptr | xref | s | seg | gi | eg | bibl | biblFull | cit | q | label | list | listBibl | note | stage | table | text | anchor | gap | figure | index | interp | interpGrp | lb | milestone | pb)* > <!ATTLIST p corresp IDREFS #IMPLIED next IDREF #IMPLIED prev IDREF #IMPLIED ana IDREFS #IMPLIED id ID #IMPLIED n CDATA #IMPLIED lang IDREF #IMPLIED rend CDATA #IMPLIED TEIform CDATA "p" >

Element & Attribute <!ELEMENT div0 ((argument | byline | dateline | docAuthor | docDate | epigraph | head | opener | salute | signed | anchor | gap | figure | index | interp | interpGrp | lb | milestone | pb)*, (((div1 | divGen), (anchor | gap | figure | index | interp | interpGrp | lb | milestone | pb)*)+ | (((eg | bibl | biblFull | ab | l | lg | p | sp | cit | q | label | list | listBibl | note | stage | table), (anchor | gap | figure | index | interp | interpGrp | lb | milestone | pb)*)+, ((div1 | divGen), (anchor | gap | figure | index | interp | interpGrp | lb | milestone | pb)*)*)), ((byline | closer | dateline | epigraph | salute | signed | trailer), (anchor | gap | figure | index | interp | interpGrp | lb | milestone | pb)*)*) > <!ATTLIST div0 corresp IDREFS #IMPLIED next IDREF #IMPLIED prev IDREF #IMPLIED ana IDREFS #IMPLIED id ID #IMPLIED n CDATA #IMPLIED lang IDREF #IMPLIED rend CDATA #IMPLIED type CDATA #IMPLIED org (composite | uniform) "uniform" sample (initial | medial | final | unknown | complete) "complete" part (Y | N | I | M | F) "N" decls IDREFS #IMPLIED TEIform CDATA "div0" >

Entity Declarations Document-level entity declarations take the following form: Within a DTD, references to external parameter entities take the following form: % Name ;