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
The files from this chapter are in the dtd_creating folder.
| Page | Section | Code |
|---|---|---|
| 36 | Declaring an Internal DTD |
internal.xml |
| 37 | Writing an External DTD | end_species.dtd |
| 39 |
Declaring a Personal External DTD |
Figure 2.4: external.xml |
| 40 | Declaring a Public External DTD | external_public.xml |
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, |
| 48 | Defining How Many Units | |
| 50 - 51 | Defining Simple Attributes |
Figure 3.16: att_optional.dtd Figure 3:18: att_required.dtd Figure 3.20: att_default.dtd Figure 3.22: att_fixed.dtd |
| 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 |
| 54 | Restricting Attributes to Valid XML Names |
The files in this section are in the dtd_entities folder.
| Page | Section | HTML |
|---|---|---|
| 56 | Creating Shortcuts for Text | |
| 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 |
| 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) |
Click here to return to the course outline.
Last revision September 10, 2001
http://www.informaticus.org/COIN78/week3/index.htm