The description of DTDs in the XML 1.1 specification is very terse, and it is difficult to gain an appreciation of what features are available. For example, from looking at the unflattened XHTML+MathML+SVG DTD, I know it is possible to import and partially redefine external DTDs, but I would never have guessed that was possible from reading the spec.
Does anyone know of a good resource for learning the finer points of DTD writing?
A DTD defines the valid building blocks of an XML document. It defines the document structure with a list of validated elements and attributes. A DTD can be declared inline inside an XML document, or as an external reference. XML uses a subset of SGML DTD.
A DTD can be declared inside an XML document as inline or as an external recommendation. DTD determines how many times a node should appear, and how their child nodes are ordered. There are 2 data types, PCDATA and CDATA. PCDATA is parsed character data. CDATA is character data, not usually parsed.
May be too basic for your needs, but W3 schools often has good primers?
I would recommend Elliotte-Rusty Harold's book "XML Bible".
This is not "documentation", document type definitions (DTDs) are one of the most complex parts of XML and deserve to be learnt from the best sources.
One can also learn from examining good existing DTDs. Look for example at the following DTD, required to be used for the Balisage Conference slideshow presentations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With