The following DTD was developed primarily as an intellectual exercise, but also to examine
the suggestion that any Guidelines for Dublin Core in XML should be implementable
as DTDs, at least as a baseline. Related to this, the DTD explores whether the use of the xsi:type
attribute too closely ties the Guidelines to the XML Schema language. This DTD was influenced by work done on the
Recommendations for XML Schema for Qualified Dublin Core.
I believe the following DTD conforms to
the Guidelines for implementing Dublin Core in XML
in all respects, except, of course, for the first Recommendation to use XML Schemas instead of DTDs. This includes the
somewhat controversial Recommendation 7 to use an xsi:type attribute to express encoding schemes.
<dc:title> element it is tempting to use something like
<!ELEMENT %dc_prefix;:title (#PCDATA) > , but this is not legal. However, you can
concatenate parameter entities to create new parameter entities; thus, <!ENTITY % dc_title "%dc_prefix;:title" >
is legal.
This then allows <!ELEMENT %dc_title; (#PCDATA) > . This technique was used through the DTD.
For an explanation of this see 4.4.8 Included as PE in the XML standard.
xmlns:dc="http://purl.org/dc/elements/1.1/" have been
included as #FIXED attributes on every element, including the root element. In typical instance documents these are only included
one time on the root element, but it is also legal to repeat them on every element, if desired. One side-effect of making these attributes
#FIXED on every element is that the instance documents can look very verbose in some viewers even when these attributes are
really only included once in the instance document.
While certainly not as powerful or as flexible as using XML Schema, it is possible to create a somewhat useful DTD that conforms to the
Guidelines for implementing Dublin Core in XML (excepting Recommendation 1), including Recommendation 7 for using xsi:type. I
personally would never use this DTD unless I was in a severely constrained environment where using XML Schema was impossible. This should be
pretty rare with the wide adoption of XML Schema in a number of free and commercial implementations.
Another point is that the xsi:type recommendation can be implemented using a DTD, and if you want to support namespaces in the
DTD anyway, adding support for this attribute isn't even difficult. Granted, in the DTD world you don't get any benefit from using
xsi:type over any other arbitrary attribute name, such as schema, but my feeling is that the extra power and flexibility
(of extensibility and datatyping capabilities) that using this attibute affords in the XML Schema world outweights the minor incovenience
that implementing it in non-XML Schema environments might entail.
A Schematron implementation