Adjust type size
Larger | Smaller


Karen Vagts: XML Portfolio

[ XML Course Web Page ] [ XML Portfolio Home ]
[ XML Resources ]

Assignment 2

Create a demonstration DTD.  Create an internal and external DTD and a demo .xml page applying the DTD.  Have this page available from the "Assignment 1" link on your portfolio page. Due 14 Feb 2007.

In line with my interest in geospatial data, my sample DTD and XML page addresses the regions, or autonomous communities, of Spain. The data elements would form a gazetteer. These communities are a good exercise in working with DTDs because the regions are varied in their structure, for example, some have a single capital and official language, others might have multiple capitals and/or languages. All have varying numbers of sub-regions (provinces). Therefore, you have to know how to specify the elements in the DTD to permit multiple incidents of a child element or to indicate that the element should appear only a set number of times.

XML Document using an Internal DTD >>

XML Document using an Extermal DTD >>

For Assignment 3, I'll try to express this same element set using a schema instead of a DTD.

Note: Spain has seventeen autonomous communities (which collectively contain 50 provinces) but only three are shown in this sample XML document. However, this small sample set highlights the issues that would arise in developing an XML application to describe the communities. Once the issues are effectively resolved, then it might be easy to build a routine to import the information for all the communities from other sources.