Computers, Technology and Information Systems


XML - eXtensible Markup Language - COIN 78


In week three we will learn about linking DTDs, and a quick introduction to Cascading Style Sheets. After this, you will be ready to complete assignment one. You are also encouraged to read ahead, and look at the example files as a reference.

The PowerPoint presentation below contains material for both sections, separated by a title slide. If you want to look deeper into DTDs and their relationship to databases, a lengthy presentation is also linked below. Assignment one is due in two weeks.

Writing a Basic DTD - The basics of creating a DTD

Defining elements and attributes in a DTD - Defining elements and attributes in a DTD

Entities and notations in DTDs - Entities and notations in DTDs

These presentations will help you understand even more detail, and validate your documents


Part 2: DTDs

Chapter 2, Creating a DTD

The files from this chapter are in the dtd_creating folder.

Page Section Code
36 Declaring an Internal DTD

internal.xml
with a real DTD: internal_real.xml

37 Writing an External DTD end_species.dtd
39

Declaring a Personal External DTD

Figure 2.4: external.xml
Figure 2.5: external_and_internal.xml

40 Declaring a Public External DTD external_public.xml

Chapter 3, Defining Elements and Attributes in a DTD

The files in this section are in the dtd_defining folder. You'll note that these files contain more than what is shown in the illustrations. I have fleshed out these examples so that you can really test them against an XML Validator. In fact, I heartily recommend doing so. Copy them to your server, play around with them, and then study the error messages that XML Validator gives you! I hope you find them useful.

Page Section Code
44 Defining an Element to Contain Only Text onlytext.dtd, onlytext.xml
45 Defining an Element to Contain One Child onechild.dtd, onechild.xml
46 Defining an Element to Contain a Sequence sequence.dtd, sequence.xml
47 Defining Choices

choices.dtd,
Figure 3.11: choices.xml, choices2.xml
Figure 3.12: choices_invalid.xml, choices_invalid2.xml

48 Defining How Many Units

howmany.dtd, howmany2.dtd

50 - 51 Defining Simple Attributes

Figure 3.16: att_optional.dtd
Figure 3.17: attribute_optional.xml, attribute_optional2.xml, attribute_optional3.xml

Figure 3:18: att_required.dtd
Figure 3:19: att_required_choice1.xml, att_required_choice2.xml, att_required_choice3.xml

Figure 3.20: att_default.dtd
Figure 3.21:att_default1.xml, att_default2.xml, att_default3.xml

Figure 3.22: att_fixed.dtd
Figure 3.23: att_fixed1.xml, att_fixed2.xml, att_fixed3.xml

52 Defining Attributes with Unique Values att_unique.dtd
Figure 3.25: att_unique1.xml (top), att_unique2.xml (bottom)
53 Referencing Attributes with Unique Values

Figures 3.26 and 3.28: idref.dtd
Figure 3.27: idref.xml
Figure 3.29: idrefs.xml

54 Restricting Attributes to Valid XML Names

nmtoken.dtd
nmtoken.xml, nmtoken2.xml


Chapter 4, Entities and Notations in DTDs

The files in this section are in the dtd_entities folder.

Page Section HTML
56 Creating Shortcuts for Text

shortcuts.dtd

57 Using Shortcuts for Text shortcuts.xml
58 Shortcuts for Text in External Files Figure 4.5: hwi.ent
Figure 4.6: shortcuts_ext.dtd
Figure 4.7: shortcuts_ext.xml
60 Creating and Using Shortcuts for DTDs

Figure 4.9: pic.dtd
Figure 4.10: dtdshortcut_used.dtd
Figure 4.11: dtdshortcut_used.xml
(Figure 4.12 does not ever exist as a file, it's just a "dramatization"
of what happens when you use a shortcut for a chunk of DTD.)

62 Creating Entities for Unparsed Content Figure 4.13: tiger.jpg
Figure 4.14, 4.15: unparsed.dtd
63 Embedding Unparsed Content

Figure 4.16 and top part of Figure 4.17: unparsed.dtd (same as Figs. 4.14 and 4.15)
Bottom part of Figure 4.17: unparsed.xml

 


Click here to return to the course outline.

Last revision September 10, 2001

http://www.informaticus.org/COIN78/week3/index.htm