Sustainability of Digital Formats: Planning for Library of Congress Collections |
|
![]() |
|
Introduction | Sustainability Factors | Content Categories | Format Descriptions | Contact |
Full name | XML Document Type Definition (DTD) |
---|---|
Description |
An XML Document Type Definition is a formal expression (in XML) of the structural constraints for a class of XML documents. The DTD language constructs are element and attribute-list declarations. Element declarations name the elements allowed within a document of this type, and specify whether and how declared elements and runs of character data may be contained within each element. Attribute-list declarations name the permitted attributes for each declared element, including the type of each attribute value, if not an explicit set of valid value(s). A DTD is associated with an XML document via a Document Type Declaration, which is a tag that appears near the start of the XML document. The declaration establishes that the document is an instance of the type defined by the referenced DTD. These declarations within an XML document can be either internal or external. Internal DTD declarations are stated at the beginning of the XML document and must be wrapped in the <!DOCTYPE> definition. An internal declaration example from the W3schools DTD tutorial is as follows: <?xml version="1.0"?> <!DOCTYPE note [ <!ELEMENT note (to,from,heading,body)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> ]> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend</body> </note> DTDs can also be declared in an external file at the beginning of the XML document. Similar to internal declarations, they must be wrapped in the <!DOCTYPE> definition. An example of an external DTD declaration is as follows: <?xml version="1.0"?> <!DOCTYPE note SYSTEM "note.dtd"> The DTD file that is referenced in the external declaration is structured as the internal declaration example above with defined elements for the note, to, from, heading, and body fields. |
Relationship to other formats | |
Subtype of | XML, Extensible Markup Language |
LC experience or existing holdings | LC has developed and/or used various XML DTDs since the mid 1990s. Examples include: the EAD Document Type Definition (DTD), a standard for encoding archival finding aids (now in an XML version) and the NCBI/NLM Journal Archiving and Interchange DTD. The Mandatory Deposit of Electronic-Only Books documentation includes the NLM DTD. |
---|---|
LC preference | The Library of Congress Recommended Formats Statement (RFS) notes that, for both Preferred and Acceptable formats for Textual Works - Digital, XML-based formats should include or make accessible DTDs and schemas. Widely used DTDs such as TEI and DocBook are listed as Preferred for XML-based formats, while SGML Document Type Definition associated DTDs are Acceptable. Additionally, for Textual Works- Electronic Serials, XML-based formats with accessible DTDs, schemas, and associated stylesheets at Acceptable. |
Disclosure | The language for expressing DTDs is defined within the specification of XML. |
---|---|
Documentation | Extensible Markup Language (XML) 1.0 |
Adoption | Widely adopted for specification of document-centric XML document types and use in publishing. The various versions of HTML are defined through DTDs. See list of HTML and XHTML Document Type Definitions (link via Internet Archive) at University of Toronto. Examples of other DTDs in widespread use within particular communities include News Industry Text Format (NITF), DTB (Digital Talking Book), and the NCBI/NLM Journal Archiving and Interchange DTD. w3 schools, a widely used site for web development skill building, provides tutorials for learning about DTDs. |
Licensing and patents | None |
Transparency | See XML. |
Self-documentation |
Comments as to purpose, structure, etc. can be embedded in DTD files. Accessibility Features DTDs have limited support for accessibility features. An XML DTD is accessible if it enables and promotes the creation of accessible documents. A DTD can do this by including or providing support for element and attribute sets that contribute to accessible documents, such as those that allow for alternative text descriptions. See XML (Extensible Markup Language) for accessibility information for XML files. |
External dependencies | None |
Technical protection considerations | None |
Text | |
---|---|
Normal rendering | DTDs can be viewed and searched as normal text. DTDs are not strictly "normal" text, since their function is to support the creation, validation, and manipulation of documents in the class they define. Quality and functionality factors are typically assessed on the basis of a particular DTD and the fitness of the defined document class for the intended purpose. |
Other | |
Format specification | A DTD has the special purpose of defining a class of XML documents. |
Tag | Value | Note |
---|---|---|
Filename extension | dtd |
See RFC 3023 for further details. |
Internet Media Type | application/xml-dtd |
See RFC 3023 for further details. |
Pronom PUID | x-fmt/315 |
See http://www.nationalarchives.gov.uk/PRONOM/x-fmt/315. |
Wikidata Title ID | Q212327 |
See https://www.wikidata.org/wiki/Q212327. |
Other | NF00162 |
See https://www.archives.gov/files/lod/dpframework/id/NF00162.ttl. |
General | From Wikipedia, "As of 2009, newer XML namespace-aware schema languages (such as W3C XML Schema and ISO RELAX NG) have largely superseded DTDs. A namespace-aware version of DTDs is being developed as Part 9 of ISO DSDL. DTDs persist in applications that need special publishing characters, such as the XML and HTML Character Entity References, which derive from larger sets defined as part of the ISO SGML standard effort." |
---|---|
History | Derived from SGML Document Type Definition specification language. |
|