"> ">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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" "http://www.tei-c.org/Guidelines/DTD/tei2.dtd" [ %ISOlat1; %ISOlat2; %ISOnum; %ISOpub; ]>

2 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.

3 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; ]>

4 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 [ ].

5 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

6 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

7 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:

8 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.

9 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.

10 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" >

11 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" >

12 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" >

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


Download ppt "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."

Similar presentations


Ads by Google